This question does not contain code snippets, but I will be adding after some initial suggestions. Let me describe my problem: I'm creating a Marks Allotment website for my college, where a professor logs in.
This is what I expect the system to do:
- Upon logging in, professor sees a dashboard with the details of the students of his class, in a tabular format.
- The professor assigns marks by editing the respective fields of the students' records. [say, changing the default value 0 to 25]
- He then clicks a button which updates multiple records that have been edited in the database.
The problem I'm facing is:
-
creating a front-end that displays initially, my table in the front end, and has editable Marks fields.
-
Updating only the records that the professor edits, in one click.
I currently plan on making the button that updates rows using a for loop logic in the back-end, something like:
//Pseudo-code
foreach(record that was updated){
fetch updated values
create insert query
insert record with updated values
}
although I'm not entirely sure how efficient that'll be. If there is a better way I can do it, I'd be happy to get suggestions.
For creating the kind of front-end I have in mind as described above, I have no clue how to do it.
It is almost like I'll have to dynamically create text fields in line with the records fetched, which display marks currently in the table for that student. The professor can then update the database with the new values that are fetched from the text fields.
Let me know if I'm missing something, or making a fatal error. Thanks!
Additional Information:
- Database: MySQL
- Framework: Laravel 5.8
PS: My apologies if this question lacks brevity and code. I'll try my best to keep it clear and will add code in the coming question updates.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire