Please select a DNA sample or click on a Taxon Name for more details."; } } } // echo "
";
if($formSubmitShop)
{
if(isset($_REQUEST['check']) or !empty($_REQUEST['check'])) {
foreach ($_POST['check'] as $index => $a)
{
if($a != "") {
$b = $_POST['cache'][$index];
if ($b != "") {
$sqltest = "SELECT ID_Cart FROM tablecart WHERE ID_User = '$UserID' " .
" AND ID_Cache = '$b' " .
" AND Session = '$SID'";
$resulttest = mysql_query($sqltest);
if(mysql_num_rows($resulttest))
{ echo "Selected DNA Sample is already in your shopping cart. "; } if(!mysql_num_rows($resulttest)) { $Current_Date = time(); $sqlshop = "INSERT INTO tablecart (ID_User, ID_Cache, Session, Created_When1) VALUES ('$UserID','$b','$SID','$Current_Date')"; $resultshop = mysql_query($sqlshop); } } } } } } if($formSubmitShop and $cachedetail != "") { $sqltest = "SELECT ID_Cart FROM tablecart WHERE ID_User = '$UserID' " . " AND ID_Cache = '$cachedetail' " . " AND Session = '$SID'"; $resulttest = mysql_query($sqltest); if(mysql_num_rows($resulttest)) { echo "Selected DNA Sample is already in your shopping cart. "; } if(!mysql_num_rows($resulttest)) { $Current_Date = time(); $sqlshop = "INSERT INTO tablecart (ID_User, ID_Cache, Session, Created_When1) VALUES ('$UserID','$cachedetail','$SID','$Current_Date')"; $resultshop = mysql_query($sqlshop); } } if((isset($_SESSION['login']) or $_SESSION['login'])) { $sqlcarttest = "SELECT * FROM tablecart WHERE ID_User = '$UserID' AND Session = '$SID'"; $resultcarttest = mysql_query($sqlcarttest); $items = mysql_num_rows($resultcarttest); if(!$formSubmitShopDetail and !$formSubmitShopDelete and !$formSubmitOrder and !$formSubmitOrder2) { if($items == '0') { echo "Your shopping cart contents no DNA samples."; } if($items == '1') { echo "Your shopping cart contents ".$items." DNA sample. "; } if($items > 1) { echo "Your shopping cart contents ".$items." DNA samples. "; } } if($formSubmitShopDelete) { if(isset($_REQUEST['check']) or !empty($_REQUEST['check'])) { foreach ($_POST['check'] as $index => $a) { if($a != "") { $b = $_POST['cache'][$index]; if ($b != "") { $sqltest = "DELETE FROM tablecart WHERE ID_User = '$UserID' " . " AND ID_Cache = '$b' " . " AND Session = '$SID'"; $resulttest = mysql_query($sqltest); } } } $sqlcarttest2 = "SELECT * FROM tablecart WHERE ID_User = '$UserID' AND Session = '$SID'"; $resultcarttest2 = mysql_query($sqlcarttest2); $items2 = mysql_num_rows($resultcarttest2); if($items2 == '0') { echo "Your shopping cart contents no DNA samples."; } } } } // echo " |