-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshop_log_delete_shopvisitid.php
59 lines (48 loc) · 1.7 KB
/
shop_log_delete_shopvisitid.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
<?php
require_once('Connections/YBDB.php');
require_once('Connections/database_functions.php');
if($_GET['visit_id']>0){
$visit_id = $_GET['visit_id'];
} else {
$visit_id =-1;
}
if($_GET['shop_id']>0){
$shop_id = $_GET['shop_id'];
} else {
$shop_id =-1;
}
if(isset($_GET['confirm_delete'])){
$confirm_delete = $_GET['confirm_delete'];
} else {
$confirm_delete ='no';
}
$page_delete_yes = $_SERVER['PHP_SELF'] . "?" . htmlentities($_SERVER['QUERY_STRING']) . "&confirm=yes";
if ($shop_id <> 90){
//returns to the shop_log?shop_id page
$page_delete_no = PAGE_SHOP_LOG . "?" . htmlentities($_SERVER['QUERY_STRING']);
} else {
//returns to the individual hours page
$page_delete_no = INDIVIDUAL_HOURS_LOG . "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((visit_id <> -1) && (shop_id <> -1) && ($_GET['confirm'] == 'yes')){
$insertSQL = "DELETE FROM shop_hours WHERE shop_visit_id = {$visit_id}";
mysql_select_db($database_YBDB, $YBDB);
$Result1 = mysql_query($insertSQL, $YBDB) or die(mysql_error());
$pagegoto = $page_delete_no;
header(sprintf("Location: %s", $pagegoto)); //browse back to shop
} // end if to delete
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Yellow Bike - Shop Login</title>
<link href="css_yb_standard.css" rel="stylesheet" type="text/css" />
</head>
<body class="yb_standard">
<p>Do you really want to delete this visit:</p>
<p>
<a href="<?php echo $page_delete_yes ?>">Yes</a>
<a href="<?php echo $page_delete_no ?>">No</a></p>
</body>
</html>