-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchid.php
142 lines (128 loc) · 4.72 KB
/
searchid.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GDC HelpDesk</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<script defer src="javascript/activeani.js"></script>
<style>
.panel {
max-width: 500px;
margin: 0 auto;
padding: 30px;
border-radius: 15px;
background-color: #f8f8f8;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.panel-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.panel-content {
font-size: 16px;
line-height: 1.6;
color: #555;
}
span{
font-weight: bold;
}
.go-back-button {
display: inline-block;
margin-top: 20px;
padding: 10px 20px;
background-color: #008CBA;
color: #fff;
border: none;
border-radius: 5px;
font-size: 18px;
text-decoration: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.go-back-button:hover {
background-color: #005580;
}
</style>
</head>
<body>
<header>
<a href="index.html" class="brand">GDC HelpDesk</a>
<div class="menu">
<div class="btn">
<i class="fas fa-times close-btn"></i>
</div>
<a href="index.html">Home</a>
<a href="issue.html">Issue</a>
<a href="issuetracker.html" class="active">Issue Tracker</a>
<a href="reslog.php">Result</a>
<a href="aboutus.html">About Us</a>
</div>
<div class="btn">
<i class="fas fa-bars menu-btn"></i>
</header>
<section class="section-main">
<div class="container">
<div class="panel">
<?php
// Connect to the database
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "studentdata";
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// Check if the form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the user ID from the form
$userId = $_POST['issue_id'];
// Validate the user ID (you can use additional validation if needed)
if (ctype_digit($userId)) {
// Perform the database query to check if the ID exists
$sql = "SELECT * FROM issuedata WHERE id = $userId";
$result = mysqli_query($conn, $sql);
// Check if the record is found
if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
$response = $row['Response'];
if ($response === 'Yes' || $response === 'yes' || $response === 'YES') {
$str = "Your issue has been responded.";
} elseif ($response === 'No' || $response === 'no' || $response === null) {
$str = "Your issue has not been responded yet.";
} else {
$str = "Invalid response status.";
}
echo '<div class="panel-title">User ID: ' . $row['id'] . '</div>';
echo '<div class="panel-content">';
echo '<span>Student Name:</span> ' . $row['student_name'] . '<br>';
echo '<span>Group :</span> ' . $row['stdgroup'] . '<br>';
echo '<span> Year :</span> ' . $row['grp_year'] . '<br>';
echo '<span>Status :</span>' . $str . '<br>';
if ($response === 'Yes' || $response === 'yes' || $response === 'YES') {
echo '<span> Message :</span> ' . $row['Response_msg'] . '<br>';
}
echo '</div>';
} else {
echo '<div class="panel-title" style="color:red">User not found.</div>';
}
} else {
// Invalid user ID (not a number)
echo '<div class="panel-title">Please enter a valid user ID (numbers only).</div>';
}
}
// Close the connection
mysqli_close($conn);
?>
<a href="issuetracker.html" class="go-back-button">Go Back</a>
</div>
</div>
</section>
<script type="text/javascript" src="javascript/stickyresnav.js"></script>
</body>
</html>