$value) if ($_POST[$label] == "OK") { $sql = "select * from approvalBin where id = ".substr($label, strpos($label, "_") + 1); $result = mysql_query($sql, $conn) or die(mysql_error()); $rs = mysql_fetch_array($result); if ($rs['id'] != "") { $sql = "insert into oliverAds (". "datePosted, category, machineType, modelNumber, serialNumber, machineCapacities, dimensionsH, dimensionsL, dimensionsW, weight, motorHP,motorPhase, motorVolts, accessories, location, comments, price, phone,contactName, email, IAccept, posterPW". ") values (". "'".str_replace("'", "''", $rs['datePosted'])."', ". "'".str_replace("'", "''", $rs['category'])."', ". "'".str_replace("'", "''", $rs['machineType'])."', ". "'".str_replace("'", "''", $rs['modelNumber'])."', ". "'".str_replace("'", "''", $rs['serialNumber'])."', ". "'".str_replace("'", "''", $rs['machineCapacities'])."', ". "'".str_replace("'", "''", $rs['dimensionsH'])."', ". "'".str_replace("'", "''", $rs['dimensionsL'])."', ". "'".str_replace("'", "''", $rs['dimensionsW'])."', ". "'".str_replace("'", "''", $rs['weight'])."', ". "'".str_replace("'", "''", $rs['motorHP'])."', ". "'".str_replace("'", "''", $rs['motorPhase'])."', ". "'".str_replace("'", "''", $rs['motorVolts'])."', ". "'".str_replace("'", "''", $rs['accessories'])."', ". "'".str_replace("'", "''", $rs['location'])."', ". "'".str_replace("'", "''", $rs['comments'])."', ". "'".str_replace("'", "''", $rs['price'])."', ". "'".str_replace("'", "''", $rs['phone'])."', ". "'".str_replace("'", "''", $rs['contactName'])."', ". "'".str_replace("'", "''", $rs['email'])."', ". "'".str_replace("'", "''", $rs['IAccept'])."', ". "'".str_replace("'", "''", $rs['posterPW'])."'". ");"; // echo($sql."\n\n"); $result = mysql_query($sql, $conn) or die(mysql_error()); $sql = "delete from approvalBin where id = ".$rs['id']; $result = mysql_query($sql, $conn) or die(mysql_error()); $sql = "insert into oliverAdLog values (now(), '".$rs['id']." ".$rs['category']." ".$rs['machineType']." ".$rs['modelNumber']."', 'approved')"; $result = mysql_query($sql, $conn) or die(mysql_error()); } } } else print("
INVALID PASSWORD
"); } if ($_POST["submit"] == "Delete") { $sql = "select count(name) from bossPW where password = password('".$_POST["adminPW"]."')"; $PWresult = mysql_query($sql, $conn) or die(mysql_error()); $PWrs = mysql_fetch_array($PWresult); // echo($PWrs[0]); if ($PWrs[0] == 1) { foreach($_POST as $label => $value) if ($_POST[$label] == "OK") { $sql = "delete from approvalBin where id = ".substr($label, strpos($label, "_") + 1); $result = mysql_query($sql, $conn) or die(mysql_error()); $sql = "insert into oliverAdLog values (now(), '".substr($label, strpos($label, "_") + 1)."', 'deleted unposted')"; $result = mysql_query($sql, $conn) or die(mysql_error()); } } else { $message = "
INVALID PASSWORD
"; $admin = true; } } ?> Oliver Wanted Ads

Oliver Machinery

WANTED

Check the boxes next to the ads you want to approve or delete, then press the appropriate button.

Post Date:
Category:
Machine Type:
Model:
Serial No:
Capacities:
Dimensions:
Weight:
Motor:
Accessories:
Location:
Comments: ", $rs['comments'])) ?>
Price:
Phone No:
Contact Name:
E-mail:
Accepts Terms:

Admin Password: