updates
This commit is contained in:
1 parent
9e119917b6
commit
7c402bfb88
54 files changed
+1639
-5032
No files matched your search
@@ -1,135 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
.btn-back {
|
||||
background-color: #6c757d;
|
||||
border-color: #6c757d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-back:hover {
|
||||
background-color: #5a6268;
|
||||
border-color: #545b62;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background-color: #0056b3;
|
||||
border-color: #004085;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Add Academic Year</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Academic Years
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Start Date -->
|
||||
<div class="form-group">
|
||||
<label for="start_date" class="required-field">Start Date</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="start_date"
|
||||
name="start_date"
|
||||
required />
|
||||
<div class="invalid-feedback">Please provide a valid start date</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-submit">
|
||||
<i class="fas fa-save"></i> Save Academic Year
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false,
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,138 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Add Course{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet">
|
||||
<style>
|
||||
.required-field::after {
|
||||
content: "*";
|
||||
color: red;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.help-text {
|
||||
font-size: 0.875rem;
|
||||
color: #6c757d;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">
|
||||
<i class="nav-icon fas fa-book"></i>
|
||||
Add Course
|
||||
</h1>
|
||||
<a href="/manage_course" class="btn btn-primary">
|
||||
<i class="fas fa-list"></i> Manage Course
|
||||
</a>
|
||||
</div>
|
||||
<div class="container py-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2 class="h4 mb-0">{{ title|default:"Add New Course" }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Course Name -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="name" class="required-field">Course Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="name"
|
||||
name="name"
|
||||
placeholder="Enter course name"
|
||||
required>
|
||||
<div class="help-text">Course name must be unique</div>
|
||||
<div class="invalid-feedback">Please enter a course name</div>
|
||||
</div>
|
||||
<!-- Course Type -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="course_type" class="required-field">Course Type</label>
|
||||
<select class="form-control" id="course_type" name="course_type" required>
|
||||
<option value="">Select Course Type</option>
|
||||
<option value="semester">Semester-based</option>
|
||||
<option value="year">Year-based</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">Please select a course type</div>
|
||||
</div>
|
||||
<!-- Duration -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="duration" class="required-field">Duration</label>
|
||||
<input type="number"
|
||||
class="form-control"
|
||||
id="duration"
|
||||
name="duration"
|
||||
placeholder="Enter duration"
|
||||
min="1"
|
||||
required>
|
||||
<div class="help-text">Specify the duration</div>
|
||||
<div class="invalid-feedback">Please enter a valid duration (minimum 1 month)</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="/manage_course" class="btn btn-secondary">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Save Course
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
const forms = document.querySelectorAll('.needs-validation')
|
||||
|
||||
Array.from(forms).forEach(form => {
|
||||
form.addEventListener('submit', event => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,149 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2 class="mb-4">Add Student</h2>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<!-- Name Fields -->
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="first_name" class="form-label">First Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="middle_name" class="form-label">Middle Name</label>
|
||||
<input type="text" class="form-control" id="middle_name" name="middle_name" />
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="last_name" class="form-label">Last Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="last_name"
|
||||
name="last_name"
|
||||
required />
|
||||
</div>
|
||||
<!-- Course and Academic Year -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="course" class="form-label">Course</label>
|
||||
<select class="form-select" id="course" name="course" required>
|
||||
<option value="">Select Course</option>
|
||||
{% for course in courses %}<option value="{{ course.id }}">{{ course.name }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="academic_year" class="form-label">Academic Year</label>
|
||||
<select class="form-select" id="academic_year" name="academic_year" required>
|
||||
<option value="">Select Academic Year</option>
|
||||
{% for year in academic_years %}<option value="{{ year.id }}">{{ year.start_date }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<!-- Personal Information -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="phone" class="form-label">Phone</label>
|
||||
<input type="text" class="form-control" id="phone" name="phone" required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="dob" class="form-label">Date of Birth</label>
|
||||
<input type="date" class="form-control" id="dob" name="dob" required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="gender" class="form-label">Gender</label>
|
||||
<select class="form-select" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="M">Male</option>
|
||||
<option value="F">Female</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Address -->
|
||||
<div class="col-12 mb-3">
|
||||
<label for="address" class="form-label">Address</label>
|
||||
<textarea class="form-control" id="address" name="address" rows="3" required></textarea>
|
||||
</div>
|
||||
<!-- Parent Information -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="father_name" class="form-label">Father's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="father_name"
|
||||
name="father_name"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="mother_name" class="form-label">Mother's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="mother_name"
|
||||
name="mother_name"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="parents_number" class="form-label">Parents' Contact Number</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="parents_number"
|
||||
name="parents_number"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="father_occupation" class="form-label">Father's Occupation</label>
|
||||
<select class="form-select" id="father_occupation" name="father_occupation">
|
||||
<option value="">Select Occupation</option>
|
||||
{% for key, value in occupation_choices %}<option value="{{ key }}">{{ value }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="mother_occupation" class="form-label">Mother's Occupation</label>
|
||||
<select class="form-select" id="mother_occupation" name="mother_occupation">
|
||||
<option value="">Select Occupation</option>
|
||||
{% for key, value in occupation_choices %}<option value="{{ key }}">{{ value }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<!-- Guardian Information -->
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="guardian_name" class="form-label">Guardian's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="guardian_name"
|
||||
name="guardian_name"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="guardian_number" class="form-label">Guardian's Contact</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="guardian_number"
|
||||
name="guardian_number"
|
||||
required />
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="relationship_with_student" class="form-label">Relationship with Student</label>
|
||||
<select class="form-select"
|
||||
id="relationship_with_student"
|
||||
name="relationship_with_student"
|
||||
required>
|
||||
<option value="">Select Relationship</option>
|
||||
{% for key, value in relationship_choices %}<option value="{{ key }}">{{ value }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-4">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="{% url 'manage_student' %}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,54 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Add Subject{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Add Subject</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_subject' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Subjects
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,100 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2 class="mb-4">{{ title }}</h2>
|
||||
<form method="POST" action="{% url 'add_teacher' %}">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label for="first_name">First Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="middle_name">Middle Name</label>
|
||||
<input type="text" class="form-control" id="middle_name" name="middle_name">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="last_name">Last Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="last_name"
|
||||
name="last_name"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="phone">Phone</label>
|
||||
<input type="text" class="form-control" id="phone" name="phone" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="dob">Date of Birth</label>
|
||||
<input type="date" class="form-control" id="dob" name="dob" required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="gender">Gender</label>
|
||||
<select class="form-control" id="gender" name="gender" required>
|
||||
<option value="">Select Gender</option>
|
||||
<option value="M">Male</option>
|
||||
<option value="F">Female</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="qualification">Qualification</label>
|
||||
<select class="form-control" id="qualification" name="qualification" required>
|
||||
<option value="">Select Qualification</option>
|
||||
{% for key, value in qualification_choices %}<option value="{{ key }}">{{ value }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="specialization_on">Specialization</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="specialization_on"
|
||||
name="specialization_on"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="marital_status">Marital Status</label>
|
||||
<select class="form-control"
|
||||
id="marital_status"
|
||||
name="marital_status"
|
||||
required>
|
||||
<option value="">Select Status</option>
|
||||
{% for key, value in marital_status_choices %}<option value="{{ key }}">{{ value }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="date_of_joining">Date of Joining</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="date_of_joining"
|
||||
name="date_of_joining"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="address">Address</label>
|
||||
<textarea class="form-control" id="address" name="address" rows="2" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right mt-4">
|
||||
<button type="submit" class="btn btn-primary">Add Teacher</button>
|
||||
<a href="{% url 'manage_teacher' %}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,55 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<div class="container-fluid mt-3">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-info text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-user-graduate fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Students</h5>
|
||||
<p class="card-text display-4">{{ student_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-success text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chalkboard-teacher fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Teachers</h5>
|
||||
<p class="card-text display-4">{{ teacher_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-warning text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-book-open fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Courses</h5>
|
||||
<p class="card-text display-4">{{ course_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="card card-danger text-center">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-book fa-3x"></i>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Total Subjects</h5>
|
||||
<p class="card-text display-4">{{ subject_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,94 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
font-size: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
.btn-back {
|
||||
background-color: #6c757d;
|
||||
border-color: #6c757d;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-back:hover {
|
||||
background-color: #5a6268;
|
||||
border-color: #545b62;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #007bff;
|
||||
border-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background-color: #0056b3;
|
||||
border-color: #004085;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Edit Academic Year</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_academicyear' %}" class="btn btn-back">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Academic Years
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label for="start_date">Start Date</label>
|
||||
<!-- Display the previous date value here -->
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="start_date"
|
||||
name="start_date"
|
||||
value="{{ academic_year.start_date|date:'Y-m-d' }}"
|
||||
required />
|
||||
</div>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-submit">
|
||||
<i class="fas fa-save me-1"></i> Save Changes
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,152 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.required-field::after {
|
||||
content: "*";
|
||||
color: red;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.help-text {
|
||||
font-size: 0.875rem;
|
||||
color: #6c757d;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">
|
||||
<i class="nav-icon fas fa-edit"></i>
|
||||
Edit Course
|
||||
</h1>
|
||||
<a href="{% url 'manage_course' %}" class="btn btn-primary">
|
||||
<i class="fas fa-list"></i> Back to Courses
|
||||
</a>
|
||||
</div>
|
||||
<div class="container py-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2 class="h4 mb-0">Edit Course: {{ course.name }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
<!-- Course Name -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="name" class="required-field">Course Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ course.name }}"
|
||||
placeholder="Enter course name"
|
||||
required />
|
||||
<div class="help-text">Course name must be unique</div>
|
||||
<div class="invalid-feedback">Please enter a course name</div>
|
||||
</div>
|
||||
<!-- Course Type -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="course_type" class="required-field">Course Type</label>
|
||||
<select class="form-control" id="course_type" name="course_type" required>
|
||||
<option value="">Select Course Type</option>
|
||||
<option value="semester"
|
||||
{% if course.course_type == "semester" %}selected{% endif %}>
|
||||
Semester-based
|
||||
</option>
|
||||
<option value="year" {% if course.course_type == "year" %}selected{% endif %}>Year-based</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">Please select a course type</div>
|
||||
</div>
|
||||
<!-- Duration -->
|
||||
<div class="form-group mb-4">
|
||||
<label for="duration" class="required-field">Duration</label>
|
||||
<input type="number"
|
||||
class="form-control"
|
||||
id="duration"
|
||||
name="duration"
|
||||
value="{{ course.duration }}"
|
||||
placeholder="Enter duration in months"
|
||||
min="1"
|
||||
required />
|
||||
<div class="help-text">Specify the duration in months</div>
|
||||
<div class="invalid-feedback">Please enter a valid duration (minimum 1 month)</div>
|
||||
</div>
|
||||
{% if messages %}
|
||||
<div class="mb-4">
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="{% url 'manage_course' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-times"></i> Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save"></i> Update Course
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Form validation
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false,
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,212 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class ="page-header">
|
||||
<h1 class="page-title">
|
||||
<i class="nav-icon fas fa-edit"></i>
|
||||
Edit Student
|
||||
</h1>
|
||||
<a href="{% url 'manage_student' %}" class="btn btn-primary">
|
||||
<i class="fas fa-list"></i> Back to Student
|
||||
</a>
|
||||
</div>
|
||||
<form method="POST" action="{% url 'edit_student' student.id %}">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label for="first_name">First Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
value="{{ student.first_name }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="middle_name">Middle Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="middle_name"
|
||||
name="middle_name"
|
||||
value="{{ student.middle_name }}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="last_name">Last Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="last_name"
|
||||
name="last_name"
|
||||
value="{{ student.last_name }}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="email">Email</label>
|
||||
<input type="email"
|
||||
class="form-control"
|
||||
id="email"
|
||||
name="email"
|
||||
value="{{ student.email }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="phone">Phone</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="phone"
|
||||
name="phone"
|
||||
value="{{ student.phone }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="dob">Date of Birth</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="dob"
|
||||
name="dob"
|
||||
value="{{ student.dob|date:'Y-m-d' }}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="gender">Gender</label>
|
||||
<select class="form-control" id="gender" name="gender" required>
|
||||
<option value="M" {% if student.gender == "M" %}selected{% endif %}>Male</option>
|
||||
<option value="F" {% if student.gender == "F" %}selected{% endif %}>Female</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="course">Course</label>
|
||||
<select class="form-control" id="course" name="course" required>
|
||||
<option value="">Select Course</option>
|
||||
{% for course in courses %}
|
||||
<option value="{{ course.id }}"
|
||||
{% if student.course.id == course.id %}selected{% endif %}>
|
||||
{{ course.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="academic_year">Academic Year</label>
|
||||
<select class="form-control" id="academic_year" name="academic_year" required>
|
||||
<option value="">Select Academic Year</option>
|
||||
{% for year in academic_years %}
|
||||
<option value="{{ year.id }}"
|
||||
{% if student.academic_year.id == year.id %}selected{% endif %}>
|
||||
{{ year.start_date }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="father_name">Father's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="father_name"
|
||||
name="father_name"
|
||||
value="{{ student.father_name }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="father_occupation">Father's Occupation</label>
|
||||
<select class="form-control"
|
||||
id="father_occupation"
|
||||
name="father_occupation"
|
||||
required>
|
||||
{% for key, value in occupation_choices %}
|
||||
<option value="{{ key }}"
|
||||
{% if student.father_occupation == key %}selected{% endif %}>{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="mother_name">Mother's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="mother_name"
|
||||
name="mother_name"
|
||||
value="{{ student.mother_name }}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="mother_occupation">Mother's Occupation</label>
|
||||
<select class="form-control"
|
||||
id="mother_occupation"
|
||||
name="mother_occupation"
|
||||
required>
|
||||
{% for key, value in occupation_choices %}
|
||||
<option value="{{ key }}"
|
||||
{% if student.mother_occupation == key %}selected{% endif %}>{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="guardian_name">Guardian's Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="guardian_name"
|
||||
name="guardian_name"
|
||||
value="{{ student.guardian_name }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="guardian_number">Guardian's Number</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="guardian_number"
|
||||
name="guardian_number"
|
||||
value="{{ student.guardian_number }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="relationship_with_student">Relationship with Student</label>
|
||||
<select class="form-control"
|
||||
id="relationship_with_student"
|
||||
name="relationship_with_student"
|
||||
required>
|
||||
{% for key, value in relationship_choices %}
|
||||
<option value="{{ key }}"
|
||||
{% if student.relationship_with_student == key %}selected{% endif %}>
|
||||
{{ value }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<label for="address">Address</label>
|
||||
<textarea class="form-control" id="address" name="address" rows="3" required>{{ student.address }}</textarea>
|
||||
</div>
|
||||
<div class="text-right mt-4">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
<a href="{% url 'manage_student' %}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,54 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}Edit Subject{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Edit Subject</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'manage_subject' %}" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left me-1"></i> Back to Subjects
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="needs-validation" novalidate>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,126 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2 class="mb-4">Edit Teacher</h2>
|
||||
<form method="POST" action="{% url 'edit_teacher' teacher.id %}">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label for="first_name">First Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
value="{{ teacher.first_name }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="middle_name">Middle Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="middle_name"
|
||||
name="middle_name"
|
||||
value="{{ teacher.middle_name }}">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="last_name">Last Name</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="last_name"
|
||||
name="last_name"
|
||||
value="{{ teacher.last_name }}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="email">Email</label>
|
||||
<input type="email"
|
||||
class="form-control"
|
||||
id="email"
|
||||
name="email"
|
||||
value="{{ teacher.email }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="phone">Phone</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="phone"
|
||||
name="phone"
|
||||
value="{{ teacher.phone }}"
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-4">
|
||||
<label for="dob">Date of Birth</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="dob"
|
||||
name="dob"
|
||||
value="{{ teacher.dob }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="gender">Gender</label>
|
||||
<select class="form-control" id="gender" name="gender" required>
|
||||
<option value="M" {% if teacher.gender == "M" %}selected{% endif %}>Male</option>
|
||||
<option value="F" {% if teacher.gender == "F" %}selected{% endif %}>Female</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="qualification">Qualification</label>
|
||||
<select class="form-control" id="qualification" name="qualification" required>
|
||||
{% for key, value in qualification_choices %}
|
||||
<option value="{{ key }}"
|
||||
{% if teacher.qualification == key %}selected{% endif %}>{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="specialization_on">Specialization</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="specialization_on"
|
||||
name="specialization_on"
|
||||
value="{{ teacher.specialization_on }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="marital_status">Marital Status</label>
|
||||
<select class="form-control"
|
||||
id="marital_status"
|
||||
name="marital_status"
|
||||
required>
|
||||
{% for key, value in marital_status_choices %}
|
||||
<option value="{{ key }}"
|
||||
{% if teacher.marital_status == key %}selected{% endif %}>{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
<label for="date_of_joining">Date of Joining</label>
|
||||
<input type="date"
|
||||
class="form-control"
|
||||
id="date_of_joining"
|
||||
name="date_of_joining"
|
||||
value="{{ teacher.date_of_joining }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="address">Address</label>
|
||||
<textarea class="form-control" id="address" name="address" rows="2" required>{{ teacher.address }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right mt-4">
|
||||
<button type="submit" class="btn btn-primary">Update Teacher</button>
|
||||
<a href="{% url 'manage_teacher' %}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,181 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-delete:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Academic Year Management</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="course-count me-3">Total Academic Years: {{ academic_years|length }}</span>
|
||||
<a href="{% url 'add_academicyear' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i>Add New Academic Year
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="academicyearSearch"
|
||||
placeholder="Search academic years..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if academic_years %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="40%">Start Date</th>
|
||||
<th width="30%">Created At</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for academic_year in academic_years %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ academic_year.start_date }}</td>
|
||||
<td>{{ academic_year.created_at }}</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_academicyear' academic_year.id %}"
|
||||
class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_academicyear' academic_year.id %}"
|
||||
class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-calendar-alt empty-state-icon"></i>
|
||||
<h3>No Academic Years Found</h3>
|
||||
<p class="text-muted">Start by adding your first academic year using the button above.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("academicyearSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const startDate = row.cells[1].textContent.toLowerCase();
|
||||
|
||||
if (startDate.includes(searchText)) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,194 +0,0 @@
|
||||
{% extends "admin/base_site.html" %} {% block page_title %}{{ title }}
|
||||
{%endblock %} {% load static %} {% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-delete:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.course-count {
|
||||
background-color: #e9ecef;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.875rem;
|
||||
color: #495057;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %} {% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Course Management</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span class="course-count me-3">
|
||||
Total Courses: {{ courses|length }}
|
||||
</span>
|
||||
<a href="{% url 'add_course' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i>Add New Course
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text" class="form-control" id="courseSearch" placeholder="Search courses..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if courses %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="30%">Course Name</th>
|
||||
<th width="20%">Course Type</th>
|
||||
<th width="25%">Duration</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for course in courses %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ course.name }}</td>
|
||||
<td>{{ course.get_course_type_display }}</td>
|
||||
<td>
|
||||
{{ course.duration }} {% if course.course_type == 'semester' %}
|
||||
Semesters {% else %} Years {% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_course' course.id %}" class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_course' course.id %}" class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-book empty-state-icon"></i>
|
||||
<h3>No Courses Found</h3>
|
||||
<p class="text-muted">
|
||||
Start by adding your first course using the button above.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("courseSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const courseName = row.cells[1].textContent.toLowerCase();
|
||||
const courseType = row.cells[2].textContent.toLowerCase();
|
||||
|
||||
if (
|
||||
courseName.includes(searchText) ||
|
||||
courseType.includes(searchText)
|
||||
) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %} {% endblock %}
|
||||
@@ -1,65 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="h3">Manage Students</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'add_student' %}" class="btn btn-primary">Add New Student</a>
|
||||
</div>
|
||||
</div>
|
||||
<form method="GET">
|
||||
<div class="row my-3">
|
||||
<div class="col-md-6">
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control"
|
||||
placeholder="Search students by name or email..."
|
||||
value="{{ search_query }}" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="submit" class="btn btn-secondary">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Full Name</th>
|
||||
<th>Course</th>
|
||||
<th>Academic Year</th>
|
||||
<th>Phone</th>
|
||||
<th>Email</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for student in students %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ student.first_name }}</td>
|
||||
<td>{{ student.course.name }}</td>
|
||||
<td>{{ student.academic_year.start_date|date:"Y" }}</td>
|
||||
<td>{{ student.phone }}</td>
|
||||
<td>{{ student.email }}</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_student' student.id %}"
|
||||
class="btn btn-sm btn-warning">Edit</a>
|
||||
<a href="{% url 'delete_student' student.id %}"
|
||||
class="btn btn-sm btn-danger">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="7" class="text-center">No students found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,190 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-edit {
|
||||
background-color: #ffc107;
|
||||
border-color: #ffc107;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-edit:hover {
|
||||
background-color: #e0a800;
|
||||
border-color: #d39e00;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-delete:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Manage Subjects</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{% url 'add_subject' %}" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i> Add New Subject
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="subjectSearch"
|
||||
placeholder="Search subjects..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if subjects %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">S.N</th>
|
||||
<th width="25%">Subject Name</th>
|
||||
<th width="20%">Course</th>
|
||||
<th width="20%">Duration</th>
|
||||
<th width="20%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for subject in subjects %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ subject.name }}</td>
|
||||
<td>{{ subject.course.name }}</td>
|
||||
<td>
|
||||
{{ subject.duration }}
|
||||
{% if subject.course.course_type == 'semester' %}
|
||||
Semesters
|
||||
{% else %}
|
||||
Years
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_subject' subject.id %}"
|
||||
class="btn btn-action btn-edit me-2">
|
||||
<i class="fas fa-edit me-1"></i>Edit
|
||||
</a>
|
||||
<a href="{% url 'delete_subject' subject.id %}"
|
||||
class="btn btn-action btn-delete">
|
||||
<i class="fas fa-trash-alt me-1"></i>Delete
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-book empty-state-icon"></i>
|
||||
<h3>No Subjects Found</h3>
|
||||
<p class="text-muted">Start by adding your first subject using the button above.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("subjectSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const subjectName = row.cells[1].textContent.toLowerCase();
|
||||
const courseName = row.cells[2].textContent.toLowerCase();
|
||||
|
||||
if (subjectName.includes(searchText) || courseName.includes(searchText)) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,43 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2 class="mb-4">Manage Teachers</h2>
|
||||
<a href="{% url 'add_teacher' %}" class="btn btn-primary mb-3">Add Teacher</a>
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Gender</th>
|
||||
<th>Qualification</th>
|
||||
<th>Marital Status</th>
|
||||
<th>Date of Joining</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for teacher in teachers %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ teacher.first_name }} {{ teacher.middle_name }} {{ teacher.last_name }}</td>
|
||||
<td>{{ teacher.email }}</td>
|
||||
<td>{{ teacher.phone }}</td>
|
||||
<td>{{ teacher.get_gender_display }}</td>
|
||||
<td>{{ teacher.get_qualification_display }}</td>
|
||||
<td>{{ teacher.get_marital_status_display }}</td>
|
||||
<td>{{ teacher.date_of_joining }}</td>
|
||||
<td>
|
||||
<a href="{% url 'edit_teacher' teacher.id %}"
|
||||
class="btn btn-sm btn-warning">Edit</a>
|
||||
<a href="{% url 'delete_teacher' teacher.id %}"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Are you sure you want to delete this teacher?');">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,144 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
{% load static %}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- general form elements -->
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Student Feedback</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Student Name</th>
|
||||
<th>Student Session</th>
|
||||
<th>Message</th>
|
||||
<th>Sended On</th>
|
||||
<th>Reply</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for feedback in feedbacks %}
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ feedback.student_id.first_name }}</td>
|
||||
<td>{{ feedback.student_id.academic_year.start_date }}</td>
|
||||
<td>{{ feedback.feedback }}</td>
|
||||
<td>{{ feedback.created_at }}</td>
|
||||
<td>
|
||||
{% if feedback.feedback_reply == "" %}
|
||||
<button class="btn btn-success reply_open_modal"
|
||||
data-toggle="modal"
|
||||
data-target="#replyModal">Reply</button>
|
||||
{% else %}
|
||||
{{ feedback.feedback_reply }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</section>
|
||||
{% comment %} Modal to Reply Feedback {% endcomment %}
|
||||
<!-- Modal -->
|
||||
<div class="modal fade"
|
||||
id="replyModal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Reply Feedback</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Reply to: <b><span id="reply_name"></span></b>
|
||||
</p>
|
||||
<input type="hidden" id="reply_id" name="reply_id" />
|
||||
<textarea class="form-control" rows="5" id="reply_message"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{% comment %} <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> {% endcomment %}
|
||||
<button type="button" class="btn btn-primary btn-block" id="reply_button">Reply</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% comment %} Custom JS to Identify the Reply and Post Reply {% endcomment %}
|
||||
{% block custom_js %}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".reply_open_modal").click(function(){
|
||||
// Getting Value from Table
|
||||
var id = $(this).parents("tr").children("td:eq(0)").text(); //Getting Selected Row ID (Frist Column)
|
||||
var name = $(this).parents("tr").children("td:eq(2)").text(); //Getting Selected Name (3rd Column)
|
||||
|
||||
// Adding the Value from Table to Modal form
|
||||
$("#reply_id").val(id);
|
||||
$("#reply_name").text(name);
|
||||
});
|
||||
|
||||
$(document).on("click", "#reply_button", function(){
|
||||
//Disabling the Button while data is being saved in Server
|
||||
$(this).attr("disabled", "disabled")
|
||||
$(this).text("Sending Reply...")
|
||||
|
||||
//console.log("SAVE")
|
||||
|
||||
|
||||
var id=$("#reply_id").val();
|
||||
var reply=$("#reply_message").val();
|
||||
//console.log(student_data);
|
||||
|
||||
// Saving Attendance Data into Database
|
||||
|
||||
$.ajax({
|
||||
url:'{% url 'student_feedback_message_reply' %}',
|
||||
type:'POST',
|
||||
data:{id:id, reply:reply},
|
||||
})
|
||||
|
||||
|
||||
.done(function(response){
|
||||
|
||||
if(response=="True")
|
||||
{
|
||||
alert("Reply Sent!")
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Failed to Send Reply!")
|
||||
}
|
||||
location.reload()
|
||||
|
||||
//console.log(response)
|
||||
})
|
||||
|
||||
.fail(function(){
|
||||
alert("Error in Sending Feedback Reply.")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
{% endblock custom_js %}
|
||||
@@ -1,188 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-approve {
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-approve:hover {
|
||||
background-color: #218838;
|
||||
border-color: #1e7e34;
|
||||
}
|
||||
|
||||
.btn-reject {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-reject:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Leave Applications</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="leaveSearch"
|
||||
placeholder="Search leave applications..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if leaves %}
|
||||
<div class="table-responsive table-bordered">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="1%">S.N</th>
|
||||
<th width="20%">Student Name</th>
|
||||
<th width="10%">Leave Date</th>
|
||||
<th width="25%">Leave Message</th>
|
||||
<th width="10%">Applied On</th>
|
||||
<th width="15%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for leave in leaves %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ leave.student_id.first_name }}</td>
|
||||
<td>{{ leave.leave_date }}</td>
|
||||
<td>{{ leave.leave_message }}</td>
|
||||
<td>{{ leave.created_at }}</td>
|
||||
<td>
|
||||
{% if leave.leave_status == 0 %}
|
||||
<a href="{% url 'student_leave_approve' leave_id=leave.id %}"
|
||||
class="btn btn-action btn-approve me-2">
|
||||
<i class="fas fa-check-circle me-1"></i>Approve
|
||||
</a>
|
||||
<a href="{% url 'student_leave_reject' leave_id=leave.id %}"
|
||||
class="btn btn-action btn-reject">
|
||||
<i class="fas fa-times-circle me-1"></i>Reject
|
||||
</a>
|
||||
{% elif leave.leave_status == 1 %}
|
||||
<button class="btn btn-action btn-approve" disabled>Approved</button>
|
||||
{% else %}
|
||||
<button class="btn btn-action btn-reject" disabled>Rejected</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-calendar-times empty-state-icon"></i>
|
||||
<h3>No Leave Applications Found</h3>
|
||||
<p class="text-muted">There are no leave applications to display at the moment.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document
|
||||
.getElementById("leaveSearch")
|
||||
.addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const studentName = row.cells[1].textContent.toLowerCase();
|
||||
const leaveMessage = row.cells[3].textContent.toLowerCase();
|
||||
|
||||
if (
|
||||
studentName.includes(searchText) ||
|
||||
leaveMessage.includes(searchText)
|
||||
) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,115 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- general form elements -->
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Staff Feedback</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<!-- form start -->
|
||||
<div class="table">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Staff Name</th>
|
||||
<th>Message</th>
|
||||
<th>Sended On</th>
|
||||
<th>Reply</th>
|
||||
</tr>
|
||||
{% for feedback in feedbacks %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ feedback.teacher_id.first_name }} {{ feedback.teacher_id.last_name }}</td>
|
||||
<td>{{ feedback.feedback }}</td>
|
||||
<td>{{ feedback.created_at }}</td>
|
||||
<td>
|
||||
{% if feedback.feedback_reply == "" %}
|
||||
<button class="btn btn-success reply_open_modal"
|
||||
data-toggle="modal"
|
||||
data-target="#reply_modal">Reply</button>
|
||||
{% else %}
|
||||
{{ feedback.feedback_reply }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="reply_modal" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Reply</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Reply To : <span id="reply_name"></span>
|
||||
</p>
|
||||
<input type="hidden" id="reply_id" name="reply_id">
|
||||
<textarea class="form-control" rows="5" id="reply_message"></textarea>
|
||||
<button id="reply_btn" class="btn btn-info btn-block">Reply</button>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
{% endblock %}
|
||||
{% block custom_js %}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".reply_open_modal").click(function(){
|
||||
var id=$(this).parents("tr").children("td:eq(0)").text();
|
||||
var name=$(this).parents("tr").children("td:eq(2)").text();
|
||||
$("#reply_id").val(id);
|
||||
$("#reply_name").text(name);
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click","#reply_btn",function(){
|
||||
|
||||
$(this).attr("disabled","disabled")
|
||||
$(this).text("Sending Reply...")
|
||||
|
||||
var id=$("#reply_id").val();
|
||||
var message=$("#reply_message").val()
|
||||
|
||||
$.ajax({
|
||||
url:'{% url 'teacher_feedback_replied' %}',
|
||||
type:'POST',
|
||||
data:{id:id,message:message},
|
||||
})
|
||||
.done(function(response){
|
||||
|
||||
if(response=="True"){
|
||||
alert("Reply Sent")
|
||||
}
|
||||
else{
|
||||
alert("Error in Sending Reply")
|
||||
}
|
||||
location.reload()
|
||||
})
|
||||
.fail(function(){
|
||||
alert("Error in Sending Reply")
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock custom_js %}
|
||||
@@ -1,186 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block page_title %}{{ title }}{% endblock %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
|
||||
rel="stylesheet" />
|
||||
<style>
|
||||
.page-header {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 2px solid #dee2e6;
|
||||
color: #495057;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
border-radius: 0.25rem;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-approve {
|
||||
background-color: #28a745;
|
||||
border-color: #28a745;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-approve:hover {
|
||||
background-color: #218838;
|
||||
border-color: #1e7e34;
|
||||
}
|
||||
|
||||
.btn-reject {
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-reject:hover {
|
||||
background-color: #c82333;
|
||||
border-color: #bd2130;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 3rem;
|
||||
color: #6c757d;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h1 class="h3 mb-0">Leave Applications</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- Search and Filter -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="search-box">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="leaveSearch"
|
||||
placeholder="Search leave applications..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if leaves %}
|
||||
<div class="table-responsive table-bordered">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="1%">S.N</th>
|
||||
<th width="20%">Teacher Name</th>
|
||||
<th width="10%">Leave Date</th>
|
||||
<th width="25%">Leave Message</th>
|
||||
<th width="10%">Applied On</th>
|
||||
<th width="15%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for leave in leaves %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ leave.teacher_id.first_name }}{{ leave.teacher_id.middle_name }} {{ leave.teacher_id.last_name }}</td>
|
||||
<td>{{ leave.leave_date }}</td>
|
||||
<td>{{ leave.leave_message }}</td>
|
||||
<td>{{ leave.created_at }}</td>
|
||||
<td>
|
||||
{% if leave.leave_status == 0 %}
|
||||
<a href="{% url 'teacher_leave_approve' leave_id=leave.id %}"
|
||||
class="btn btn-action btn-approve me-2">
|
||||
<i class="fas fa-check-circle me-1"></i>Approve
|
||||
</a>
|
||||
<a href="{% url 'teacher_leave_reject' leave_id=leave.id %}"
|
||||
class="btn btn-action btn-reject">
|
||||
<i class="fas fa-times-circle me-1"></i>Reject
|
||||
</a>
|
||||
{% elif leave.leave_status == 1 %}
|
||||
<button class="btn btn-action btn-approve" disabled>Approved</button>
|
||||
{% else %}
|
||||
<button class="btn btn-action btn-reject" disabled>Rejected</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<i class="fas fa-calendar-times empty-state-icon"></i>
|
||||
<h3>No Leave Applications Found</h3>
|
||||
<p class="text-muted">There are no leave applications to display at the moment.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block extrajs %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
document.getElementById("leaveSearch").addEventListener("keyup", function () {
|
||||
const searchText = this.value.toLowerCase();
|
||||
const tableRows = document.querySelectorAll("tbody tr");
|
||||
|
||||
tableRows.forEach((row) => {
|
||||
const teacherName = row.cells[1].textContent.toLowerCase();
|
||||
const leaveMessage = row.cells[3].textContent.toLowerCase();
|
||||
|
||||
if (
|
||||
teacherName.includes(searchText) ||
|
||||
leaveMessage.includes(searchText)
|
||||
) {
|
||||
row.style.display = "";
|
||||
} else {
|
||||
row.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,208 +0,0 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
{% load static %}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- general form elements -->
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">View Attendance</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
{% comment %} Display Messages {% endcomment %}
|
||||
{% if messages %}
|
||||
<div class="form-group">
|
||||
<div class="col-12">
|
||||
{% for message in messages %}
|
||||
{% if message.tags == "error" %}
|
||||
<div class="alert alert-danger alert-dismissible fade show"
|
||||
role="alert"
|
||||
style="margin-top: 10px">
|
||||
{{ message }}
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
{% elif message.tags == "success" %}
|
||||
<div class="alert alert-success alert-dismissible fade show"
|
||||
role="alert"
|
||||
style="margin-top: 10px">
|
||||
{{ message }}
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Subject</label>
|
||||
<select class="form-control" name="subject" id="subject">
|
||||
{% for subject in subjects %}<option value="{{ subject.id }}">{{ subject.name }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Academic Year</label>
|
||||
<select class="form-control" name="session_year_id" id="session_year_id">
|
||||
{% for academic_year in academic_years %}
|
||||
<option value="{{ academic_year.id }}">{{ academic_year.start_date }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="fetch_attendance">Fetch Attendance Date</button>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="form-group" id="attendance_block" style="display:none;">
|
||||
<label>Attendance Date</label>
|
||||
<select class="form-control" name="attendance_date" id="attendance_date"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="alert alert-danger" id="error_attendance" style="display:none"></div>
|
||||
<div class="alert alert-success"
|
||||
id="success_attendance"
|
||||
style="display:none"></div>
|
||||
</div>
|
||||
<div class="card-footer" id="fetch_student_block" style="display:none;">
|
||||
<button type="button" class="btn btn-primary" id="fetch_student">Fetch Student Data</button>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
{% comment %} <div class="card-footer">
|
||||
<button type="button" class="btn btn-primary" id="save_student">Save Data</button>
|
||||
</div> {% endcomment %}
|
||||
</div>
|
||||
{% comment %} Displaying Students Here {% endcomment %}
|
||||
<div class="card-footer" id="student_data"></div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block custom_js %}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
//Fetching Attendance Date
|
||||
|
||||
$("#fetch_attendance").click(function(){
|
||||
var subject = $("#subject").val()
|
||||
var academic_year_id = $("#academic_year_id").val()
|
||||
//console.log(subject)
|
||||
//console.log(session_year_id)
|
||||
|
||||
$.ajax({
|
||||
url:'{% url 'get_attendance_dates' %}',
|
||||
type:'POST',
|
||||
data:{subject:subject, academic_year_id:academic_year_id},
|
||||
})
|
||||
|
||||
|
||||
.done(function(response){
|
||||
var json_data = JSON.parse(response);
|
||||
if(json_data.length>0)
|
||||
{
|
||||
var html_data = "";
|
||||
for (key in json_data)
|
||||
{
|
||||
html_data+="<option value='"+ json_data[key]["id"] +"'>"+ json_data[key]["attendance_date"] +"</option>"
|
||||
}
|
||||
$("#error_attendance").html("");
|
||||
$("#error_attendance").hide();
|
||||
$("#attendance_block").show();
|
||||
$("#fetch_student_block").show();
|
||||
$("#attendance_date").html(html_data);
|
||||
//console.log(response)
|
||||
//alert("Something")
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#error_attendance").html("No Attendance Data Found.");
|
||||
$("#error_attendance").show();
|
||||
$("#attendance_block").hide();
|
||||
$("#fetch_student_block").hide();
|
||||
$("#attendance_date")="" //Empty the Date Dropdown also
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
.fail(function(){
|
||||
alert("Error in getting Attendance Dates.")
|
||||
$("#error_attendance").html("");
|
||||
$("#fetch_student_block").hide();
|
||||
$("#attendance_block").hide();
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
// Now Working on Fetch Student after attendance date selected
|
||||
$("#fetch_student").click(function(){
|
||||
|
||||
// Displaying Students Based on Staff, Course and Session Enrolled
|
||||
|
||||
//var subject=$("#subject").val()
|
||||
//var session_year=$("#session_year").val()
|
||||
var attendance_date=$("#attendance_date").val()
|
||||
|
||||
$.ajax({
|
||||
url:'{% url 'admin_get_attendance_student' %}',
|
||||
type:'POST',
|
||||
data:{attendance_date:attendance_date},
|
||||
})
|
||||
|
||||
|
||||
.done(function(response){
|
||||
var json_data=JSON.parse(response);
|
||||
//console.log(json_data)
|
||||
//Displaying Attendance Date Input and Students Attendance
|
||||
var div_data="<div class='form-group'><label>Student Attendance: </label></div>"
|
||||
div_data+="<div class='form-group'><div class='row'>"
|
||||
|
||||
for(key in json_data)
|
||||
{
|
||||
div_data+="<div class='col-lg-3'><div class='form-check'>";
|
||||
|
||||
div_data+="<label class='form-check-label'>"+ json_data[key]['name']+" </label> ";
|
||||
|
||||
// Displaying Present and Absent
|
||||
|
||||
if(json_data[key]['status'])
|
||||
{
|
||||
div_data+="<b>[ Present ]</b>";
|
||||
}
|
||||
else
|
||||
{
|
||||
div_data+="<b>[ Absent ]</b>";
|
||||
}
|
||||
//Displaying Present and Absent Ends Here
|
||||
|
||||
|
||||
div_data+="</div></div> ";
|
||||
}
|
||||
div_data+="</div></div>";
|
||||
|
||||
$("#student_data").html(div_data);
|
||||
|
||||
})
|
||||
.fail(function(){
|
||||
alert("Error in Fetching Students.")
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
{% endblock custom_js %}
|
||||
@@ -1,83 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<h2 class="col-12">Dashboard</h2>
|
||||
<p class="col-12">Welcome</p>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<div class="row g-4 col-12">
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Course</h5>
|
||||
<p class="fs-2">DCOM</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Current Semester</h5>
|
||||
<p class="fs-2">5</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Total Subject</h5>
|
||||
<p class="fs-2">12</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Subject Attendance Bar Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="attendanceBarChart"></canvas>
|
||||
</div>
|
||||
<!-- Subject Results Bar Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="resultBarChart"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
// Bar Chart for Subject Attendance
|
||||
const attendanceCtx = document.getElementById("attendanceBarChart").getContext("2d");
|
||||
new Chart(attendanceCtx, {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: ["Math", "Science", "English", "History", "Geography"], // Example subject names
|
||||
datasets: [
|
||||
{
|
||||
label: "Attendance Percentage",
|
||||
data: [90, 80, 85, 75, 95], // Example attendance percentages for each subject
|
||||
backgroundColor: ["#FF6384", "#36A2EB", "#FFCE56", "#4CAF50", "#FF8C00"],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
max: 100, // Percentage scale
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Bar Chart for Subject Results (Example)
|
||||
const resultCtx = document.getElementById("resultBarChart").getContext("2d");
|
||||
new Chart(resultCtx, {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: ["Math", "Science", "English", "History", "Geography"], // Example subject names
|
||||
datasets: [
|
||||
{
|
||||
label: "Results (Percentage)",
|
||||
data: [88, 75, 80, 70, 92], // Example result percentages for each subject
|
||||
backgroundColor: ["#FF5733", "#33FF57", "#3357FF", "#FF5733", "#FF8C00"],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
max: 100, // Percentage scale
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,83 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<h2 class="col-12">Dashboard</h2>
|
||||
<p class="col-12">Welcome</p>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<div class="row g-4 col-12">
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Course</h5>
|
||||
<p class="fs-2">DCOM</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Current Semester</h5>
|
||||
<p class="fs-2">5</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Total Subject</h5>
|
||||
<p class="fs-2">12</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Subject Attendance Bar Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="attendanceBarChart"></canvas>
|
||||
</div>
|
||||
<!-- Subject Results Bar Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="resultBarChart"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
// Bar Chart for Subject Attendance
|
||||
const attendanceCtx = document.getElementById("attendanceBarChart").getContext("2d");
|
||||
new Chart(attendanceCtx, {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: ["Math", "Science", "English", "History", "Geography"], // Example subject names
|
||||
datasets: [
|
||||
{
|
||||
label: "Attendance Percentage",
|
||||
data: [90, 80, 85, 75, 95], // Example attendance percentages for each subject
|
||||
backgroundColor: ["#FF6384", "#36A2EB", "#FFCE56", "#4CAF50", "#FF8C00"],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
max: 100, // Percentage scale
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Bar Chart for Subject Results (Example)
|
||||
const resultCtx = document.getElementById("resultBarChart").getContext("2d");
|
||||
new Chart(resultCtx, {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: ["Math", "Science", "English", "History", "Geography"], // Example subject names
|
||||
datasets: [
|
||||
{
|
||||
label: "Results (Percentage)",
|
||||
data: [88, 75, 80, 70, 92], // Example result percentages for each subject
|
||||
backgroundColor: ["#FF5733", "#33FF57", "#3357FF", "#FF5733", "#FF8C00"],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
max: 100, // Percentage scale
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user