當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DmQuery::connect方法代碼示例

本文整理匯總了PHP中DmQuery::connect方法的典型用法代碼示例。如果您正苦於以下問題:PHP DmQuery::connect方法的具體用法?PHP DmQuery::connect怎麽用?PHP DmQuery::connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DmQuery的用法示例。


在下文中一共展示了DmQuery::connect方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: form_biblio_material_types

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;
}
開發者ID:Giordano-Bruno,項目名稱:GiordanoBruno,代碼行數:26,代碼來源:forms.php

示例2: header

$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();
$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 
開發者ID:AevumDecessus,項目名稱:docker-openbiblio,代碼行數:31,代碼來源:mbr_classify_new.php

示例3: dmSelect

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);
}
開發者ID:vishnu35,項目名稱:opencitylibrary,代碼行數:23,代碼來源:inputFuncs.php

示例4: dmSelect

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);
}
開發者ID:uniedpa,項目名稱:espabiblio,代碼行數:32,代碼來源:inputFuncs.php


注:本文中的DmQuery::connect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。