-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreallyDelete.php
More file actions
51 lines (36 loc) · 1.22 KB
/
reallyDelete.php
File metadata and controls
51 lines (36 loc) · 1.22 KB
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
<?php
$outputType = "html";
$query="";
include ('mpdf/mpdf.php');
$mpdf=new mPDF('','Letter', 0, '', 12, 12, 12, 12, 1, 1, '');
ob_start();
require_once 'config.php';
require_once 'dbopen.php';
if($_GET['reservation']) $reservation = $_GET['reservation'];
if($_GET['limit']) $limit = $_GET['limit'];
if ($debug) echo "$reservation <br> is $reservation and limit is $limit<br>";
// Cycle through the blocks removing all reservations
for ($counter = 1; $counter <=4; $counter++){
$query .= "update reserved set block".$counter." = null where block".$counter." ='".$reservation."';";
}
if($debug) echo "Query is: $query<br>";
$result= mysqli_multi_query($mysqli, $query);
echo mysqli_affected_rows($mysqli)." rows were updated<br>";
mysqli_free_result;
$query = "delete from reservation where requestNumber = ".$reservation." limit ".$limit;
if ($debug) echo "$request total delete is <br>$query";
$result = mysqli_query($mysqli, $query);
echo "And in the request, ".mysqli_affected_rows($mysqli)." rows were updated";
mysqli_free_result;
require_once 'dbclose.php';
require_once 'end.php';
$html=ob_get_contents();
ob_end_clean();
if ($outputType == "pdf") {
$mpdf->WriteHTML($html);
$mpdf->Output();
} else {
echo $html;
}
exit;
?>