<?php
$startdate = date('Y-m-d H:i:s');
echo $startdate."</br>";
$offset = strtotime("+1 day");
$enddate = date("Y-m-d H:i:s", $offset);
echo $enddate."</br>";
$newamount = $availablequantity - $quantity;
if($enddate > $startdate) {
if($availablequantity != 0) {
$sql = mysql_query("UPDATE size SET quantity ='$newamount' WHERE id ='$item_id'") or die (mysql_error());
}
//$sql = mysql_query("UPDATE size SET quantity = WHERE size ='$item_id'") or die (mysql_error());
}
else if($startdate < $enddate) {
$sql = mysql_query("UPDATE size SET quantity ='$availablequantity' WHERE id ='$item_id'") or die (mysql_error());
$sql = mysql_query("DELETE FROM reservations WHERE size_id ='$item_id'") or die (mysql_error());
}
}
}
//Can anyone help me how to return the product if no transaction has been made within a day.. What I must use in order for the system to automatically expire the product and return it to the size table. please help me.
?>
civirol02 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.