now to pricing

This commit is contained in:
Flatlogic Bot 2025-12-06 21:49:52 +00:00
parent 56e210d2e4
commit 6087fe4bc6
3 changed files with 89 additions and 33 deletions

79
assets/css/print.css Normal file
View File

@ -0,0 +1,79 @@
@page {
size: landscape;
margin: 0.5cm; /* Reduce page margins */
}
/*
Simple, direct print styles for timetables, with AGGRESSIVE compression and landscape mode.
*/
/* 1. By default, hide everything when printing. */
@media print {
body * {
visibility: hidden;
}
/* 2. Make ONLY the timetable containers and their contents visible. */
#timetables-container, #timetables-container *,
#timetable-container, #timetable-container * {
visibility: visible;
}
/* 3. Position the container to take up the whole page and scale it down SIGNIFICANTLY. */
#timetables-container,
#timetable-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
transform: scale(0.8); /* Aggressively scale down the entire container */
transform-origin: top left;
}
/* 4. Force each timetable to start on a new page. */
.timetable-wrapper {
page-break-after: always;
margin-top: 1rem;
}
/* 5. Don't add a page break after the very last one. */
.timetable-wrapper:last-child {
page-break-after: avoid;
}
/* 6. Ensure table fits the page and has basic styling. */
table {
width: 100%;
border-collapse: collapse;
font-size: 7pt; /* EXTREMELY reduced font size */
}
th, td {
border: 1px solid #666;
padding: 1px; /* MINIMAL padding */
text-align: center;
overflow-wrap: break-word; /* Break long words */
}
th {
background-color: #f0f0f0;
}
h3 {
text-align: center;
font-size: 10pt; /* Reduced header font size */
font-weight: bold;
}
/* 7. Explicitly hide any elements that should never be printed. */
.no-print, .navbar, #print-btn, form {
display: none !important;
}
/* Remove bootstrap card styling */
.card, .card-body {
border: none !important;
box-shadow: none !important;
padding: 0 !important;
}
}

View File

@ -140,34 +140,15 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
<title>Teacher Timetable - Haki Schedule</title> <title>Teacher Timetable - Haki Schedule</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>"> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="assets/css/print.css?v=<?php echo time(); ?>" media="print">
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<style>
@media print {
body * {
visibility: hidden;
}
#timetable-container, #timetable-container * {
visibility: visible;
}
#timetable-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.card {
border: 1px solid #dee2e6 !important;
box-shadow: none !important;
}
}
</style>
</head> </head>
<body> <body>
<?php require_once 'includes/navbar.php'; ?> <?php require_once 'includes/navbar.php'; ?>
<div class="container mt-4"> <div class="container mt-4">
<div class="d-flex justify-content-between align-items-center mb-4"> <div class="d-flex justify-content-between align-items-center mb-4 no-print">
<h1>Teacher Timetable</h1> <h1>Teacher Timetable</h1>
<?php if ($selected_teacher_id): ?> <?php if ($selected_teacher_id): ?>
<div class="d-flex gap-2"> <div class="d-flex gap-2">
@ -178,7 +159,7 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
</div> </div>
<?php if ($role === 'admin'): ?> <?php if ($role === 'admin'): ?>
<form method="GET" action="" class="mb-4"> <form method="GET" action="" class="mb-4 no-print">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label for="teacher_id" class="form-label">Select Teacher</label> <label for="teacher_id" class="form-label">Select Teacher</label>
@ -195,8 +176,9 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
</form> </form>
<?php endif; ?> <?php endif; ?>
<div id="timetable-container"> <div id="timetable-container" class="timetable-container">
<?php if ($selected_teacher_id && !empty($teacher_schedule_raw)): ?> <?php if ($selected_teacher_id && !empty($teacher_schedule_raw)): ?>
<div class="timetable-wrapper">
<h3 class="mt-4">Timetable for <?php echo htmlspecialchars($selected_teacher_name); ?></h3> <h3 class="mt-4">Timetable for <?php echo htmlspecialchars($selected_teacher_name); ?></h3>
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -295,6 +277,7 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
</table> </table>
</div> </div>
</div> </div>
</div>
<?php elseif ($selected_teacher_id): ?> <?php elseif ($selected_teacher_id): ?>
<div class="alert alert-info">No lessons scheduled for this teacher.</div> <div class="alert alert-info">No lessons scheduled for this teacher.</div>
<?php endif; ?> <?php endif; ?>

View File

@ -74,7 +74,7 @@ function generate_timetable($data, $days_of_week) {
if (!isset($electives_by_group_grade[$key])) { if (!isset($electives_by_group_grade[$key])) {
$electives_by_group_grade[$key] = [ $electives_by_group_grade[$key] = [
'type' => 'elective_group', 'type' => 'elective_group',
'display_name' => $workload['elective_group_name'] . " (Form " . $grade . ")", 'display_name' => $workload['elective_group_name'],
'lessons_per_week' => $workload['lessons_per_week'], 'lessons_per_week' => $workload['lessons_per_week'],
'has_double_lesson' => $workload['has_double_lesson'], 'has_double_lesson' => $workload['has_double_lesson'],
'is_elective' => true, 'is_elective' => true,
@ -526,25 +526,19 @@ $class_timetables = get_timetable_from_db($pdoconn, $classes, $timeslots, $days_
<title>Timetable - Haki Schedule</title> <title>Timetable - Haki Schedule</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>"> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="assets/css/print.css?v=<?php echo time(); ?>" media="print">
<style> <style>
.lesson { min-height: 60px; } .lesson { min-height: 60px; }
.lesson.is-elective { background-color: #e0f7fa; border-left: 3px solid #00bcd4; } .lesson.is-elective { background-color: #e0f7fa; border-left: 3px solid #00bcd4; }
.lesson.is-double { background-color: #fce4ec; } .lesson.is-double { background-color: #fce4ec; }
.table-bordered th, .table-bordered td { vertical-align: middle; } .table-bordered th, .table-bordered td { vertical-align: middle; }
@media print {
body * { visibility: hidden; }
#timetables-container, #timetables-container * { visibility: visible; }
#timetables-container { position: absolute; left: 0; top: 0; width: 100%; }
.card { border: 1px solid #dee2e6 !important; box-shadow: none !important; }
.d-flex.gap-2 { display: none !important; }
}
</style> </style>
</head> </head>
<body> <body>
<?php include 'includes/navbar.php'; ?> <?php include 'includes/navbar.php'; ?>
<div class="container-fluid mt-4"> <div class="container-fluid mt-4">
<div class="d-flex justify-content-between align-items-center mb-4 px-3"> <div class="d-flex justify-content-between align-items-center mb-4 px-3 no-print">
<h1>Class Timetable</h1> <h1>Class Timetable</h1>
<div class="d-flex gap-2"> <div class="d-flex gap-2">
<?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin') : ?> <?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin') : ?>
@ -556,7 +550,7 @@ $class_timetables = get_timetable_from_db($pdoconn, $classes, $timeslots, $days_
</div> </div>
</div> </div>
<div id="timetables-container"> <div id="timetables-container" class="timetable-container">
<?php if (empty($class_timetables)) : ?> <?php if (empty($class_timetables)) : ?>
<div class="alert alert-info mx-3"> <div class="alert alert-info mx-3">
<?php if (empty($workloads)) : ?> <?php if (empty($workloads)) : ?>