1
+ <?php
2
+ session_start ();
3
+
4
+ if ( $ _SESSION [ "umail " ] == "" || $ _SESSION [ "umail " ] == NULL ) {
5
+ header ( 'Location:AdminLogin.php ' );
6
+ }
7
+ $ userid = $ _SESSION [ "umail " ];
8
+ ?>
9
+ <?php include ('adminhead.php ' ); ?>
10
+ <div class="container">
11
+ <div class="row">
12
+ <?php
13
+ include ( "database.php " );
14
+ if ( isset ( $ _REQUEST [ 'deleteid ' ] ) ) {
15
+
16
+ $ deleteid = $ _GET [ 'deleteid ' ];
17
+
18
+ $ sql = "DELETE FROM `registrationtable` WHERE RegID = $ deleteid " ;
19
+
20
+ if ( mysqli_query ( $ connect , $ sql ) ) {
21
+ echo "
22
+ <br><br>
23
+ <div class='alert alert-success fade in'>
24
+ <a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
25
+ <strong>Success!</strong> Regestration Details Deleted.
26
+ </div>
27
+ " ;
28
+ } else {
29
+ //error message if SQL query fails
30
+ echo "<br><Strong>Regestration Details Updation Faliure. Try Again</strong><br> Error Details: " . $ sql . "<br> " . mysqli_error ( $ connect );
31
+ }
32
+ //close the connection
33
+ mysqli_close ( $ connect );
34
+ }
35
+ ?>
36
+ </div>
37
+ <div class="row">
38
+ <div class="col-md-12">
39
+ <h3 class="page-header">Welcome <a href="welcomeadmin">Admin</a> </h3>
40
+ <?php
41
+ include ( "database.php " );
42
+ $ sql = "select * from registrationtable " ;
43
+ $ result = mysqli_query ( $ connect , $ sql );
44
+ echo "<h2 class='page-header'>Registration Details</h2> " ;
45
+ echo "<table class='table table-striped' style='width:100%'>
46
+ <tr>
47
+ <th>Reg ID</th>
48
+ <th>First Name</th>
49
+ <th>Last Name</th>
50
+ <th>Father Name</th>
51
+ <th>Course</th>
52
+ <th>DOB</th>
53
+ <th>Address</th>
54
+ <th>Gender</th>
55
+ <th>Phone Number</th>
56
+ <th>Email</th>
57
+ <th>Password</th>
58
+ <th>Edit</th>
59
+ <th>Delete</th>
60
+ <th>Admission Confirm</th>
61
+
62
+ <tr> " ;
63
+ while ( $ row = mysqli_fetch_array ( $ result ) ) {
64
+ ?>
65
+
66
+ <tr>
67
+ <td>
68
+ <?PHP echo $ row ['RegID ' ];?>
69
+ </td>
70
+ <td>
71
+ <?PHP echo $ row ['FName ' ];?>
72
+ </td>
73
+ <td>
74
+ <?PHP echo $ row ['LName ' ];?>
75
+ </td>
76
+ <td>
77
+ <?PHP echo $ row ['FaName ' ];?>
78
+ </td>
79
+ <td>
80
+ <?PHP echo $ row ['Course ' ];?>
81
+ </td>
82
+ <td>
83
+ <?PHP echo $ row ['DOB ' ];?>
84
+ </td>
85
+ <td>
86
+ <?PHP echo $ row ['Addrs ' ];?>
87
+ </td>
88
+ <td>
89
+ <?PHP echo $ row ['Gender ' ];?>
90
+ </td>
91
+ <td>
92
+ <?PHP echo $ row ['PhNo ' ];?>
93
+ </td>
94
+ <td>
95
+ <?PHP echo $ row ['Eid ' ];?>
96
+ </td>
97
+ <td>
98
+ <?PHP echo $ row ['Pass ' ];?>
99
+ </td>
100
+ <td><a href="UpdateRegestrationDetails.php?regid=<?PHP echo $ row ['RegID ' ];?> "><input type="button" Value="Edit" class="btn btn-info btn-sm"></a>
101
+ </td>
102
+ <td><a href="RegestrationDetails.php?deleteid=<?PHP echo $ row ['RegID ' ];?> "><input type="button" Value="Delete" class="btn btn-info btn-sm"></a>
103
+ </td>
104
+ <td><a href="addConfirm.php?addnewRegId=<?php echo $ row ['RegID ' ]; ?> "><input type="button" Value="Yes" class="btn btn-info btn-sm"></a>
105
+ </td>
106
+ </tr>
107
+ <?php } ?>
108
+ </table>
109
+ </div>
110
+ </div>
111
+
112
+ <?php include ('allfoot.php ' ); ?>
0 commit comments