Exemplo n.º 1
0
function form_biblio_material_types($loc)
{
    $form = "";
    //    Played with printselect function
    if (isset($postVars['materialCd'])) {
        $materialCd = $postVars['materialCd'];
    } else {
        $materialCd = '';
    }
    $fieldname = "materialCd";
    $domainTable = "material_type_dm";
    $dmQ = new DmQuery();
    $dmQ->connect();
    $dms = $dmQ->get($domainTable);
    $dmQ->close();
    $form .= "<select id=\"materialCd\" name=\"materialCd\"";
    //    Needed OnChange event here.
    $form .= " onChange=\"matCdReload()\">\n";
    $form .= "<option value=\"\" selected>" . $loc->getText("any") . "</option>";
    foreach ($dms as $dm) {
        $form .= "<option value=\"" . H($dm->getCode()) . "\"";
        $form .= ">" . H($dm->getDescription()) . "</option>";
    }
    $form .= "</select>";
    return $form;
}
$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();
$dmQ->connect();
$dmQ->insert("mbr_classify_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("Classification type, %desc%, has been added.", array('desc' => $dm->getDescription()));
?>
<br><br>
<a href="../admin/mbr_classify_list.php"><?php 
echo $loc->getText("return to member classification list");
?>
Exemplo n.º 3
0
function dmSelect($table, $name, $value = "", $all = FALSE, $attrs = NULL)
{
    $dmQ = new DmQuery();
    $dmQ->connect();
    # Don't use getAssoc() so that we can set the default below
    $dms = $dmQ->get($table);
    $dmQ->close();
    $default = "";
    $options = array();
    if ($all) {
        $options['all'] = 'All';
    }
    foreach ($dms as $dm) {
        $options[$dm->getCode()] = $dm->getDescription();
        if ($dm->getDefaultFlg() == 'Y') {
            $default = $dm->getCode();
        }
    }
    if ($value == "") {
        $value = $default;
    }
    return inputField('select', $name, $value, $attrs, $options);
}
Exemplo n.º 4
0
function dmSelect($table, $name, $value = "", $all = FALSE, $attrs = NULL, $required = TRUE)
{
    $dmQ = new DmQuery();
    $dmQ->connect();
    # Don't use getAssoc() so that we can set the default below
    $dms = $dmQ->get($table);
    $dmQ->close();
    $default = "";
    $options = array();
    if ($all) {
        $options['all'] = 'All';
    }
    if (!$required) {
        // Add "Any" for the first option.
        $loc = new Localize(OBIB_LOCALE, "shared");
        $options[''] = $loc->getText("any");
    }
    foreach ($dms as $dm) {
        $options[$dm->getCode()] = $dm->getDescription();
        if ($dm->getDefaultFlg() == 'Y') {
            $default = $dm->getCode();
        }
    }
    if ($value == "") {
        $value = $default;
    }
    if (!$required) {
        // Selected on "Any" option.
        $value = "";
    }
    return inputField('select', $name, $value, $attrs, $options);
}
Exemplo n.º 5
0
 require_once "../classes/BiblioQuery.php";
 //  $loc = new Localize(OBIB_LOCALE,"shared");
 if (isset($_GET["msg"])) {
     $msg = "<font class=\"error\">" . H($_GET["msg"]) . "</font><br><br>";
 } else {
     $msg = "";
 }
 #****************************************************************************
 #*  Loading a few domain tables into associative arrays marc
 #****************************************************************************
 $LdmQ = new DmQuery();
 $LdmQ->connect();
 $collectionDm = $LdmQ->getAssoc("collection_dm");
 $LmaterialTypeDm = $LdmQ->getAssoc("material_type_dm");
 $LbiblioStatusDm = $LdmQ->getAssoc("biblio_status_dm");
 $LdmQ->close();
 $LmarcTagDmQ = new UsmarcTagDmQuery();
 $LmarcTagDmQ->connect();
 if ($LmarcTagDmQ->errorOccurred()) {
     $LmarcTagDmQ->close();
     displayErrorPage($LmarcTagDmQ);
 }
 $LmarcTagDmQ->execSelect();
 if ($LmarcTagDmQ->errorOccurred()) {
     $LmarcTagDmQ->close();
     displayErrorPage($marcTagDmQ);
 }
 $LmarcTags = $LmarcTagDmQ->fetchRows();
 $LmarcTagDmQ->close();
 $LmarcSubfldDmQ = new UsmarcSubfieldDmQuery();
 $LmarcSubfldDmQ->connect();