-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
152 lines (104 loc) · 5.73 KB
/
admin.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
143
144
145
146
147
148
149
150
151
152
<<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://kit.fontawesome.com/9d45450406.js" crossorigin="anonymous"></script>
<title></title>
</head>
<body>
<?php
session_start();
require 'connect.php';
require 'functions.php';
require 'header2.php';
if (!isset($_SESSION['username']))
header("Location: index.php");
?>
<style>
table td, table th
{
max-width: 200px;
word-wrap: break-word;
}
body {
background-image: url("form1.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
<body id="body1">
<section class="center-text"><br><br>
<div class="registration-form box-center">
<br><br><br><div id="page-wrapper">
<div class="container-fluid">
<div class="col-lg-12">
<div class="table responsive, overflow-x:auto;">
<table id="dataset"class="table table-bordered table-hover table-striped table-sm" >
<thead class="thead-light">
<tr>
<th>User Name</th>
<th>Password</th>
<th>Student Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Course</th>
<th>Grade Level</th>
<th>Year Level</th>
<th>School</th>
<th>Status</th>
<th>Options</th>
</tr>
</thead>
<tbody>
<?php
$query = 'SELECT c. * , p.* FROM students c, school p WHERE c.Student_ID = p.Student_ID';
$result = mysqli_query($con, $query) or die(mysqli_error($con));
while($row = mysqli_fetch_assoc($result)){
echo '<tr>';
echo '<td>'. $row['username'].'</td>';
echo '<td>'. $row['password'].'</td>';
echo '<td>'. $row['Student_ID'].'</td>';
echo '<td>'. $row['firstname'].'</td>';
echo '<td>'. $row['lastname'].'</td>';
echo '<td>'. $row['course'].'</td>';
echo '<td>'. $row['grlevel'].'</td>';
echo '<td>'. $row['yrlevel'].'</td>';
echo '<td>'. $row['School'].'</td>';
echo '<td><b>'. $row['status'].'</b></td>';
echo '<td> <a href="view.php?username='. $row['username'] .'" class="mr-3" title="View Record" data-toggle="tooltip"><span class="fa fa-eye"></span></a>';
echo ' <a href="edit.php?action=edit & username='.$row['username'] .'" class="mr-3" title="Edit Record" data-toggle="tooltip"><i class="fa-solid fa-user-pen"></i></a>';
echo ' <a href="delete.php?type=student&delete & username=' . $row['username'] . '" class="mr-3" title="Delete Record" data-toggle="tooltip"><span class="fa fa-trash"></span></a></td>';
echo '</tr> ';
}
?>
</tbody>
</table>
<br><br><br><br>
<a class="btn btn-secondary" href="export1.php" role="button">View Downloables</a>
<a class="btn btn-primary" href="data.php" role="button">View Data</a>
<a class="btn btn-secondary" href="logout.php" role="button">Logout</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/dataTables.bootstrap5.min.js"></script>
<script>
$(document).ready(function() {
$('#dataset').DataTable( {
"paging": true,
"ordering": true,
"info": true,
"pagingType": 'full_numbers',
order: [[1, 'desc']],
} );
} );
</script>
</body>
</html>