require_once ("../common/includes/settings.php"); include "config.php"; if($_REQUEST['teststr'] == '151231251'){ $photos = glob($GLOBAL_ABSOLUTE_IMAGE_PATH.'/items/images-old/brand-*'); // $photos = $GLOBAL_ABSOLUTE_IMAGE_PATH.'/items/images-old/tarrow_down.gif'; $count = 0; var_dump($photos); foreach($photos as $photo){ copy($photo,str_replace('items/images-old','items/images',$photo)); // $count++; } echo $count.' Images transferred'; exit; } $from_details = isset($_GET['new']) && $_GET['new'] == 1 ? $_GET['new'] : 0; if ($_POST["submit"] && hasAccess(getSessionUserid(),"ar",true)) { $valid = true; if (!is_int((int) $_POST["iid"])) $valid = false; if ($_POST["name"] == "") { $valid = false; $nameError = "has-error"; } //if ($_POST["location"] == "") { $valid = false; $locationError = "has-error"; } //if ($_POST["setup"] == "") { $valid = false; $setupError = "has-error"; } if ($_POST["nutshell"] == "") { $valid = false; $nutshellError = "has-error"; } //if ($_POST["similar"] == "") { $valid = false; $similarError = "has-error"; } //if ($_POST["strengths"] == "") { $valid = false; $strengthsError = "has-error"; } //if ($_POST["weaknesses"] == "") { $valid = false; $weaknessesError = "has-error"; } if ($_POST["crunch"] == "") { $valid = false; $crunchError = "has-error"; } if ($_POST["lou"] == "") { $valid = false; $louError = "has-error"; } if (!is_int((int) $_POST["uid"])) { $valid = false; $uidError = "has-error"; } if (!is_int((int) $_POST["performance"]) || $_POST["performance"] == 0) { $valid = false; $performanceError = "has-error"; } if (!is_int((int) $_POST["reliability"]) || $_POST["reliability"] == 0) { $valid = false; $reliabilityError = "has-error"; } if (!is_int((int) $_POST["value"]) || $_POST["value"] == 0) { $valid = false; $valueError = "has-error"; } if (!is_int((int) $_POST["overall"]) || $_POST["overall"] == 0) { $valid = false; $overallError = "has-error"; } if ($valid) { $i = new Review(0); $i->setIID($_POST["iid"]); $i->setUID($_POST["uid"]); $i->setName(Global_CleanMessage($_POST["name"])); $i->setLocation(Global_CleanMessage($_POST["location"])); $i->setLOU($_POST["lou"]); $i->setSetup(Global_CleanMessage($_POST["setup"])); $i->setNutshell(Global_CleanMessage($_POST["nutshell"])); $i->setSimilar(Global_CleanMessage($_POST["similar"])); $i->setStrengths(Global_CleanMessage($_POST["strengths"])); $i->setWeaknesses(Global_CleanMessage($_POST["weaknesses"])); $i->setCrunch(Global_CleanMessage($_POST["crunch"])); $i->setPerformance($_POST["performance"]); $i->setReliability($_POST["reliability"]); $i->setValue($_POST["value"]); $i->setOverall($_POST["overall"]); $i->setFromDetails($_POST["fromdetails"]); if (isset($_POST["hide"])) $i->setStatus($REVIEW_STATUS_HIDDEN); else $i->setStatus($_POST["status"]); $i->setSubmittedDate(); if ($i->add()) { $default_alert = "New review added."; if ($_POST["uid"] == 0) header ("Location: ../notification.php?nid=sgstrw&iid=".$_POST["iid"]); else { $u = new User($_POST["uid"]); $u->setNoofrposts($u->getNoofrposts()+1); $u->update_db(); header ("Location: ../notification.php?nid=rwpost&iid=".$_POST["iid"]); } exit; } else $default_alert = "Please fill in all fields with an *."; } else $default_alert = "Contribute a Review!"; } //strlen($_GET["iid"]) > 0 && is_int((int) $_GET["iid"])? $iid = $_GET["iid"] : $iid = 0; $iid=0; if(isset($_REQUEST['iid']) && is_numeric($_REQUEST['iid']) && (int) $_REQUEST['iid'] > 0) { $iid = (int) $_REQUEST['iid']; } else { header("Location: $APP_ROOT_PAGE"); exit; } $item = new Item($iid); if (!$item->getID()) { header("Location:".$APP_ROOT_PAGE); exit; } if (!hasAccess(getSessionUserid(),"ar",true)) { header("Location:".$APP_ROOT_PAGE); exit; } $itembrand = new Brand($item->getBID()); $prices = new StreetPrices($item->getID()); $category = new Category($item->getCID()); $distributor = new DistributorTieIn($item->getBID(), $item->getCID()); isInSession()? $user = new User(getSessionUserid()) : $user = new User(0); header("Expires: ".gmdate("D, d M Y H:i:s", time() + 360)." GMT"); header("Cache-Control: max-age=360, must-revalidate"); ## Fill in the following for SEO $WEBPAGE_TITLE = "Post a Review ".$GLOBAL_PORTAL_NAME; $meta_description = ""; $meta_keywords = ""; ?>