set_time_limit(0); $GLOBALS["moduleid"]=71; $GLOBALS["nohtml"] = true; include "../header.php"; $GLOBALS["thisscriptname"]="pricelist/pricelist.php"; $GLOBALS["thisurltoimages"]=$GLOBALS["thesystemurltoimages"]; if ($_SERVER["SERVER_PORT"]!="443") { header('Location: '.$GLOBALS["selfeditsettings"]->{"securerooturl"}.$GLOBALS["thisscriptname"]); } //showintro($GLOBALS["moduleid"]); if (empty($_REQUEST["function"])) { doheader(); showform(); dofooter(); } elseif ($_REQUEST["function"]=="saveorder") { doheader(); saveorder(); dofooter(); } include "../footer.php"; function showform() { ?> echo $GLOBALS["usersettings"]->{"Price List Description"}; ?>
return 0; } function saveorder() { $finalizeorder="false"; if ($_REQUEST["process"]!=="error") { // create an order in PLorders $textfields=array("subtotal","s_and_h","tax","grandtotal","address","city","stateprov","postalzip","country","phone","instructions"); $commandexists=false; $FIRST="INSERT into PLorders ("; $SECOND="VALUES ("; $SECOND2="VALUES ("; foreach ($textfields as $field) { if ($_REQUEST[$field]=="") { $thevalue=""; } else { $thevalue=$_REQUEST[$field]; } if ($commandexists==true) { $FIRST=$FIRST.", ".$field.""; $SECOND=$SECOND.", '".str_replace("'","''",$thevalue)."'"; $SECOND2=$SECOND2.", '".$thevalue."'"; } else { $FIRST=$FIRST."".$field.""; $SECOND=$SECOND."'".str_replace("'","''",$thevalue)."'"; $SECOND2=$SECOND2."'".$thevalue."'"; $commandexists=true; } } $FIRST=$FIRST.") "; $SECOND=$SECOND.");"; $SECOND2=$SECOND2.");"; $sqlcmd=$FIRST.$SECOND; //echo "