From 6087fe4bc63b8c6fabc7d46ea799bbaf2cb6df41 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 6 Dec 2025 21:49:52 +0000 Subject: [PATCH] now to pricing --- assets/css/print.css | 79 +++++++++++++++++++++++++++++++++++++++++++ teacher_timetable.php | 29 ++++------------ timetable.php | 14 +++----- 3 files changed, 89 insertions(+), 33 deletions(-) create mode 100644 assets/css/print.css diff --git a/assets/css/print.css b/assets/css/print.css new file mode 100644 index 0000000..389c526 --- /dev/null +++ b/assets/css/print.css @@ -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; + } +} \ No newline at end of file diff --git a/teacher_timetable.php b/teacher_timetable.php index 28a62c2..d86497a 100644 --- a/teacher_timetable.php +++ b/teacher_timetable.php @@ -140,34 +140,15 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim Teacher Timetable - Haki Schedule + -
-
+

Teacher Timetable

@@ -178,7 +159,7 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
-
+
@@ -195,8 +176,9 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim -
+
+

Timetable for

@@ -295,6 +277,7 @@ error_log("Final teacher_timetable_by_period structure: " . print_r($teacher_tim
+
No lessons scheduled for this teacher.
diff --git a/timetable.php b/timetable.php index 27ac4af..6b1a5d6 100644 --- a/timetable.php +++ b/timetable.php @@ -74,7 +74,7 @@ function generate_timetable($data, $days_of_week) { if (!isset($electives_by_group_grade[$key])) { $electives_by_group_grade[$key] = [ 'type' => 'elective_group', - 'display_name' => $workload['elective_group_name'] . " (Form " . $grade . ")", + 'display_name' => $workload['elective_group_name'], 'lessons_per_week' => $workload['lessons_per_week'], 'has_double_lesson' => $workload['has_double_lesson'], 'is_elective' => true, @@ -526,25 +526,19 @@ $class_timetables = get_timetable_from_db($pdoconn, $classes, $timeslots, $days_ Timetable - Haki Schedule +
-
+

Class Timetable

@@ -556,7 +550,7 @@ $class_timetables = get_timetable_from_db($pdoconn, $classes, $timeslots, $days_
-
+