Spaces:
Sleeping
Sleeping
| {% extends 'base.html' %} | |
| {% block title %}Edit Student β StudentMS{% endblock %} | |
| {% block content %} | |
| <div class="page-header"> | |
| <div> | |
| <h2 class="page-title">Edit Student</h2> | |
| <p class="page-sub">Update the student record below</p> | |
| </div> | |
| <a href="{{ url_for('view_students') }}" class="btn-outline"> | |
| <i class="fas fa-arrow-left"></i> Back | |
| </a> | |
| </div> | |
| <div class="card"> | |
| <form method="POST" action="{{ url_for('edit_student', sid=sid) }}" id="studentForm" novalidate> | |
| <!-- ββ SECTION 1: Identity ββ --> | |
| <div class="form-section"> | |
| <div class="form-section-title"><i class="fas fa-id-card"></i> Student Identity</div> | |
| <div class="form-grid"> | |
| <div class="form-group"> | |
| <label>Student ID <span class="req">*</span></label> | |
| <input type="text" name="student_id" value="{{ student.student_id if student.student_id is defined else student['student_id'] }}" placeholder="e.g. STU2024001" /> | |
| <span class="field-error" id="err-student_id"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Full Name <span class="req">*</span></label> | |
| <input type="text" name="full_name" value="{{ student['full_name'] }}" placeholder="Full legal name" /> | |
| <span class="field-error" id="err-full_name"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Father Name <span class="req">*</span></label> | |
| <input type="text" name="father_name" value="{{ student['father_name'] }}" placeholder="Father's full name" /> | |
| <span class="field-error" id="err-father_name"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Mother Name <span class="req">*</span></label> | |
| <input type="text" name="mother_name" value="{{ student['mother_name'] }}" placeholder="Mother's full name" /> | |
| <span class="field-error" id="err-mother_name"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Gender <span class="req">*</span></label> | |
| <select name="gender"> | |
| {% for g in ['Male','Female','Other'] %} | |
| <option value="{{ g }}" {% if student['gender']==g %}selected{% endif %}>{{ g }}</option> | |
| {% endfor %} | |
| </select> | |
| <span class="field-error" id="err-gender"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Date of Birth <span class="req">*</span></label> | |
| <input type="date" name="dob" value="{{ student['dob'] }}" /> | |
| <span class="field-error" id="err-dob"></span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- ββ SECTION 2: Contact ββ --> | |
| <div class="form-section"> | |
| <div class="form-section-title"><i class="fas fa-envelope"></i> Contact Details</div> | |
| <div class="form-grid"> | |
| <div class="form-group"> | |
| <label>Email <span class="req">*</span></label> | |
| <input type="email" name="email" value="{{ student['email'] }}" placeholder="student@example.com" /> | |
| <span class="field-error" id="err-email"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Phone Number <span class="req">*</span></label> | |
| <input type="tel" name="phone" value="{{ student['phone'] }}" placeholder="10-digit number" maxlength="10" /> | |
| <span class="field-error" id="err-phone"></span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- ββ SECTION 3: Academic ββ --> | |
| <div class="form-section"> | |
| <div class="form-section-title"><i class="fas fa-book-open"></i> Academic Details</div> | |
| <div class="form-grid"> | |
| <div class="form-group"> | |
| <label>Course <span class="req">*</span></label> | |
| <select name="course"> | |
| {% for c in ['B.Tech','M.Tech','BCA','MCA','B.Sc','M.Sc','B.Com','M.Com','BBA','MBA','BA','MA','B.Pharm','Diploma'] %} | |
| <option value="{{ c }}" {% if student['course']==c %}selected{% endif %}>{{ c }}</option> | |
| {% endfor %} | |
| </select> | |
| <span class="field-error" id="err-course"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Branch <span class="req">*</span></label> | |
| <input type="text" name="branch" value="{{ student['branch'] }}" placeholder="e.g. Computer Science" /> | |
| <span class="field-error" id="err-branch"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Year / Semester <span class="req">*</span></label> | |
| <select name="year_sem"> | |
| {% for y in ['1st Year / 1st Sem','1st Year / 2nd Sem','2nd Year / 3rd Sem','2nd Year / 4th Sem','3rd Year / 5th Sem','3rd Year / 6th Sem','4th Year / 7th Sem','4th Year / 8th Sem'] %} | |
| <option value="{{ y }}" {% if student['year_sem']==y %}selected{% endif %}>{{ y }}</option> | |
| {% endfor %} | |
| </select> | |
| <span class="field-error" id="err-year_sem"></span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- ββ SECTION 4: Address ββ --> | |
| <div class="form-section"> | |
| <div class="form-section-title"><i class="fas fa-location-dot"></i> Address</div> | |
| <div class="form-grid"> | |
| <div class="form-group form-group-full"> | |
| <label>Address <span class="req">*</span></label> | |
| <textarea name="address" rows="2" placeholder="Street / Locality">{{ student['address'] }}</textarea> | |
| <span class="field-error" id="err-address"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>City <span class="req">*</span></label> | |
| <input type="text" name="city" value="{{ student['city'] }}" placeholder="City name" /> | |
| <span class="field-error" id="err-city"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>State <span class="req">*</span></label> | |
| <select name="state"> | |
| {% for st in ['Andhra Pradesh','Arunachal Pradesh','Assam','Bihar','Chhattisgarh','Goa','Gujarat','Haryana','Himachal Pradesh','Jharkhand','Karnataka','Kerala','Madhya Pradesh','Maharashtra','Manipur','Meghalaya','Mizoram','Nagaland','Odisha','Punjab','Rajasthan','Sikkim','Tamil Nadu','Telangana','Tripura','Uttar Pradesh','Uttarakhand','West Bengal','Delhi','Jammu & Kashmir','Ladakh','Chandigarh','Puducherry'] %} | |
| <option value="{{ st }}" {% if student['state']==st %}selected{% endif %}>{{ st }}</option> | |
| {% endfor %} | |
| </select> | |
| <span class="field-error" id="err-state"></span> | |
| </div> | |
| <div class="form-group"> | |
| <label>Pin Code <span class="req">*</span></label> | |
| <input type="text" name="pin_code" value="{{ student['pin_code'] }}" placeholder="6-digit pin" maxlength="6" /> | |
| <span class="field-error" id="err-pin_code"></span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- ββ BUTTONS ββ --> | |
| <div class="form-actions"> | |
| <button type="submit" class="btn-primary"> | |
| <i class="fas fa-floppy-disk"></i> Update Student | |
| </button> | |
| <a href="{{ url_for('view_students') }}" class="btn-outline">Cancel</a> | |
| </div> | |
| </form> | |
| </div> | |
| {% endblock %} | |