$taskVals = array("meta_id" => "", "title" => "", "description" => "", "keyword" => "", "page" => ""); $pageArr = array("home" => "Home", "templates" => "Templates", "tips" => "Tips", "help" => "Help", "aboutus" => "About Us", "contact" => "Contact Us"); if (isset($_REQUEST['metaid']) || isset($_REQUEST['type'])) { $optEdit = false; if (isset($_REQUEST['metaid'])) { $optEdit = true; $taskList = mysql_fetch_array(mysql_query("select * from keywords where meta_id='" . $_REQUEST['metaid'] . "'")); $taskVals["title"] = $taskList["title"]; $taskVals["description"] = $taskList["description"]; $taskVals["keyword"] = $taskList["keyword"]; $taskVals["page"] = $taskList["page"]; } //Create Instance $formGen = new easyFormProc(); #Set Elements $formGen->setSelectElement("page", $pageArr, $taskVals["page"], "txtboxes", 1, false, "valNonEmpty", "Select category..."); $formGen->setTextElement("title", $taskVals["title"], "", 50, "txtboxes"); $formGen->setTextAreaElement("description", $taskVals["description"], 50, 8, "txtboxes"); $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
$catNameDisp = $catNameQuery[0]['catlink']; } } $editsql = $mySqlObj->querySelect("categories", $all); for ($x = 0; $x < count($editsql); $x++) { /*echo $catArr[$x] = $editsql[$x]["catname"]; $taskVals = $editsql[$x]["catid"];*/ $catArr[$editsql[$x]["catid"]] = $editsql[$x]["catname"]; } //Create Instance $formGen = new easyFormProc(); $mimetypes = array("image/jpeg" => "JPG"); $mimetypes1 = array("application/pdf" => "PDF"); #Set Elements $formGen->setFileElement("largeimg", "txtboxes", $chk, "Upload large image..", 2048, $mimetypes); $formGen->setSelectElement("cat", $catArr, $taskVals["catid"], "txtboxes", 1, false, "valNonEmpty", "Select category..."); $formGen->setTextElement("title", $taskVals["title"], "", 50, "txtboxes"); $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();