for($r=0;$r<count($res);$r++) { //$formGen -> setTextElement("order".$r,$res[$r]["ordering"],5, 5,"txtboxes"); $formGen -> setHiddenElement("id".$r,$res[$r]["catid"]); } #Process Form $disForm = $formGen -> processForm("Update","buttons", "submit", "index.php?action=categories"); #Get HTML of the elements $disElementHTML = $formGen -> getDisElementHTML(); #Get Error Messages $errMsg = $formGen -> getErrorMsg("The following errors occured","style2"); #Get Posted Values $postedVals = $formGen -> getPostedElementValues(); if(count($postedVals)) { for($z=0;$z<count($postedVals)/2;$z++) { $orderV = array("ordering" => $postedVals["order".$z]); $condition = "catid = ".$postedVals["id".$z]; $resAddUpdate = $mySqlObj -> queryUpdate("categories",$orderV,true,$condition); } redirectPage("index.php?action=categories"); }
$formGen->setTextAreaElement("keyword", $taskVals["keyword"], 50, 8, "txtboxes"); //$formGen -> setHiddenElement("data", $_REQUEST["metaid"], 50, 8, "txtboxes"); $addFormPostURL = ""; if ($optEdit) { $addFormPostURL = "&metaid=" . $_GET["metaid"] . "&type=" . $_REQUEST['type']; $submitBtnLabel = "Update"; } else { $addFormPostURL = "&type=" . $_REQUEST['type']; $submitBtnLabel = "Add Data"; } #Process Form $disForm = $formGen->processForm($submitBtnLabel, "buttons", "subAddTask", "index.php?action=addmeta" . $addFormPostURL); #Get HTML of the elements $disElementHTML = $formGen->getDisElementHTML(); #Get Error Messages $errMsg = $formGen->getErrorMsg($_appLang["errorMsgLabel"], "style2"); #Get Posted Values $postedVals = $formGen->getPostedElementValues(); if (count($postedVals)) { $allVals = array("title" => $postedVals["title"], "description" => $postedVals["description"], "keyword" => $postedVals["keyword"], "page" => $postedVals["page"]); if ($optEdit) { $condition = "meta_id = '" . $_GET["metaid"] . "'"; $resAddUpdate = $mySqlObj->queryUpdate("keywords", $allVals, true, $condition); echo "Successfully added. Please wait...<META HTTP-EQUIV=\"refresh\" content=\"3;URL=index.php?action=addmeta\" />"; die; } else { $pagetest = mysql_query("select * from keywords where page='" . $postedVals["page"] . "'"); $rowss = mysql_num_rows($pagetest); if ($rowss > 0) { $errMsg = "Meta data for the current page has been added already"; } else {
$formGen->setTextElement("price", $taskVals["price"], 255, 25, "txtboxes", "valNonEmpty", "Enter Price."); $formGen->setTextAreaElement("description", $taskVals["description"], 50, 8, "txtboxes"); $formGen->setTextAreaElement("keyword", $taskVals["keyword"], 50, 8, "txtboxes"); $addFormPostURL = ""; if ($edit) { $addFormPostURL = "&tempid=" . $_GET["tempid"]; $submitBtnLabel = "Update Item"; } else { $submitBtnLabel = "Add Item"; } #Process Form $disForm = $formGen->processForm($submitBtnLabel, "buttons", "AddTask", "index.php?action=additems" . $addFormPostURL); #Get HTML of the elements $disElementHTML = $formGen->getDisElementHTML(); #Get Error Messages $errMsg = $formGen->getErrorMsg("Following errors occured:", "style2"); #Get Posted Values $postedVals = $formGen->getPostedElementValues(); if (count($postedVals)) { /*print_ri($postedVals); exit; */ $condit = "temp_img = '" . $_FILES['largeimg']['name'] . "' "; $chksql = $mySqlObj->querySelect("template", $all, "", "", $condit); if (count($chksql) == 0 || $edit == true) { $cana = array("catlink"); $catnacon = "catid='" . $postedVals['cat'] . "'"; $catnames = $mySqlObj->querySelect("categories", $cana, "", "", $catnacon); #uploading image if there are any images uploaded if (!empty($postedVals["largeimg"]["name"])) { //$uploaddir1 = '../templates/large/';