-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfacultydetails.php
107 lines (97 loc) · 2.69 KB
/
facultydetails.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
<?php
session_start();
if ( $_SESSION[ "umail" ] == "" || $_SESSION[ "umail" ] == NULL ) {
header( 'Location:AdminLogin.php' );
}
$userid = $_SESSION[ "umail" ];
?>
<?php include('adminhead.php'); ?>
<div class="container">
<div class="row">
<?php
include( "database.php" );
if ( isset( $_REQUEST[ 'deleteid' ] ) ) {
include( "database.php" );
$deleteid = $_GET[ 'deleteid' ];
//delete faculty Query
$sql = "DELETE FROM `facutlytable` WHERE FID = $deleteid";
if ( mysqli_query( $connect, $sql ) ) {
echo "
<br><br>
<div class='alert alert-success fade in'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a>
<strong>Success!</strong> Faculty Details has been deleted.
</div>";
} else {
//error message if SQL query fails
echo "<br><Strong>Faculty Details Updation Faliure. Try Again</strong><br> Error Details: " . $sql . "<br>" . mysqli_error( $connect );
}
//close the connection
mysqli_close( $connect );
}
?>
</div>
<div class="row">
<div class="col-md-12">
<h3 class="page-header">Welcome <a href="welcomeadmin">Admin</a> </h3>
<?php
include( "database.php" );
$sql = "select * from facutlytable";
$result = mysqli_query( $connect, $sql );
echo "<h3 class='page-header' >Facutly Details</h3>";
echo "<div class='table-responsive'> <table class='table table-striped' style='width:100%'>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Father Name</th>
<th>Addrs</th>
<th>Gender</th>
<th>Joining Date</th>
<th>City</th>
<th>Phone Number</th>
<th>Password</th>
<th>Edit</th>
<th>Delete</th>
<tr>";
while ( $row = mysqli_fetch_array( $result ) ) {
?>
<tr>
<td>
<?PHP echo $row['FID'];?>
</td>
<td>
<?PHP echo $row['FName'];?>
</td>
<td>
<?PHP echo $row['FaName'];?>
</td>
<td>
<?PHP echo $row['Addrs'];?>
</td>
<td>
<?PHP echo $row['Gender'];?>
</td>
<td>
<?PHP echo $row['JDate'];?>
</td>
<td>
<?PHP echo $row['City'];?>
</td>
<td>
<?PHP echo $row['PhNo'];?>
</td>
<td>
<?PHP echo $row['Pass'];?>
</td>
<td><a href="updatefaculty.php?fid=<?php echo $row['FID']; ?>"><input type="button" Value="Edit" class="btn btn-warning btn-sm"></a>
</td>
<td><a href="facultydetails.php?deleteid=<?php echo $row['FID']; ?>"><input type="button" Value="Delete" class="btn btn-danger btn-sm"></a>
</td>
</tr>
<?php } ?>
</table>
</div>
<a href="addnewfaculty"><button type="button" value="Add New Faculty" class="btn btn-success btn-sm">Add New Faculty</button></a>
</div>
</div>
<?php include('allfoot.php'); ?>