Skip to content

Commit 6f9850c

Browse files
updated
updated the bus panel problem where the request is not properly sending to the admin.
1 parent 0a6d559 commit 6f9850c

25 files changed

+76
-79
lines changed

admin_panel/buses.php

+10-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
<li><a href="#">
1919
</a></li>
2020
</ul>
21-
<!-- Button trigger modal -->
22-
<!-- Button trigger modal -->
23-
<button type="button" class="btn btn-primary" id="bus-request" data-bs-toggle="modal" data-bs-target="#exampleModal" style="margin-left: 6%; margin-bottom: 7%;">
24-
<i class="fas fa-bus"></i> Bus Requests
25-
</button>
26-
27-
<button type="button" class="btn btn-primary" id="bus-request" data-bs-toggle="modal" data-bs-target="#exampleModal2" style="margin-left: 6%; margin-bottom: 7%; background-color: green; border: none; font-size: 12px; padding-top: 10px; padding-bottom: 10px;">
28-
<i class="fas fa-bus"></i> Accepted Requests
29-
</button>
21+
22+
<div class="d-flex mx-3 mb-3" style="grid-gap: 10px; flex-wrap: wrap;">
23+
<button type="button" class="btn btn-primary" id="bus-request" data-bs-toggle="modal" data-bs-target="#exampleModal">
24+
<i class="fas fa-bus"></i> Bus Requests
25+
</button>
26+
27+
<button type="button" class="btn btn-success" id="bus-request" data-bs-toggle="modal" data-bs-target="#exampleModal2">
28+
<i class="fas fa-bus"></i> Accepted Requests
29+
</button>
30+
</div>
3031

3132

3233
<!-- Modal -->

admin_panel/partials/student-shared/feedback-tab.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
<div class="col-auto">
1919
<select class="form-select" aria-label="Default select example" id="feedback-search-class">
2020
<option value="12c">12 (Commerce)</option>
21-
<option value="11c">11 (Commerce)</option>
22-
<option value="12s">12 (Science)</option>
23-
<option value="11s">11 (Science)</option>
24-
<option value="10">10</option>
25-
<option value="9">9</option>
26-
<option value="8">8</option>
27-
<option value="7">7</option>
28-
<option value="6">6</option>
29-
<option value="5">5</option>
30-
<option value="4">4</option>
31-
<option value="3">3</option>
32-
<option value="2">2</option>
33-
<option value="1">1</option>
34-
<option value="pg">Nursery</option>
35-
<option value="lkg">lkg</option>
36-
<option value="ukg">ukg</option>
21+
<option value="11c">11 (Commerce)</option>
22+
<option value="12s">12 (Science)</option>
23+
<option value="11s">11 (Science)</option>
24+
<option value="10">10</option>
25+
<option value="9">9</option>
26+
<option value="8">8</option>
27+
<option value="7">7</option>
28+
<option value="6">6</option>
29+
<option value="5">5</option>
30+
<option value="4">4</option>
31+
<option value="3">3</option>
32+
<option value="2">2</option>
33+
<option value="1">1</option>
34+
<option value="pg">Nursery</option>
35+
<option value="lkg">lkg</option>
36+
<option value="ukg">ukg</option>
3737
</select>
3838
</div>
3939
</div>
@@ -120,9 +120,9 @@
120120
</div>
121121
122122
</div>
123-
<div class="col-12 col-md-8 d-flex mt-3 justify-content-center">
123+
<div class="col-12 col-md-8 d-flex p-0 mt-3 justify-content-center">
124124
125-
<div class="row" style="max-width: 523px;">
125+
<div class="row w-100" >
126126
127127
<div class="container">
128128

admin_panel/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ td.tableData {
22812281
.feedback .card-messages .messages-box {
22822282
height: 480px;
22832283
width: 100%;
2284-
overflow-y: scroll;
2284+
overflow-y: auto;
22852285
scroll-behavior: smooth;
22862286
}
22872287

assets/getStudentDetailsAndFeedback.php

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
while ($row = mysqli_fetch_assoc($result)) {
2222
$data['status'] = "success";
2323
$data["name"] = ucfirst(strtolower($row["fname"])) . " " . strtolower($row['lname']);
24+
$row['image'] = "../studentUploads/".$row['image'];
2425
$data["image"] = file_exists($row['image']) ? $row['image'] : "../images/user.png";
2526

2627
$dobString = $row["dob"];

owner_panel/fetch-data/fetch-attendence.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33
session_start();
44
$response = array();
55

owner_panel/fetch-data/fetch-student.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33
$sql="select * from students";
44
$result=mysqli_query($conn,$sql);
55
if(mysqli_num_rows($result)>0){

owner_panel/fetch-data/fetch-teachers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33
$sql="select * from teachers";
44
$result=mysqli_query($conn,$sql);
55
if(mysqli_num_rows($result)>0){

owner_panel/fetch-data/notice-delete.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33

44
// Assuming noticeId is sent via POST method
55
$id = $_POST['noticeId'];

owner_panel/fetch-data/search-student.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33

44
// Assuming you've already sanitized the search term
55
$search = $_POST['search'];

owner_panel/fetch-data/search-teacher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33

44
// Assuming you've already sanitized the search term
55
$search = $_POST['search'];

owner_panel/fetch-data/select-students.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33
$class = $_POST['select'];
44
if($class!=""){
55
$sql = "SELECT * FROM students WHERE class='" . $class . "'";

owner_panel/fetch-data/send-notice.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
2-
include('config.php');
2+
include("../../assets/config.php");
33

44
// Assuming form is submitted via POST method
55
if ($_SERVER["REQUEST_METHOD"] == "POST") {
6-
// Retrieve form data
6+
// Retrieve form data
77
$panel = mysqli_real_escape_string($conn, $_POST['panel']);
88
$class = mysqli_real_escape_string($conn, $_POST['cla']);
99
$title = mysqli_real_escape_string($conn, $_POST['title']);
@@ -23,4 +23,3 @@
2323
// Handle case where form is not submitted via POST
2424
echo "Form submission method not recognized.";
2525
}
26-
?>

owner_panel/make-payment.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
error_reporting(0);
77
?>
88
<?php
9-
include('config.php');
9+
include("../assets/config.php");
1010
?>
1111
<!DOCTYPE html>
1212
<html>

owner_panel/qr.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
error_reporting(0);
77
?>
88
<?php
9-
include('config.php');
9+
include("../assets/config.php");
1010
?>
1111
<!DOCTYPE html>
1212
<html>
747 KB
Loading

student_panel/buslocation.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('database.php');
2+
include('../assets/config.php');
33
?>
44
<!DOCTYPE html>
55
<html>
@@ -56,7 +56,13 @@
5656
echo "<div class='position border-0 pb-5 shadow'><h3>Bus Stops</h3>";
5757

5858
while($row = mysqli_fetch_assoc($result)) {
59-
echo "<div class='l1'><h6 style='font-size: 15px; font-family: Arial, Helvetica, sans-serif;'>{$row['location']}</h6> <h7 style='font-size: 15px; font-family: Arial, Helvetica, sans-serif; margin-bottom: 40px; margin-left: -90px'> {$row['arrival_time']}</h7></div>";
59+
60+
echo "<div class='d-flex mt-5 mb-1 align-items-center justify-content-center'>
61+
<h6 style='width: 150px; text-align: right;'>{$row['arrival_time']}</h6>
62+
<img class='mx-3' src='images/bus.png' alt='Bus icon' width='60px'>
63+
<h6 style='width: 150px; text-align: left;'>{$row['location']}</h6>
64+
</div>"
65+
;
6066
}
6167

6268
echo "</div>";
@@ -66,5 +72,6 @@
6672
?>
6773

6874

75+
6976
</body>
7077
</html>

student_panel/buspanel.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('database.php');
2+
include('../assets/config.php');
33
?>
44

55
<!DOCTYPE html>
@@ -69,7 +69,7 @@
6969
</div>
7070
</nav>
7171

72-
<div class="container mt-4 border-0 p-3 shadow">
72+
<div class="container mt-4 border-0 p-3 shadow border-0">
7373
<?php
7474
session_start();
7575

@@ -105,7 +105,7 @@
105105
if ($result && mysqli_num_rows($result) > 0) {
106106
while ($row = mysqli_fetch_assoc($result)) {
107107
echo "
108-
<div class='container shadow' style='margin: 0; width: 100%; margin-bottom: 5%'>
108+
<div class='container shadow border-0' style='margin: 0; width: 100%; margin-bottom: 20px; border-left: 4px solid #54cb54 !important;'>
109109
<a href='buslocation.php?bus_id={$row['bus_id']}' class='text-decoration-none text-dark'>
110110
<div class='d-flex align-items-center'>
111111
<div class='bus-icon'></div>

student_panel/database.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
2-
include("../assets/config.php");
2+
include('../assets/config.php');
33
?>
+14-20
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
<?php
2-
include('../database.php');
2+
include('../../assets/config.php');
33

4-
// Get the raw POST data
5-
$input = file_get_contents("php://input");
6-
7-
// Decode the JSON data into an associative array
8-
$data = json_decode($input, true);
4+
$input = file_get_contents("php://input");
95

10-
// Check if 'id' exists in the decoded data
11-
if (isset($data['id'])) {
12-
$id = $data['id'];
6+
$data = json_decode($input, true);
137

14-
$sql = "UPDATE students SET request='pending', request_date=CURRENT_DATE, request_time=CURRENT_TIME WHERE id = '{$id}'";
8+
if (isset($data['id'])) {
9+
$id = $data['id'];
1510

11+
$stmt = $conn->prepare("UPDATE students SET request='pending', request_date=CURRENT_DATE, request_time=CURRENT_TIME WHERE id = ?");
1612

17-
$result = mysqli_query($conn,$sql);
13+
$stmt->bind_param('s', $id);
1814

19-
if ($result) {
20-
echo json_encode(["status" => "success", "message" => "Request updated successfully"]);
15+
if ($stmt->execute()) {
16+
echo json_encode(["status" => "success", "message" => "Request updated successfully"]);
2117
} else {
22-
echo json_encode(["status" => "error", "message" => "Error updating request"]);
18+
echo json_encode(["status" => "error", "message" => "Error updating request"]);
2319
}
2420

25-
// Close the statement and connection
26-
mysqli_stmt_close($stmt);
27-
mysqli_close($conn);
21+
$stmt->close();
22+
$conn->close();
2823

29-
} else {
30-
// 'id' is not set in the data
24+
} else {
3125
echo json_encode(["status" => "error", "message" => "ID not found"]);
32-
}
26+
}
3327
?>

student_panel/fetchAttendence.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<?php
44
error_reporting(0);
5-
include('database.php');
5+
include('../assets/config.php');
66
$response="";
77
session_start();
88
if($_SERVER['REQUEST_METHOD']=="POST"){

student_panel/fetchAttendencePercentage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('database.php');
2+
include('../assets/config.php');
33
session_start();
44

55
$response = array();

student_panel/fetchTimetable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
include('database.php');
2+
include('../assets/config.php');
33
$response = array();
44
session_start();
55

student_panel/workspace.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<?php
77

88
// session_start();
9-
include('database.php');
9+
include('../assets/config.php');
1010
error_reporting(0);
1111
?>
1212
<!DOCTYPE html>
@@ -108,11 +108,6 @@
108108
background-color: #363949;
109109
}
110110

111-
#myTable tr.header, #myTable tr:hover{
112-
113-
114-
115-
}
116111
#myTable tr:hover{
117112
background-color: #779ca6;
118113
}

teacher_panel/partials/student-shared/feedback-tab.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@
120120
</div>
121121
122122
</div>
123-
<div class="col-12 col-md-8 d-flex mt-3 justify-content-center">
123+
<div class="col-12 col-md-8 d-flex mt-3 p-0 justify-content-center">
124124
125-
<div class="row" style="max-width: 523px;">
125+
<div class="row w-100" >
126126
127127
<div class="container">
128128
129129
<div class="card border-0 rounded-0 card-messages mt-3" style="width: 100%;">
130-
<div class="mt-3">
130+
<div class="mt-3">
131131
132132
133133
<h6 class="ms-2">Feedbacks</h6>

teacher_panel/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ td.tableData {
22812281
.feedback .card-messages .messages-box {
22822282
height: 480px;
22832283
width: 100%;
2284-
overflow-y: scroll;
2284+
overflow-y: auto;
22852285
scroll-behavior: smooth;
22862286
}
22872287

0 commit comments

Comments
 (0)