Jump to content

Coding help please


ishvir

Recommended Posts

Hello,

 

My wife wants to set up a PHP Powered Demerit System at her school. I have basic PHP and MySQL skills.

 

Basically she wants a web interface where a student logs in with Student Number and Password.

 

Demerits and merits accrue to the students as below:

Coming late to school, 1 Demerit

Handing an assignment late, 2 Demerits

No Demerits in 3 months equals 1 Merit assigned

Student suspended after 6 / more Demerits

Parent / Gaurdian emailed

 

The student will see the table below once logged in:

Student Name

Student ID Date                 Action                     Demerit Merit         Total

A123         2012/02/26 Late Sign In               1         0         1

                2012/02/28 Late Assignment       1         0         2

                2012/05/29 3 month Merit earned    0         1         1

                2012/06/08 Late Assignment       2         0         3

                2012/06/10 Late Assignment       2         0         5

                2012/06/12 Late Assignment       2         0         7

                                                                              Student suspended

                                                                              Send email to parent/gaurdian

                   

I would really appreciate any help you can offer in terms of what PHP code to include in the HTML doc as well as how many MySQL Tables to setup as well as where to store which data?

 

Thanks,

Ishvir

Link to comment
Share on other sites

Dear Ignance,

 

Thanks for the reply.

 

I do not have any code as yet.

 

At present I am just reading some PHP & MySQL Tutorials so that I can figure how to setup the PHP Login on the one side and what Tables to create on the other.

 

Any pointers on where and how to start are welcome.

 

Thanks,

Ishvir

Link to comment
Share on other sites

It sounds like you need the following:

registration

--- web page form for following information-

student first, student last, student middle, student email, username, password, parent1 Name, parent1 email, parent2 Name, parent2 email

table with those columns, plus a primary key

 

---- log in page -containing user name and password

-->check against username password, get primary key from table (userPK)

-------------------------------------//////

 

teacher interface - username and password

if there is just one teacher, you could just make a private location that only the user would have access to

 

--- web page allowing the input of demerits - I'd just do a drop down for students, if there are under 45 of them, drop down for ActionID , NumberDemerit

interface would need

Student ID  Date                    ActionID        NumberDemerit  Merit 

table with same information as above

 

table Actions-

ActionID, ActionDescription, NumberDemerits

 

Then you would program the rest do the rest - each time the student logs in you could check if they have a merit or not, each time a student has a demerit, verify their total count is less that 6, if == 6 send out email. You could send out a warning if student is at 4 if you wanted.

 

That's a rough draft, start at one point and just keep going forward.

 

so, 3, maybe 4 tables in database

pages - 6

login for student

login for teacher

---- text for email

display page for student

page for input of demerits

when user logs out, page that says they are logged out

maybe a splash page-

Link to comment
Share on other sites

The student will see the table below once logged in:

Student Name

Student ID  Date                    Action                        Demerit  Merit          Total

A123          2012/02/26  Late Sign In                1          0          1

                  2012/02/28  Late Assignment        1          0          2

                  2012/05/29  3 month Merit earned    0          1          1

                  2012/06/08  Late Assignment        2          0          3

                  2012/06/10  Late Assignment        2          0          5

                  2012/06/12  Late Assignment        2          0          7

                                                                                              Student suspended

                                                                                              Send email to parent/gaurdian

 

The table structure could be something like (not all fields are included):

 

student (s_id, s_fname, s_lname)

student_action (sa_id, sa_name, sa_demerits, sa_merits)

student_log (sl_id, s_id, sa_id, sl_attributed_at)

 

Where student, student_action, and student_log are all tables. s_id, sa_id, and sl_id are primary keys. Example rows would be:

 

student table

(s_id, s_fname, s_lname)

1, Foo, Bar

2, Baz, Bat

 

student_action table

(sa_id, sa_name, sa_demerits, sa_merits)

1, Late Sign In, 1, 0

2, Late Assignment, 2, 0

3, 3 month Merit earned, 0, 1

 

student_log table

(sl_id, s_id, sa_id, sl_attributed_at)

1, 1, 1, 2012-02-27

2, 1, 2, 2012-02-27

3, 1, 3, 2012-02-27

 

As you can see, changing the number of merits/demerits an action accrues will be reflected in the student_log table. Thus changing the number of demerits for Late Sign In from 1 to 2 will increase the total for each line (for that particular action) in the student_log for a certain student.

 

To easily create mysql tables you could use HeidiSQL or possibly your webhost already has PHPMyAdmin installed, which can be used aswell to create the tables.

 

The query would be something like:

 

SELECT s_id, sl_attributed_at, sa_name, sa_demerits, sa_merits

FROM student_log

JOIN student_action USING(sa_id)

WHERE s_id = ?

 

You would use PHP to total each line. This should be enough to get you started. Possibly you may want to add years (2012-2013) to the design. When a student is in his last year, you probably don't want to count the demerits/merits he caught his first year.

 

Post any questions that you may have.

Link to comment
Share on other sites

Generally students are pretty good at breaking into systems, especially those which will email their parents to tell them the child is in trouble.  If you don't have enough PHP/SQL skill to even start this project, you certainly don't have enough to make it secure from school children.  I broke into my first school system when I was 11. 

 

That being said, if you still want to do this, get a real book.  Learning based on free web tutorials isn't great.  I recommend O'Reilly's "Web Database Programming with PHP & MySQL."  It's at B&N or amazon.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.