Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/10/2023 in all areas

  1. Does the uploads/ directory exist? And does it exist at (I think:) /paypal/uploads?
    1 point
  2. your database design is not normalized. this results in repeating the same data values over and over. you should have a column for, and store the Ass_ID value in the mykra table, instead of repeating the 'Point_Description' and 'Point_Marks' values in every row in that table. doing this will also simplify and help secure the form code, since you will no longer be passing the description[] and rating[] fields through the form, and it will simplify the ajax related code. some points about the code - you need to stop copying variables to other variables for nothing. this is just a waste of your time typing. just use the original variables that data is in. you need to go through the code and eliminate all the unused code and unused variables. an empty action='' attribute is not valid html5. to cause a form to submit to the same page it is on, leave out the entire action attribute. you cannot set the value attribute of a type='file' field, so you might as well remove that from the ajax code (you aren't setting a 'file' value in the json data, so that code wasn't doing anything anyways.) you would want to build/output the href link using directory/document data. if there is a validation/user error in the post method form processing code, the form fields need to be 'sticky' and repopulate their values with any existing form data, so that the user doesn't need to keep reentering/editing values over and over. you havn't posted it yet, but the insert/update query (there's a single query to do this) could result in duplicate data. you need to handle this in the code and setup an error message for the user letting them know what was wrong with the data that they submitted, so that they can modify the offending value and resubmit the data again. you need to validate the resulting web pages at validator.w3.org as to getting this to work, the Ass_ID value is the 'key' to finding the correct <tr> row of form inputs to operate on. it is also the 'key' to inserting/updating the correct rows of data in the database table when the form is submitted. in the html table/form code, you need a hidden array field with the Ass_ID values in it. this will let you associate the submitted Ass_ID values with the corresponding data from the other form array fields. you also need a way of referencing the <tr> for each row. to do this add an id='...' attribute, such as - <tr id='<?='Aid_'.$row['Ass_ID']?>'> in the Mykra_view.php code, you need to build the json data with the Ass_ID value, such as - $return_arr[] = array( 'Aid' => $row['Ass_ID'], // add the Ass_ID to the json data "target" => $row['Marks_Target'], "actual" => $row['Marks_Actual'], "date" => $row['DOS'], "remarks" => $row['Marks_Description'] ); then in the ajax success code, you would get the Aid value and use it to select/find the correct form field value to set with the data - <script> function viewData() { var month = document.getElementById("Month").value; var employeeid = document.getElementById("employeeno").value; $.ajax({ type: 'get', dataType: 'JSON', url: 'Mykra_view.php', data: 'Month=' + month + '&employeeno=' + employeeid, success: function (response) { var len = response.length; for (var i = 0; i < len; i++) { var Aid = response[i].Aid; var target = response[i].target; var actual = response[i].actual; var date = response[i].date; var remarks = response[i].remarks; $('#Aid_'+Aid).find('.target').val(target); $('#Aid_'+Aid).find('.actual').val(actual); $('#Aid_'+Aid).find('.date').val(date); $('#Aid_'+Aid).find('.remarks').val(remarks); } } }); } </script> to make the above work, like in your previous thread, you would change the id='...' attributes to class='...' attributes (you would actually add the class names to the existing class='...' attributes.)
    1 point
  3. None. I played around with ChatGPT a bit when it first came out, to see what it was capable of and just have some fun. I was impressed by it's ability to understand things. I fed it a few functions I've written and asked it to explain what the functions did and write sample code using the functions and it was surprisingly accurate. I don't really see much use for it day-to-day though, so I haven't really used it in quite a while. It does get a lot closer to the "Ask a question, get an answer" goal of search engines, which is why I immediately knew people would be working on that and am not at all surprised to see it happening. Eventually as the models get better and more integrated into search, you'll be able to just type a plain-English (or whatever language) question into google and get an actually answer back instead of having to wade through a list of result pages. From the code side of things, the AI is good enough right now to answer simple syntax / logic errors. Take one of the questions posted here as an example. I told ChatGPT what the error was, what the code was, and to tell me why. It responded: I imagine eventually such a tool will be used to help teach new programmers by either providing better error detection in IDE's or having an virtual mentor they can ask questions and get immediate answers rather than having to either search the web or post on a forum and wait for a response. There are already AI coding assistants that might fulfill this task, I haven't tried any of them personally to know how useful they are.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.