Skip to main content

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 uses HTML forms with POST method to collect data for various entities. All forms are submitted to corresponding PHP files for processing and database insertion.

Student Management Forms

Add Student Form

File: AddStudent.html
Action: AddStudent.php
Method: POST
Sname
text
required
Student’s first name
Ssurname
text
required
Student’s last name
Sbirthday
date
required
Student’s date of birth (maximum date: 2023-04-06)
Parent_ID
text
required
ID of the parent associated with this student
Class_ID
text
required
ID of the class the student is enrolled in
<form method="post" action="AddStudent.php">
  <label for="Sname">Student Name:*</label>
  <input type="text" required name="Sname">
  
  <label for="Ssurname">Student Lastname:*</label>
  <input type="text" required name="Ssurname">
  
  <label for="Sbirthday">Student Birthday:*</label>
  <input type="date" required max="2023-04-06" name="Sbirthday" />
  
  <label for="Parent_ID">Parent ID:*</label>
  <input type="text" required name="Parent_ID">
  
  <label for="Class_ID">Class ID:*</label>
  <input type="text" required name="Class_ID">
  
  <input type="submit" name="submit">
</form>

Teacher Management Forms

Add Teacher Form

File: AddTeacher.html
Action: AddTeacher.php
Method: POST
bonus_amount
text
Optional bonus amount for the teacher
teacher_field
text
required
Subject or field the teacher specializes in
Tname
text
required
Teacher’s first name
Tsurname
text
required
Teacher’s last name
Taddress
textarea
required
Complete address of the teacher (50 columns × 10 rows)
Tmobile
tel
required
Teacher’s mobile phone number
Temail
email
required
Teacher’s email address
<form method="post" action="AddTeacher.php">
  <label for="bonus_amount">Bonus Amount:</label>
  <input type="text" name="bonus_amount" />
  
  <label for="teacher_field">Teacher Field</label>
  <input required type="text" name="teacher_field" />
  
  <label for="Tname">Teacher First Name:</label>
  <input required type="text" name="Tname">
  
  <label for="Tsurname">Teacher Last Name:</label>
  <input required type="text" name="Tsurname">
  
  <label for="Taddress">Teacher Address:</label>
  <textarea required name="Taddress" cols="50" rows="10"></textarea>
  
  <label for="Tmobile">Teacher Mobile:</label>
  <input required type="tel" name="Tmobile">
  
  <label for="Temail">Teacher Email:</label>
  <input required type="email" name="Temail" />
  
  <input type="submit" name="submit">
</form>

Parent Management Forms

Add Parent Form

File: AddParent.html
Action: AddParent.php
Method: POST
Pname
text
required
Parent’s first name
Psurname
text
required
Parent’s last name
Paddress
textarea
required
Parent’s complete address (50 columns × 10 rows)
Pemail
email
Parent’s email address (optional)
<form method="post" action="AddParent.php">
  <label for="Pname">Parent First Name:</label>
  <input required type="text" name="Pname">
  
  <label for="Psurname">Parent Last Name:</label>
  <input required type="text" name="Psurname">
  
  <label for="Paddress">Parent Address</label>
  <textarea required name="Paddress" cols="50" rows="10"></textarea>
  
  <label for="Pemail">Parent Email:</label>
  <input type="email" name="Pemail">
  
  <input type="submit" name="submit">
</form>

Class Management Forms

Add Class Form

File: AddClass.html
Action: AddClass.php
Method: POST
classYear
text
required
Name or year of the class (e.g., “Grade 3”, “Year 5”)
capacity
number
required
Maximum number of students the class can accommodate (minimum: 1)
Teacher_ID
text
required
ID of the teacher assigned to this class
<form method="post" action="AddClass.php">
  <label for="classYear">Class Name:</label>
  <input required type="text" name="classYear">
  
  <label for="capacity">Class Capacity:</label>
  <input required type="number" min="1" name="capacity">
  
  <label for="Teacher_ID">Teacher ID:</label>
  <input type="text" required name="Teacher_ID">
  
  <input type="submit" name="submit">
</form>

Salary Management Forms

Add Salary Form

File: AddSalary.html
Action: AddSalary.php
Method: POST
Teacher_ID
text
required
ID of the teacher to assign salary to
salary_amount
text
required
Salary amount for the teacher
workingTimes
select
required
Working time type. Options:
  • partTime - Part-Time
  • fullTime - Full-Time
<form method="post" action="AddSalary.php">
  <label for="Teacher_ID">Teacher ID:</label>
  <input required type="text" name="Teacher_ID">
  
  <label for="salary_amount">Salary amount:</label>
  <input required type="text" name="salary_amount">
  
  <label for="workingTimes">Select working type:</label>
  <select required id="workingTimes" name="workingTimes">
    <option value="partTime">Part-Time</option>
    <option value="fullTime">Full-Time</option>
  </select>
  
  <input type="submit" name="submit">
</form>

Gym Member Management Forms

Add Gym Member Form

File: AddGymMember.php (combined HTML + PHP)
Action: AddGymMember.php
Method: POST
Sid
text
required
Student ID of the gym member
gymFullName
text
required
Full name of the gym member
userRegDate
date
required
Registration date for gym membership
memberType
select
required
Membership tier. Options:
  • bronzeMember - Bronze (30 days validity)
  • silverMember - Silver (60 days validity)
  • goldMember - Gold (90 days validity)
  • diamondMember - Diamond (180 days validity)
medicalCondition
text
Any medical conditions (optional)
The system automatically calculates membership expiration date based on the selected member type.
<form method="post" action="AddGymMember.php">
  <label for="Sid">Student ID:</label>
  <input required type="text" name="Sid" />
  
  <label for="gymFullName">Enter full name:</label>
  <input required type="text" name="gymFullName">
  
  <label for="userRegDate">Register Date:</label>
  <input required type="date" name="userRegDate">
  
  <label for="memberType">Member Type:</label>
  <select required id="memberType" name="memberType">
    <option value="bronzeMember">Bronze</option>
    <option value="silverMember">Silver</option>
    <option value="goldMember">Gold</option>
    <option value="diamondMember">Diamond</option>
  </select>
  
  <label for="medicalCondition">Medical Condition (if there're any)</label>
  <input type="text" name="medicalCondition">
  
  <input type="submit" name="submit">
</form>

Update Gym Member Form

File: UptadeGym.html
Action: UptadeGym.php
Method: POST
Updates gym member information using gymMemberID as the identifier.

Delete Gym Member Form

File: DeleteGymMember.html
Action: DeleteGymMember.php
Method: POST
gymMemberID
text
required
ID of the gym member to delete

Contact Form

Contact Us Form

File: Contact.html
Action: Contact.php
Method: POST
This form allows users to submit inquiries or feedback to the school administration.
contactName
text
required
Name of the person submitting the contact form
returnContact
email
Email address for response (optional)
message
textarea
required
Message or inquiry content (12 rows × 80 columns)
<form method="post" action="Contact.php">
  <label for="contactName">Name:</label>
  <input type="text" name="contactName" required>
  
  <label for="returnContact">Return contact email (optional):</label>
  <input type="email" name="returnContact">
  
  <label for="message">Message:</label>
  <textarea name="message" rows="12" cols="80" required></textarea>
  
  <input type="submit" name="submit">
</form>

Form Validation

HTML5 Validation

All forms use HTML5 required attribute for mandatory fields

Input Types

Forms utilize appropriate input types (email, tel, date, number) for better UX

Date Constraints

Date fields include max attribute to prevent future dates where applicable

Number Constraints

Number fields include min attribute to enforce positive values

Common Form Patterns

1

User Input

User fills out the form with required and optional fields
2

HTML5 Validation

Browser validates required fields and input types before submission
3

Form Submission

Form data is sent via POST method to the corresponding PHP file
4

Server Processing

PHP script processes the data and performs database operations
5

Feedback

User receives success or error message based on the operation result

Form Security Considerations

The current implementation has several security vulnerabilities:
  • No CSRF protection
  • No input sanitization before database insertion
  • SQL injection vulnerabilities (direct string concatenation in queries)
  • No server-side validation
  • Database credentials exposed in source code
Recommended Improvements:
  1. Implement prepared statements with parameterized queries
  2. Add CSRF tokens to all forms
  3. Sanitize and validate all user inputs on the server side
  4. Move database credentials to environment variables
  5. Implement proper error handling and logging
  6. Add rate limiting for form submissions