1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 00:53:22 -05:00
Yellow-Bike-Database-Mirror/attic/shop_log_delete_shopvisitid.php
Jonathan Rosenbaum f919422de4 Turns off the ability to delete a users sign-in entry.
1) Bots like to follow the delete link on demostrations and delete all the time-in entries.
2) YBDB adhers to open trust metrics that are common at bicycle collectives, bots really do not care about trust including bots from google, they love exploring every link though.
3) This functionality isn't really necessary since it is possible to make the sign-in time the same as the sign-out time if the person changes their mind about their visit.
2015-03-24 04:47:10 +00:00

60 lines
1.7 KiB
PHP

<?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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?php echo $page_delete_no ?>">No</a></p>
</body>
</html>