Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ubik69/backEndDevelopment/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Primary School Management System allows you to add various types of records through dedicated HTML forms. Each form collects specific information and submits it to a PHP script that inserts the data into the database using MySQL.Accessing Add Forms
Navigate to the Add menu
From the navigation bar, click on the Add dropdown button to reveal all available record types.
All forms are accessible from the navigation dropdown menu located at the top of every page in the system.
Adding a Student
To add a new student to the system, navigate toAddStudent.html from the Add dropdown menu.
Enter required details
- Student Name (
Sname): First name of the student - Student Lastname (
Ssurname): Last name of the student - Student Birthday (
Sbirthday): Date of birth (must be before April 6, 2023) - Parent ID (
Parent_ID): ID of the associated parent record - Class ID (
Class_ID): ID of the class the student belongs to
The system validates that the birthday cannot be later than April 6, 2023. Make sure the Parent ID and Class ID already exist in the database before creating a student record.
Backend Processing
When you submit the student form, theAddStudent.php script processes the data:
Student1 table and displays a success or error message.
Adding a Teacher
To add a new teacher, navigate toAddTeacher.html.
Enter teacher information
- Bonus Amount (
bonus_amount): Optional monetary bonus - Teacher Field (
teacher_field): Subject or area of specialization (required) - Teacher First Name (
Tname): First name (required) - Teacher Last Name (
Tsurname): Last name (required) - Teacher Address (
Taddress): Full residential address (required) - Teacher Mobile (
Tmobile): Contact phone number (required) - Teacher Email (
Temail): Email address (required)
The email field uses HTML5 validation to ensure a properly formatted email address. The mobile field expects a telephone number format.
Database Insertion
TheAddTeacher.php script executes:
Adding a Parent
Parent records can be added viaAddParent.html.
Enter parent details
- Parent First Name (
Pname): Required - Parent Last Name (
Psurname): Required - Parent Address (
Paddress): Full address (required) - Parent Email (
Pemail): Optional contact email
Adding a Class
Classes can be created throughAddClass.html.
Provide class details
- Class Name (
classYear): Name or identifier for the class - Class Capacity (
capacity): Maximum number of students (minimum 1) - Teacher ID (
Teacher_ID): ID of the assigned teacher
Adding a Salary Record
Salary information can be added throughAddSalary.html.
Enter salary information
- Teacher ID (
Teacher_ID): The teacher receiving this salary - Salary Amount (
salary_amount): The monetary amount - Working Type (
workingTimes): Select either Part-Time or Full-Time
Success and Error Messages
After submitting any add form, the system displays:- Success: “New record created successfully”
- Error: “Error adding record”
If you encounter an error, verify that:
- All required fields are filled
- Foreign key references (Parent_ID, Class_ID, Teacher_ID) exist in their respective tables
- Date formats are correct
- Email and phone formats are valid
Database Connection
All add operations connect to the MySQL database using:The system uses the
mysqli_connect() function to establish a connection with the MySQL server and returns the connection as an object for all database operations.