-
Notifications
You must be signed in to change notification settings - Fork 0
/
SELECT2.php
106 lines (80 loc) · 1.92 KB
/
SELECT2.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
<html>
<head>
<title>SELECT</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="LOGIN1.css"> -!>
</head>
<body>
<div id="body">
<?php
$SID = $_POST['SID'];
if ( !empty($SID) )
{
$servername = "localhost";
$username = "root";
$dbname ="sugan_SF";
// Create connection
$conn = new mysqli($servername, $username,"",$dbname);
// Check connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
else
{
$SELECT = "SELECT * FROM MAINTENANCE WHERE SID=$SID";
$RESULT = mysqli_query($conn, $SELECT);
/* --------------------------PRINTING PART------------------------------------------------- */
if (mysqli_num_rows($RESULT) > 0 )
{
// output data of each row
$row = mysqli_fetch_assoc($RESULT);
/*-------------Maintenance TABLE------ */
echo "<br><br>";
echo "MAINTENANCE TABLE <br>";
echo "<table border='1'>
<tr>
<th>F_name</th>
<th>L_name</th>
<th>SID</th>
<th>eMID</th>
<th>Current_statistics</th>
<th>Modification</th>
<th>Feedback</th>
<th>Investment</th>
</tr>";
echo "<tr>";
echo "<td>" . $row['F_name'] . "</td>";
echo "<td>" . $row['L_name'] . "</td>";
echo "<td>" . $row['SID'] . "</td>";
echo "<td>" . $row['eMID'] . "</td>";
echo "<td>" . $row['Current_statistics'] . "</td>";
echo "<td>" . $row['Modification'] . "</td>";
echo "<td>" . $row['Feedback'] . "</td>";
echo "<td>" . $row['Investment'] . "</td>";
echo "</tr>";
echo "</table>";
echo "<br><br>";
}
else
{
echo("<script type=\"text/javascript\">
window.alert('Entered SID does not match any records!');
window.location.href='WELCOME2.html';
</script>");
}
$conn->close();
}
}
else
{
echo("<script type=\"text/javascript\">
window.alert('Enter SID!');
window.location.href='WELCOME2.html';
</script>");
die();
}
?>
</div>
</body>
</html>