Ejemplo n.º 1
0
 function _mkObj($array)
 {
     $mf = new Mf();
     $mf->setMbrid($array["mbrid"]);
     $mf->setCode($array["code"]);
     $mf->setData($array["data"]);
     /*
     if ($this->_tableNm == "collection_dm") {
       $mf->setDaysDueBack($array["days_due_back"]);
       $mf->setDailyLateFee($array["daily_late_fee"]);
     }
     
     if (isset($array['checkout_limit'])) {
       $mf->setCheckoutLimit($array["checkout_limit"]);
     }
     if (isset($array['renewal_limit'])) {
       $mf->setRenewalLimit($array["renewal_limit"]);
     }
     if (isset($array["image_file"])) {
       $mf->setImageFile($array["image_file"]);
     }
     if (isset($array["max_fines"])) {
       $mf->setMaxFines($array["max_fines"]);
     }
     if (isset($array["row_count"])) {
       $mf->setCount($array["row_count"]);
     }
     */
     return $mf;
 }
Ejemplo n.º 2
0
<?php

require_once './Mf.php';
define('APP_DIR', './app');
define('MF_ENV', 'dev');
Mf::init();
// Include your Doctrine configuration/setup here, your connections, models, etc.
// Configure Doctrine Cli
// Normally these are arguments to the cli tasks but if they are set here the arguments will be auto-filled and are not required for you to enter them.
$config = array('data_fixtures_path' => '/path/to/data/fixtures', 'models_path' => APP_DIR . DS . 'models', 'migrations_path' => ROOT_DIR . DS . 'data' . DS . 'migrations', 'sql_path' => ROOT_DIR . DS . 'data' . DS . 'sql', 'yaml_schema_path' => ROOT_DIR . DS . 'data');
$cli = new Doctrine_Cli($config);
$cli->run($_SERVER['argv']);
if (!isset($_POST['code']) or !$_POST['code']) {
    $pageErrors['code'] = 'This is a required field.';
}
if (!isset($_POST['data']) or !$_POST['data']) {
    $pageErrors['data'] = '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
#**************************************************************************
$mf = new Mf();
$mf->setCode($_POST["code"]);
$mf->setData($_POST["data"]);
$mfQ = new MfQuery();
$mfQ->connect();
$mfQ->insert("member_fields", $mf);
$mfQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
require_once "../classes/MfQuery.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: ../admin/member_fields_list.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$mf = new Mf();
$mf->setMbrid($_POST["mbrid"]);
$_POST["mbrid"] = $mf->getMbrid();
$mf->setCode($_POST["code"]);
$_POST["code"] = $mf->getCode();
$mf->setData($_POST["data"]);
$_POST["data"] = $mf->getData();
if (!$mf->validateData()) {
    $pageErrors["data"] = $mf->getDataError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/member_fields_edit_form.php");
    exit;
}
#**************************************************************************
#*  Update domain table row
Ejemplo n.º 5
0
<?php

require_once "../Mf.php";
define('APP_DIR', ROOT_DIR . DS . 'app');
define('MF_ENV', 'dev');
// start process
Mf::dispatch();