예제 #1
0
파일: DmQuery.php 프로젝트: aimakun/odlib
 function _mkObj($array)
 {
     $dm = new Dm();
     $dm->setCode($array["code"]);
     $dm->setDescription($array["description"]);
     $dm->setDefaultFlg($array["default_flg"]);
     if ($this->_tableNm == "collection_dm") {
         $dm->setDaysDueBack($array["days_due_back"]);
         $dm->setDailyLateFee($array["daily_late_fee"]);
     }
     if (isset($array['checkout_limit'])) {
         $dm->setCheckoutLimit($array["checkout_limit"]);
     }
     if (isset($array['renewal_limit'])) {
         $dm->setRenewalLimit($array["renewal_limit"]);
     }
     if (isset($array["image_file"])) {
         $dm->setImageFile($array["image_file"]);
     }
     if (isset($array["max_fines"])) {
         $dm->setMaxFines($array["max_fines"]);
     }
     if (isset($array["row_count"])) {
         $dm->setCount($array["row_count"]);
     }
     return $dm;
 }
예제 #2
0
    $pageErrors['code'] = 'Code must contain only alphanumerics and underscores.';
}
if (!isset($_POST['description']) or !$_POST['description']) {
    $pageErrors['description'] = 'This is a required field.';
}
if (!empty($pageErrors)) {
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/member_fields_new_form.php");
    exit;
}
#**************************************************************************
#*  Insert new domain table row
#**************************************************************************
$dm = new Dm();
$dm->setCode($_POST["code"]);
$dm->setDescription($_POST["description"]);
$dmQ = new DmQuery();
$dmQ->connect();
$dmQ->insert("member_fields_dm", $dm);
$dmQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
echo $loc->getText("Member field, %desc%, has been added.", array('desc' => $dm->getDescription()));