$allFieldsList = array("*"); $res = $mySqlObj -> querySelect("categories",$allFieldsList); //Create Instance $formGen = new easyFormProc(); 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];
#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 $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"] . "'");
<?php session_start(); include "settings.inc.php"; include "lang/en.inc.php"; include _LIBPATH . "functions.custom.inc.php"; if (isLoggedIn(_APPNAME)) { redirectPage("index.php"); } include _LIBPATH . "class.easyformproc.inc.php"; //Create Instance $formGen = new easyFormProc(); $formGen->setTextElement("usName", "", 30, 20, "txtboxes", "valNonEmpty", "Enter Username"); $formGen->setPasswordElement("psWord", "", 20, 20, "txtboxes", false, true, "Enter Password"); #Process Form $disForm = $formGen->processForm("Login", "buttons"); #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)) { include "dbaccess.class.php"; //Create Instance $mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD); //MySQL Database Instance $mySqlObj->selectDB(_DBNAME); $resLogin = $mySqlObj->authenticateLogin($postedVals["usName"], $postedVals["psWord"], true); if (count($resLogin)) { loginUser(_APPNAME, $resLogin[0]["userId"], $resLogin[0]["lastLogin"]);