-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_camera.php
84 lines (60 loc) · 1.87 KB
/
delete_camera.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
<?php
require_once 'rrmdir.php';
$id = $_GET['id'];
$servername = "localhost:3306";
$username = "root";
$password = "root";
$databaseName = "database".$id;
$conn = new mysqli($servername, $username, $password);
$query = "DROP DATABASE ".$databaseName;
if ($conn->query($query) === TRUE) {
echo "Database dropped successfuly.";
} else {
echo "Unable to drop database " . $connection->error;
}
$conn->close();
$dbname = "camera";
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "DELETE FROM `camera` WHERE id='".$id."'";
if ($conn->query($sql) === TRUE) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . $conn->error;
}
$conn->close();
$dir = "worker faces".$id;
$x = rrmdir($dir);
$dir = "validation".$id;
$x = rrmdir($dir);
$dir = "unprocessed images".$id;
$x = rrmdir($dir);
$dir = "saved_models".$id;
$x = rrmdir($dir);
$dir = "not a person".$id;
$x = rrmdir($dir);
$dir = "finish check faces".$id;
$x = rrmdir($dir);
$dir = "enter_exit_validation".$id;
$x = rrmdir($dir);
$dir = "enter_exit_saved_model".$id;
$x = rrmdir($dir);
$dir = "enter_exit".$id;
$x = rrmdir($dir);
$dir = "check faces".$id;
$x = rrmdir($dir);
$file = "dataset_".$id.".csv";
unlink($file);
$file = "dataset2_".$id.".csv";
unlink($file);
$file = "dataset_".$id.".csv";
unlink($file);
$file = "my_plot_".$id.".png";
unlink($file);
$file = "my_plot2_".$id.".png";
unlink($file);
header("Location: /choose_a_camera.php?id=".$id);
?>