xionhack Posted April 13, 2010 Share Posted April 13, 2010 Hello. I have a quick question. I am making a school database and I want to do an attendance form. I am a little bit confused of what is the best approach. Right now i did this. One table (member) with member_id and student_name. One "attendance" table with attendance_id, attendance_date, student_id, type_attendace. Type_attendance means a code to differentiate if the person is late or on time. Then in the php i will have a type of grid, that gives me in the left all the names of the student, and then to the right a box where i write the code. Is that the best approach to do this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/ Share on other sites More sharing options...
Ken2k7 Posted April 14, 2010 Share Posted April 14, 2010 The database is fine, I guess. Not sure about the user interface. What do you mean a "box where i write the code"? If you're going to make a user interface, you shouldn't have to write code. That's the whole point of a user interface. But of course, this is all just speculation. You should create it that best fit the description or whatever the school wants it to be. Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/#findComment-1041435 Share on other sites More sharing options...
oni-kun Posted April 14, 2010 Share Posted April 14, 2010 Why not set the attendence to TINYINT to be false or true, But false default? A list of students (populated from database) and checkmarks can be easily generated, each chechbox can be an array (IE: attended[]) Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/#findComment-1041439 Share on other sites More sharing options...
Ken2k7 Posted April 14, 2010 Share Posted April 14, 2010 TINYINT may work. The problem is that there can be many types. Unexcused absence, excused absence, tardy, on-time, etc. Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/#findComment-1041442 Share on other sites More sharing options...
oni-kun Posted April 14, 2010 Share Posted April 14, 2010 TINYINT may work. The problem is that there can be many types. Unexcused absence, excused absence, tardy, on-time, etc. Ah. Maybe a similar field to go along with it. If you have attendances per say, As TINYINT then you can get their total attendence without any thing special. Reasons can simply become another field as an index of reasons, As that type as signed will allow up to 128 types of reasons. Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/#findComment-1041449 Share on other sites More sharing options...
ignace Posted April 14, 2010 Share Posted April 14, 2010 Just use a VARCHAR field setup your HTML like: <input type="checkbox" name="attend[$id]" value="unexcused absence"> <input type="checkbox" name="attend[$id]" value="excused absence"> <input type="checkbox" name="attend[$id]" value="tardy"> <input type="checkbox" name="attend[$id]" value="on-time"> Quote Link to comment https://forums.phpfreaks.com/topic/198431-school-attendance/#findComment-1041493 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.