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;
 }
require_once "../classes/Dm.php";
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: ../admin/mbr_classify_new_form.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$dm = new Dm();
$dm->setDescription($_POST["description"]);
$_POST["description"] = $dm->getDescription();
$dm->setMaxFines($_POST["max_fines"]);
$_POST["max_fines"] = $dm->getMaxFines();
if (!$dm->validateData()) {
    $pageErrors["description"] = $dm->getDescriptionError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/mbr_classify_new_form.php");
    exit;
}
#**************************************************************************
#*  Insert new domain table row
#**************************************************************************
$dmQ = new DmQuery();
if (isset($_POST['code']) && preg_match('/[^A-Za-z0-9_]/', $_POST['code'])) {
    $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";
if (!isset($_POST['code']) or !$_POST['code']) {
    $pageErrors['code'] = 'This is a required field.';
}
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/copy_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("biblio_copy_fields_dm", $dm);
$dmQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
require_once "../classes/Dm.php";
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: ../admin/member_fields_list.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$dm = new Dm();
$dm->setCode($_POST["code"]);
$_POST["code"] = $dm->getCode();
$dm->setDescription($_POST["description"]);
$_POST["description"] = $dm->getDescription();
if (!$dm->validateData()) {
    $pageErrors["description"] = $dm->getDescriptionError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/member_fields_edit_form.php");
    exit;
}
#**************************************************************************
#*  Update domain table row
#**************************************************************************
$dmQ = new DmQuery();
require_once "../classes/Dm.php";
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: ../admin/materials_list.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$dm = new Dm();
$dm->setCode($_POST["code"]);
$_POST["code"] = $dm->getCode();
$dm->setDescription($_POST["description"]);
$_POST["description"] = $dm->getDescription();
$dm->setImageFile($_POST["imageFile"]);
$_POST["imageFile"] = $dm->getImageFile();
if (!$dm->validateData()) {
    $pageErrors["description"] = $dm->getDescriptionError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/materials_edit_form.php");
    exit;
}
#**************************************************************************
#*  Update domain table row
require_once "../classes/Dm.php";
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: ../admin/collections_list.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$dm = new Dm();
$dm->setCode($_POST["code"]);
$_POST["code"] = $dm->getCode();
$dm->setDescription($_POST["description"]);
$_POST["description"] = $dm->getDescription();
$dm->setDaysDueBack($_POST["daysDueBack"]);
$_POST["daysDueBack"] = $dm->getDaysDueBack();
$dm->setDailyLateFee($_POST["dailyLateFee"]);
$_POST["dailyLateFee"] = $dm->getDailyLateFee();
if (!$dm->validateData()) {
    $pageErrors["description"] = $dm->getDescriptionError();
    $pageErrors["daysDueBack"] = $dm->getDaysDueBackError();
    $pageErrors["dailyLateFee"] = $dm->getDailyLateFeeError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/collections_edit_form.php");
    $anz++;
}
//print "<br>vorher: ".$anz;
while (in_array($anz, $codeadd)) {
    //print "<br>".$anz." ist bereits enthalten";
    $anz++;
}
//print "<br>nachher: wird gesetzt: ".$anz;
if ($_POST["code"] == "") {
    $_POST["code"] = $anz;
}
//**********************************************
#****************************************************************************
#*  Validate data
#****************************************************************************
$dm = new Dm();
$dm->setDescription($_POST["description"]);
$_POST["description"] = $dm->getDescription();
$dm->setCode($_POST["code"]);
$_POST["code"] = $dm->getCode();
//print_r ($dm);
if (!$dm->validateData()) {
    $pageErrors["description"] = $dm->getDescriptionError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/matstat_new_form.php");
    exit;
}
#**************************************************************************
#*  Insert new domain table row
#**************************************************************************