예제 #1
0
require_once "../classes/DmQuery.php";
require_once "../functions/errorFuncs.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
#****************************************************************************
#*  Checking for post vars.  Go back to form if none found.
#****************************************************************************
if (count($_POST) == 0) {
    header("Location: ../circ/scl_new_form.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$scl = new School();
$scl->setSchoolCode($_POST["schoolCode"]);
$_POST["schoolCode"] = $scl->getSchoolCode();
$scl->setLastChangeUserid($_SESSION["userid"]);
$scl->setSchoolName($_POST["schoolName"]);
$_POST["schoolName"] = $scl->getSchoolName();
$scl->setSchoolAddress($_POST["schoolAddress"]);
$_POST["schoolAddress"] = $scl->getSchoolAddress();
$scl->setContactNumber($_POST["contactNumber"]);
$_POST["contactNumber"] = $scl->getContactNumber();
$scl->setcontactPerson($_POST["contactPerson"]);
$_POST["contactPerson"] = $scl->getContactPerson();
$scl->setEmail($_POST["email"]);
$_POST["email"] = $scl->getEmail();
$validData = $scl->validateData();
if (!$validData) {
    $pageErrors["schoolName"] = $scl->getSchoolNameError();
예제 #2
0
 function _mkObj($array)
 {
     $scl = new School();
     $scl->setSchoolid($array["schoolid"]);
     $scl->setLastChangeDt($array["last_change_dt"]);
     $scl->setLastChangeUserid($array["last_change_userid"]);
     $scl->setContactNumber($array["contact_number"]);
     $scl->setcontactPerson($array["contact_person"]);
     $scl->setSchoolAddress($array["school_address"]);
     $scl->setSchoolName($array["school_name"]);
     $scl->setSchoolCode($array["school_code"]);
     $scl->setEmail($array["email"]);
     return $scl;
 }