// or if this is a new record, it returns the defaults $therecord = $import->processImportPage(); //make sure that we set the status message id the processing returned one // (e.g. "Record Updated") if (isset($therecord["phpbmsStatus"])) { $statusmessage = $therecord["phpbmsStatus"]; } $pageTitle = $therecord["title"] ? $therecord["title"] : "General Table Import"; $phpbms->cssIncludes[] = "pages/imports.css"; $phpbms->jsIncludes[] = "modules/bms/javascript/clients_import.js"; // We need to define them here in the head // so that any necessay javascript is loaded appropriately. //Form Elements //============================================================== // Create the form $theform = new importForm(); $theform->enctype = "multipart/form-data"; //if you need to set specific form vaiables (like enctype, or extra onsubmit // you can set those form properties here. // for each field we will use, create the field object and add it to // the forms list. $list = array("phpBMS csv file" => 0, "Sugar CRM (v5.5.0)" => 1); $default = 0; if (isset($_POST["importType"])) { $default = (int) $_POST["importType"]; } $theinput = new inputBasicList("importType", $default, $list, "File Type"); $theform->addField($theinput); // lastly, use the jsMerge method to create the final Javascript formatting $theform->jsMerge(); //==============================================================
} //Next we process the form (if submitted) and // return the current record as an array ($therecord) // or if this is a new record, it returns the defaults $therecord = $import->processImportPage(); //make sure that we set the status message id the processing returned one // (e.g. "Record Updated") if (isset($therecord["phpbmsStatus"])) { $statusmessage = $therecord["phpbmsStatus"]; } $pageTitle = $therecord["title"] ? $therecord["title"] : "General Table Import"; $phpbms->cssIncludes[] = "pages/imports.css"; //Form Elements //============================================================== // Create the form $theform = new importForm(); $theform->enctype = "multipart/form-data"; // lastly, use the jsMerge method to create the final Javascript formatting $theform->jsMerge(); //============================================================== //End Form Elements include "header.php"; ?> <div class="bodyline"> <!-- Next we start the form. This also prints the H1 with title, and top save,cancel buttons If you need to have other buttons, or need a specific top, you will need to create your form manually. --> <?php $theform->startForm($pageTitle, $import->pageType, count($import->transactionRecords)); ?>