Exemplo n.º 1
0
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
    $disElementHTML = $formGen->getDisElementHTML();
    #Get Error Messages