Uploaded by Ebtesam Yasin

Assignment 2

advertisement
University of Bahrain
Information Technology College
Computer Science Department
ITCS 333/473 – Assignment 2
Duration: 10 Days
Create StudentsDB database in MySQL server with the following table:
Table: Students
uid
int, Primary Key, Auto Increment
studentID
varchar(8), Unique
name
varchar(50)
major
varchar(50)
passedCredits
int
CGPA
float
Implement the following PHP scripts as required below:
1. displayStudentsReport.php: the script should display student’s info (StudentID,
name, major, credits passed and CGPA) in HTML table with appropriate title for each
column. Student cells/rows should be highlighted as follows:
Condition
Student At Risk: CGPA < 2.0
Expected to graduate: Passed Credits >=115
Outstanding Student: CGPA = 3.5 or above
Highlight Color
Red for CGPA Cell
Yellow for Passed Credits Cell
Green for the entire Student Row
2. RemoveStudents.php: This script should display all students’ names and major. Each
student will be identified by a checkbox (define the checkbox name as a numeric array
holding the uid). The user should be able to choose which student to be deleted by using
its corresponding checkboxes. When the user clicks on the delete selected students
button, your script should display (“Are you sure you want to delete N student’s
records?” where N represents the number of selected students) and two buttons
(Confirm and Cancel). Your script should delete the records permanently if the user
decides to click on confirm button. If the user clicks on Cancel, the script should take
the user to the first page where the user can re-select the students. Appropriate error
message should be displayed in case the user didn’t select any checkbox.
(No JavaScript is allowed to solve this exercise; you may need to use
serialize/unserialize or json_encode/json_decode functions with hidden form
element to solve this part)
3. Login.php: Add login page so that only authorized users can view and delete students’
records. You will need to add new DB table called users and make sure all pages
defined in Parts 1 and 2 are only accessible by authorized users.
Download