-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCtoD_Delete.php
More file actions
37 lines (32 loc) · 840 Bytes
/
CtoD_Delete.php
File metadata and controls
37 lines (32 loc) · 840 Bytes
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
<?php
session_start();
if (!isset($_SESSION["FacultyID"]) || !$_SESSION["isDepartmentAdmin"]) {
header("Location: login.php");
exit();
}
require 'server_config.php';
require 'upload.php';
require './services/CtoD.service.php';
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_GET['ID'])) {
$ID = $_GET['ID'];
$sql = "SELECT * FROM c_to_d_admission WHERE ID='$ID'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$admission = new CtoD();
$result = $admission->delete($ID);
header("Location: C_TO_D.php");
exit();
} else {
$_SESSION['notification'] = array(
"message" => "No record found",
"type" => "danger",
);
header("Location: C_TO_D.php");
exit();
}
}
$conn->close();
?>