update
This commit is contained in:
1 parent
c738c1746a
commit
0504b881fb
30 files changed
+1297
-123
No files matched your search
@@ -0,0 +1,152 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<h2 class="col-12">{{ title }}</h2>
|
||||
<p class="col-12">Welcome</p>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<!--cards-->
|
||||
<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>Total Students</h5>
|
||||
<p class="fs-2">{{ total_student }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Total Staff</h5>
|
||||
<p class="fs-2">{{ total_staff }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Total Teacher</h5>
|
||||
<p class="fs-2">{{ total_teacher }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<div class="card text-center p-3">
|
||||
<h5>Total Course</h5>
|
||||
<p class="fs-2">{{ total_course }}</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">{{ total_subjects }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-12">
|
||||
<div class="col-12 col-md-6 col-lg-6">
|
||||
<table class="text-center table table-bordered">
|
||||
<thead class="table-dark">
|
||||
<th>S.N</th>
|
||||
<th>Name</th>
|
||||
<th>Course</th>
|
||||
<th>Academic Year</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<td>1</td>
|
||||
<td>hello</td>
|
||||
<td>DCOM</td>
|
||||
<td>2023</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-6">
|
||||
<table class="text-center table table-bordered">
|
||||
<thead class="table-dark">
|
||||
<th>S.N</th>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>Phone No</th>
|
||||
<th>Gmail</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>hello</td>
|
||||
<td>kohalpur</td>
|
||||
<td>9801230123</td>
|
||||
<td>example@example.com</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Pie Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="pieChart"></canvas>
|
||||
</div>
|
||||
<!-- Bar Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="barChart"></canvas>
|
||||
</div>
|
||||
<!-- Line Chart -->
|
||||
<div class="row col-12 col-lg-6 chart-container">
|
||||
<canvas id="lineChart"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
// Pie Chart
|
||||
const pieCtx = document.getElementById("pieChart").getContext("2d");
|
||||
new Chart(pieCtx, {
|
||||
type: "pie",
|
||||
data: {
|
||||
labels: ["Category A", "Category B", "Category C"],
|
||||
datasets: [
|
||||
{
|
||||
data: [30, 50, 20],
|
||||
backgroundColor: ["#FF6384", "#36A2EB", "#FFCE56"],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// Bar Chart
|
||||
const barCtx = document.getElementById("barChart").getContext("2d");
|
||||
new Chart(barCtx, {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: ["Category A", "Category B", "Category C"],
|
||||
datasets: [
|
||||
{
|
||||
label: "Values",
|
||||
data: [30, 50, 20],
|
||||
backgroundColor: ["#FF6384", "#36A2EB", "#FFCE56"],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Line Chart
|
||||
const lineCtx = document.getElementById("lineChart").getContext("2d");
|
||||
new Chart(lineCtx, {
|
||||
type: "line",
|
||||
data: {
|
||||
labels: ["January", "February", "March", "April"],
|
||||
datasets: [
|
||||
{
|
||||
label: "Values",
|
||||
data: [10, 30, 20, 40],
|
||||
borderColor: "#36A2EB",
|
||||
fill: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,144 @@
|
||||
{% extends 'admin/base_site.html' %}
|
||||
{% block content %}
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #000;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header h1,
|
||||
.header h2,
|
||||
.header p {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.header img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.details {
|
||||
margin-top: 20px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.details span {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.remarks {
|
||||
margin-top: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.btn-print {
|
||||
display: block;
|
||||
width: 100px;
|
||||
margin: 20px auto;
|
||||
padding: 10px;
|
||||
background-color: #4CAF50;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.btn-print {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>SHREE SECONDARY SCHOOL</h1>
|
||||
<p>Kohalpur-5, Banke</p>
|
||||
<p>Estd. 281 BS</p>
|
||||
<h2>GRADE - SHEET</h2>
|
||||
</div>
|
||||
<div class="details">
|
||||
<p>
|
||||
The grade(s) secured by: <span>{{ marksheet.student.first_name }} {{ marksheet.student.first_name }}</span>
|
||||
</p>
|
||||
<p>
|
||||
Date of Birth: <span>
|
||||
{{ marksheet.student.date_of_birth }}
|
||||
<p>
|
||||
In the Examination, {{ marksheet.student.course.name }} of {{ marksheet.student.academic_year }} are given below:
|
||||
</p>
|
||||
</div>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N.</th>
|
||||
<th>Subject</th>
|
||||
<th>Theory</th>
|
||||
<th>Practical</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for subject in marksheet.subject_marks.all %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ subject.subject.name }}</td>
|
||||
<td>{{ subject.obtained_theory_marks }}</td>
|
||||
<td>{{ subject.obtained_practical_marks }}</td>
|
||||
<td>{{ subject.total_marks }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td colspan="4" style="font-weight: bold; text-align: center;">Grand Total</td>
|
||||
<td>{{ marksheet.obtained_marks }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="remarks">
|
||||
<p>
|
||||
Total Grade Point Average (Grade): <span>{{ marksheet.grade }}</span>
|
||||
</p>
|
||||
<p class="text-sm text-gray-600">
|
||||
Percentage:
|
||||
{{ marksheet.obtained_marks|div:marksheet.total_marks|mul:100|floatformat:2 }}%
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class="btn-print" onclick="window.print();">Print PDF</a>
|
||||
</div>
|
||||
</body>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,77 @@
|
||||
<!-- templates/marksheet/marksheet_detail.html -->
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<div class="container mx-auto p-4">
|
||||
<div class="bg-white shadow-lg rounded-lg p-6">
|
||||
<!-- Student & Course Info -->
|
||||
<div class="mb-6 border-b pb-4">
|
||||
<h1 class="text-2xl font-bold mb-2">Student Marksheet</h1>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<p class="font-semibold">Student Name:</p>
|
||||
<p>{{ marksheet.student.first_name }} {{ marksheet.student.last_name }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="font-semibold">Course:</p>
|
||||
<p>{{ marksheet.course.name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Marks Table -->
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-100">
|
||||
<th class="px-4 py-2 text-left">Subject</th>
|
||||
<th class="px-4 py-2 text-center">Theory Marks</th>
|
||||
<th class="px-4 py-2 text-center">Practical Marks</th>
|
||||
<th class="px-4 py-2 text-center">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for subject_mark in marksheet.subject_marks.all %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ subject_mark.subject.name }}</td>
|
||||
<td class="px-4 py-2 text-center">
|
||||
{{ subject_mark.obtained_theory_marks }}/{{
|
||||
subject_mark.total_theory_marks }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-center">
|
||||
{{ subject_mark.obtained_practical_marks }}/{{
|
||||
subject_mark.total_practical_marks }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-center">
|
||||
{{ subject_mark.total_marks }}/{{
|
||||
subject_mark.total_practical_marks|add:subject_mark.total_theory_marks
|
||||
}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="bg-gray-50 font-bold">
|
||||
<td class="px-4 py-2">Total</td>
|
||||
<td class="px-4 py-2 text-center" colspan="2"></td>
|
||||
<td class="px-4 py-2 text-center">{{ marksheet.obtained_marks }}/{{ marksheet.total_marks }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<!-- Final Grade -->
|
||||
<div class="mt-6 text-center">
|
||||
<div class="inline-block bg-blue-100 rounded-lg px-6 py-3">
|
||||
<p class="text-lg font-semibold">
|
||||
Final Grade:
|
||||
<span class="text-2xl ml-2 {% if marksheet.grade == 'F' %}text-red-600{% else %}text-green-600{% endif %}">
|
||||
{{ marksheet.grade }}
|
||||
</span>
|
||||
</p>
|
||||
<!--<p class="text-sm text-gray-600">-->
|
||||
<!-- Percentage:-->
|
||||
<!--</p>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="btn-print" onclick="window.print();">Print PDF</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<div class="container mx-auto p-4">
|
||||
<h1 class="text-2xl font-bold mb-6">Student Marksheets</h1>
|
||||
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{% for marksheet in marksheets %}
|
||||
<div class="bg-white rounded-lg shadow-lg p-4">
|
||||
<h2 class="text-xl font-semibold mb-2">{{ marksheet.student.first_name }} {{ marksheet.student.last_name }}</h2>
|
||||
<p class="text-gray-600 mb-2">Course: {{ marksheet.course.name }}</p>
|
||||
<div class="flex justify-between items-center mt-4">
|
||||
<span class="text-sm">
|
||||
Grade:
|
||||
<span class="font-bold {% if marksheet.grade == 'F' %}text-red-600{% else %}text-green-600{% endif %}">
|
||||
{{ marksheet.grade }}
|
||||
</span>
|
||||
</span>
|
||||
<a href="{% url 'marksheetdetails' %}"
|
||||
class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">View Details</a>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-span-full text-center py-8 text-gray-500">No marksheets available.</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Whitespace-only changes.
@@ -0,0 +1,83 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<h2 class="col-12">{{ title }}</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">{{ course_name }}</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">{{ total_subjects }}</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 %}
|
||||
Whitespace-only changes.
Reference in new issue
Block a user