forked from skalia11/driving-school
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete-instructor.php
75 lines (58 loc) · 1.55 KB
/
delete-instructor.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
<?php
/**********************************************************
* Project Name: Driving School System
* Version: 1.0
* Developer: Saransh Kalia & Emad Zamout
* Course: CPSC 3660
**********************************************************/
session_start();
if(!isset($_SESSION['user'])){
header('Location:index.php');
} ?>
<?php
include 'includes/dashboard_header.php'; ?>
</head>
<body>
<h1>Delete </h1>
<hr />
<table align="center" color="blue" border="4">
<h2>
<?php
/*this function takes in its parameters all the necessary
variables that are needed to delete an existing attribute
in the student query*/
$sin = (isset($_GET['sincard']) ? $_GET['sincard'] : null);
if(isset($_GET['sincard'])){
include 'includes/connect.php';
$sqlget= mysqli_query($dbhandle,"DELETE from people where people.sincard='$sin'");
if($sqlget){
echo "Information has been deleted successfully !";
}else{
echo "Sorry, there is an error. Please try again later !";
}
}
?></h2>
</table><hr />
<button id="close-nicemodal" class="btn">Close</button>
<div>
<br /></div>
<script>
$(function(){
$('button#demo').nicemodal({
width: '500px',
keyCodeToClose: 27,
defaultCloseButton: true,
idToClose: '#close-nicemodal',
closeOnClickOverlay: true,
closeOnDblClickOverlay: false,
onOpenModal: function(){
confirm('You really want to delete it ?');
},
onCloseModal: function(){
window.location.href='employee.php';
}
});
});
</script>
</body>
</html>