function executeSqlFile(&$installQ, $filename, $tablePrfx = "")
{
    $fp = fopen($filename, "r");
    # show error if file could not be opened
    if ($fp == false) {
        echo "Error reading file " . H($filename) . ".<br>\n";
        return false;
    } else {
        $sqlStmt = "";
        while (!feof($fp)) {
            $char = fgetc($fp);
            if ($char == ";") {
                //replace table prefix
                $sql = str_replace("%prfx%", $tablePrfx, $sqlStmt);
                echo "lara";
                echo "process sql [" . $sqlStmt . "]<br>";
                //test
                $result = $installQ->exec($sql);
                if ($installQ->errorOccurred()) {
                    $installQ->close();
                    displayErrorPage($installQ);
                    fclose($fp);
                    return false;
                }
                $sqlStmt = "";
            } else {
                $sqlStmt = $sqlStmt . $char;
            }
        }
        fclose($fp);
        return true;
    }
}
function getTagDesc($tag, $subfldCd, &$tagDesc, &$subfldDesc, &$ind1Desc, &$ind2Desc)
{
    $tagDesc = "";
    $subfldDesc = "";
    $ind1Desc = "";
    $ind2Desc = "";
    if ($tag != "") {
        $marcTagDmQ = new UsmarcTagDmQuery();
        $marcTagDmQ->connect();
        if ($marcTagDmQ->errorOccurred()) {
            $marcTagDmQ->close();
            displayErrorPage($marcTagDmQ);
        }
        $marcTag = $marcTagDmQ->doQuery($tag);
        if ($marcTagDmQ->errorOccurred()) {
            $marcTagDmQ->close();
            displayErrorPage($marcTagDmQ);
        }
        $marcTagDmQ->close();
        if ($marcTag) {
            $tagDesc = $marcTag->getDescription();
            $ind1Desc = $marcTag->getInd1Description();
            $ind2Desc = $marcTag->getInd2Description();
            # reading for subfield description
            $marcSubfldDmQ = new UsmarcSubfieldDmQuery();
            $marcSubfldDmQ->connect();
            if ($marcSubfldDmQ->errorOccurred()) {
                $marcSubfldDmQ->close();
                displayErrorPage($marcSubfldDmQ);
            }
            $marcSubfld = $marcSubfldDmQ->doQuery($tag, $subfldCd);
            if ($marcSubfldDmQ->errorOccurred()) {
                $marcSubfldDmQ->close();
                displayErrorPage($marcSubfldDmQ);
            }
            $marcSubfldDmQ->close();
            if (!$marcSubfld) {
                $subfldDesc = "";
            } else {
                $subfldDesc = $marcSubfld->getDescription();
            }
        }
    }
    return true;
}
Esempio n. 3
0
function getCutter($aName)
{
    ##### implementation of Cutter - Sanborn 3-digit table
    //echo "cutter input string: " . $aName . "<br />";
    ## remove spaces from text before comparrison to table entries
    $aName = str_replace(" ", "", $aName);
    ## what follows, while simpler only works with mySQL ver 4.1 and later
    //	$ctrQ = new ctrQuery();
    // 	$ctrQ->connect();
    //  if ($ctrQ->errorOccurred()) {
    //    $ctrQ->close();
    //    displayErrorPage($ctrQ);
    //  }
    //
    //  $ctrQ->execSelect($aName);
    //  $result = $ctrQ->fetchfield('theNmbr');
    //  $ctrQ->close();
    //	return substr($aName,0,1) . $result;
    ## this more complex process works all the time.
    $ctrQ = new ctrQuery();
    $ctrQ->connect();
    if ($ctrQ->errorOccurred()) {
        $ctrQ->close();
        displayErrorPage($ctrQ);
    }
    $rslt1 = $ctrQ->getNmbrPt1($aName);
    $ctrQ->close();
    $ctrQ = new ctrQuery();
    $ctrQ->connect();
    if ($ctrQ->errorOccurred()) {
        $ctrQ->close();
        displayErrorPage($ctrQ);
    }
    $rslt2 = $ctrQ->getNmbrPt2($rslt1);
    $ctrQ->close();
    return substr($aName, 0, 1) . $rslt2;
}
$set = $setQ->fetchRow();
$setQ->close();
/****************************************************************************
 * Reading theme settings
 ****************************************************************************
 */
$themeQ = new ThemeQuery();
$themeQ->connect();
if ($themeQ->errorOccurred()) {
    $themeQ->close();
    displayErrorPage($themeQ);
}
$themeQ->execSelect($set->getThemeid());
if ($themeQ->errorOccurred()) {
    $themeQ->close();
    displayErrorPage($themeQ);
}
$theme = $themeQ->fetchTheme();
$themeQ->close();
/****************************************************************************
 * general settings constants
 ****************************************************************************
 */
define("OBIB_LIBRARY_NAME", $set->getLibraryName());
define("OBIB_LIBRARY_HOURS", $set->getLibraryHours());
define("OBIB_LIBRARY_PHONE", $set->getLibraryPhone());
define("OBIB_LIBRARY_URL", $set->getLibraryUrl());
define("OBIB_OPAC_URL", $set->getOpacUrl());
define("OBIB_SESSION_TIMEOUT", $set->getSessionTimeout());
define("OBIB_ITEMS_PER_PAGE", $set->getItemsPerPage());
define("OBIB_DB_VERSION", $set->getVersion());
function getOpts()
{
    global $postVars;
    global $useYAZ, $useSRU;
    global $noise_words;
    unset($_SESSION["postVars"]);
    unset($_SESSION["pageErrors"]);
    $optQ = new LookupOptsQuery();
    $optQ->connect();
    if ($optQ->errorOccurred()) {
        $optQ->close();
        displayErrorPage($optQ);
    }
    $optQ->execSelect();
    if ($optQ->errorOccurred()) {
        $optQ->close();
        displayErrorPage($optQ);
    }
    $opt = $optQ->fetchRow();
    $postVars["protocol"] = $opt->getProtocol();
    $postVars["maxHits"] = $opt->getMaxHits();
    $postVars["keepDashes"] = $opt->getKeepDashes();
    $postVars["callNmbrType"] = $opt->getCallNmbrtype();
    $postVars["autoDewey"] = $opt->getAutoDewey();
    $postVars["defaultDewey"] = $opt->getDefaultDewey();
    $postVars["autoCutter"] = $opt->getAutoCutter();
    $postVars["cutterType"] = $opt->getCutterType();
    $postVars["cutterWord"] = $opt->getCutterWord();
    $postVars["autoCollect"] = $opt->getAutoCollect();
    $postVars["fictionName"] = $opt->getFictionName();
    $postVars["fictionCode"] = $opt->getFictioncode();
    $postVars["fictionLoC"] = $opt->getFictionLoC();
    $postVars["fictionDew"] = $opt->getFictionDew();
    ## not yet in database or user opts screens, but should be!!!!
    $postVars["timeout"] = 60;
    $postVars["noiseWords"] = 'a an and for of the this those';
    //print_r($postVars);
    $optQ->close();
}
Esempio n. 6
0
?>
    </th>
  </tr>
<?php 
#****************************************************************************
#*  Search database for BiblioHold data
#****************************************************************************
$holdQ = new BiblioHoldQuery();
$holdQ->connect();
if ($holdQ->errorOccurred()) {
    $holdQ->close();
    displayErrorPage($holdQ);
}
if (!$holdQ->queryByMbrid($mbrid)) {
    $holdQ->close();
    displayErrorPage($holdQ);
}
if ($holdQ->getRowCount() == 0) {
    ?>
  <tr>
    <td class="primary" align="center" colspan="8">
      <?php 
    echo $loc->getText("mbrViewNoHolds");
    ?>
    </td>
  </tr>
<?php 
} else {
    while ($hold = $holdQ->fetchRow()) {
        ?>
  <tr>
function getHosts($mode)
{
    global $postVars;
    $hostQ = new LookupHostQuery();
    $hostQ->connect();
    if ($hostQ->errorOccurred()) {
        $hostQ->close();
        displayErrorPage($hostQ);
    }
    if ($mode == 'all') {
        $hostQ->execSelectAll();
    } else {
        $hostQ->execSelect();
    }
    if ($hostQ->errorOccurred()) {
        $hostQ->close();
        displayErrorPage($hostQ);
    }
    $n = 0;
    $hosts = array();
    while ($row = $hostQ->fetchRow()) {
        $hosts[$n]['id'] = $row->getId();
        $hosts[$n]['seq'] = $row->getSeq();
        $hosts[$n]['active'] = $row->getActive();
        $hosts[$n]['host'] = $row->getHost();
        $hosts[$n]['name'] = $row->getName();
        $hosts[$n]['db'] = $row->getDb();
        $hosts[$n]['user'] = $row->getUser();
        $hosts[$n]['pw'] = $row->getPw();
        $hosts[$n]['context'] = $row->getCntxt();
        $hosts[$n]['schema'] = $row->getSchma();
        $n++;
    }
    $postVars['hosts'] = $hosts;
    $postVars['numHosts'] = $n;
    $hostQ->close();
}
Esempio n. 8
0
 }
 if (!isset($_SESSION["token"]) or $_SESSION["token"] == "") {
     header("Location: ../shared/loginform.php");
     exit;
 }
 #****************************************************************************
 #*  Checking session table to see if session_id has timed out
 #****************************************************************************
 $sessQ = new SessionQuery();
 $sessQ->connect();
 if ($sessQ->errorOccurred()) {
     displayErrorPage($sessQ);
 }
 if (!$sessQ->validToken($_SESSION["userid"], $_SESSION["token"])) {
     if ($sessQ->errorOccurred()) {
         displayErrorPage($sessQ);
     }
     $sessQ->close();
     header("Location: ../shared/loginform.php?RET=" . U($returnPage));
     exit;
 }
 $sessQ->close();
 #****************************************************************************
 #*  Checking authorization for this tab
 #*  The session authorization flags were set at login in login.php
 #****************************************************************************
 if ($tab == "circulation") {
     if (!$_SESSION["hasCircAuth"]) {
         header("Location: ../circ/noauth.php");
         exit;
     } elseif (isset($restrictToMbrAuth) and !$_SESSION["hasCircMbrAuth"]) {
Esempio n. 9
0
 function __invoke($smarty)
 {
     displayErrorPage($smarty, $this);
 }
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../user/user_pwd_reset_form.php");
    exit;
}
#**************************************************************************
#*  Update staff member
#**************************************************************************
$memberQ = new MemberQuery();
$memberQ->connect();
if ($memberQ->errorOccurred()) {
    $memberQ->close();
    displayErrorPage($memberQ);
}
if (!$memberQ->resetPassUser($member)) {
    $memberQ->close();
    displayErrorPage($memberQ);
}
$memberQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../opac/header_opac.php";
echo $loc->getText("adminStaff_pass_user_reset_Passwordreset");
?>
<br><br>
<a href="../user/user_view.php"><?php 
Esempio n. 11
0
            displayErrorPage($errorMessage, $longErrorMessage);
        }
        // Hauptinhalt ermitteln
        if (isset($_GET[SITE_PARAM])) {
            // Bestimmen des include-Files anhand des GET-Parameters SITE_PARAM
            $param = $_GET[SITE_PARAM];
            $paramFile = getParamFile($param);
            // Prüfung, ob der Site-Parameter zulässig ist
            if ($paramFile !== false) {
                $includeFile = $paramFile;
            }
        } else {
            $includeFile = 'map.php';
        }
    }
}
// Einbinden + Prüfen ob Einbinden erfolgreich
if ((include $includeFile) === false) {
    $errorMessage = 'Öffnen der Include-Datei fehlgeschlagen';
    $longErrorMessage = 'Datei Include-Datei ' . $includeFile . ' konnte nicht nicht gefunden werden (' . __FILE__ . ').';
    displayErrorPage($errorMessage, $longErrorMessage);
}
// Prüfen ob Request über Ajax läuft und template umschalten
if (isset($_GET['ajax'])) {
    $template->setTemplate('ajax_index.html');
    if ($user == null) {
        $template->viewMacro = 'ajaxNotLoggedIn';
    } else {
        $template->viewMacro = 'ajaxStandard';
    }
}
Esempio n. 12
0
 function autoInactive()
 {
     $setQ = new SettingsQuery();
     $setQ->connect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $setQ->execSelect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $set = $setQ->fetchRow();
     $inactiveMemberAfterDays = 0 + $set->getInactiveMemberAfterDays();
     if ($inactiveMemberAfterDays > 0) {
         $sql = $this->mkSQL("UPDATE member SET is_active = 'N' WHERE last_activity_dt <= DATE_SUB(NOW(), INTERVAL %N DAY) ", $inactiveMemberAfterDays);
         $this->exec($sql);
     }
 }
function insertCopy()
{
    global $copyQ, $copy;
    if (!$copyQ->insert($copy)) {
        $copyQ->close();
        if ($copyQ->getDbErrno() == "") {
            $pageErrors["barcodeNmbr"] = $copyQ->getError();
            $_SESSION["postVars"] = $_POST;
            $_SESSION["pageErrors"] = $pageErrors;
            header("Location: ../catalog/biblio_copy_new_form.php?bibid=" . U($bibid));
            exit;
        } else {
            displayErrorPage($copyQ);
        }
    }
}
Esempio n. 14
0
<?php

/*+**********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ************************************************************************************/
function displayErrorPage($request)
{
    ?>
	<h1>Workflow engine error</h1>
	<?php 
    echo "It appears that you have entered an invalid value.";
    ?>
	<?php 
}
displayErrorPage($_REQUEST);
        Fatal::internalError('no fieldid set');
    }
    $fieldid = $_GET["fieldid"];
    #****************************************************************************
    #*  Reading database for subfield values
    #****************************************************************************
    $fieldQ = new BiblioFieldQuery();
    $fieldQ->connect();
    if ($fieldQ->errorOccurred()) {
        $fieldQ->close();
        displayErrorPage($fieldQ);
    }
    $field = $fieldQ->doQuery($bibid, $fieldid);
    if ($fieldQ->errorOccurred()) {
        $fieldQ->close();
        displayErrorPage($fieldQ);
    }
    $fieldQ->close();
    $postVars["bibid"] = $bibid;
    $postVars["fieldid"] = $bibid;
    $postVars["tag"] = $field->getTag();
    $postVars["ind1Cd"] = $field->getInd1Cd();
    $postVars["ind2Cd"] = $field->getInd2Cd();
    $postVars["subfieldCd"] = $field->getSubfieldCd();
    $postVars["fieldData"] = $field->getFieldData();
    $selectedTag = $field->getTag();
    $selectedSubfld = $field->getSubfieldCd();
} else {
    $postVars = $_SESSION['postVars'];
    if (isset($_SESSION['pageErrors'])) {
        $pageErrors = $_SESSION['pageErrors'];
Esempio n. 16
0
 /**
  * Save PHPExcel to file
  *
  * @param 	string 		$pFileName
  * @throws 	Exception
  */
 public function save($pFilename = null, $title = '')
 {
     // garbage collect
     $this->_phpExcel->garbageCollect();
     $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
     PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
     // Open file
     $fileHandle = fopen($pFilename, 'w');
     if ($fileHandle === false) {
         throw new Exception("Could not open file {$pFilename} for writing.");
     }
     // Set PDF
     $this->_isPdf = true;
     // Build CSS
     $this->buildCSS(true);
     // Generate HTML
     $html = '';
     //$html .= $this->generateHTMLHeader(false);
     if (!empty($title)) {
         $html .= '<h1 align="center">' . $title . '</h1>';
     }
     $html .= $this->generateSheetData();
     //$html .= $this->generateHTMLFooter();
     // Default PDF paper size
     $paperSize = 'LETTER';
     //	Letter	(8.5 in. by 11 in.)
     // Check for paper size and page orientation
     if (is_null($this->getSheetIndex())) {
         $orientation = $this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
         $printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
     } else {
         $orientation = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
         $printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
     }
     //	Override Page Orientation
     if (!is_null($this->_orientation)) {
         $orientation = $this->_orientation == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE ? 'L' : 'P';
     }
     //	Override Paper Size
     if (!is_null($this->_paperSize)) {
         $printPaperSize = $this->_paperSize;
     }
     if (isset(self::$_paperSizes[$printPaperSize])) {
         $paperSize = self::$_paperSizes[$printPaperSize];
     }
     // Create PDF
     $pdf = new TCPDF($orientation, 'pt', $paperSize);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->AddPage();
     // Set the appropriate font
     require_once "../classes/Settings.php";
     require_once "../classes/SettingsQuery.php";
     $setQ = new SettingsQuery();
     $setQ->connect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $setQ->execSelect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $set = $setQ->fetchRow();
     $pdf->setFont($set->getFontNormal(), '', $set->getFontSize());
     //$pdf->SetFont($this->_font);
     $pdf->writeHTML($html);
     // Document info
     $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
     $pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
     $pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
     $pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
     $pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
     // Write to file
     fwrite($fileHandle, $pdf->output($pFilename, 'S'));
     // Close file
     fclose($fileHandle);
     PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
 }
Esempio n. 17
0
<?php

/**
 * Bottomfile für Index
 * macht abschliessende Arbeiten wie die Ausgabe des Templates,
 * Daten zurückschreiben, Session abschliessen und Loggen
 */
// Template ausgeben und mögliche Fehler behandeln
$template->scriptContent = $javascriptContent;
try {
    echo $template->execute();
} catch (Exception $e) {
    $errorMessage = 'Das Template generierte einen Fehler.';
    displayErrorPage($errorMessage, (string) $e);
}
ob_flush();
// Template senden
// Benutzerdaten speichern
if (World_Base::$USER != null) {
    World_Base::$USER->saveData();
    World_Base::$USER->unloadModule('all');
    World_Base::$SESSION->set('userData', serialize(World_Base::$USER));
}
// Sessiondaten speichern
World_Base::$SESSION->saveData();
// Fehler loggen
Error::logErrors(World_Base::$LOG, true);
Esempio n. 18
0
#  $biblioQ = new BiblioQuery();
$biblioSearchQ->setItemsPerPage(OBIB_ITEMS_PER_PAGE);
$biblioSearchQ->connect();
if ($biblioSearchQ->errorOccurred()) {
    $biblioSearchQ->close();
    displayErrorPage($biblioSearchQ);
}
# checking to see if we are in the opac search or logged in
if ($tab == "opac") {
    $opacFlg = true;
} else {
    $opacFlg = false;
}
if (!$biblioSearchQ->search2($sType, $materialCd, $collectionCd, $words, $currentPageNmbr, $sortBy, $opacFlg)) {
    $biblioSearchQ->close();
    displayErrorPage($biblioSearchQ);
}
#****************************************************************************
#*  Search database for more details
#****************************************************************************
#$biblioQ = new BiblioQuery();
#$biblioQ->connect();
#if ($biblioQ->errorOccurred()) {
#  $biblioQ->close();
#  displayErrorPage($biblioQ);
#}
#if (!$biblio = $biblioQ->doQuery($bibid)) {
#  $biblioQ->close();
#  displayErrorPage($biblioQ);
#}
#$biblioFlds = $biblio->getBiblioFields();
$biblioQ = new BiblioSearchQuery();
$biblioQ->setItemsPerPage(OBIB_ITEMS_PER_PAGE);
$biblioQ->connect();
if ($biblioQ->errorOccurred()) {
    $biblioQ->close();
    displayErrorPage($biblioQ);
}
# checking to see if we are in the opac search or logged in
if ($tab == "opac") {
    $opacFlg = true;
} else {
    $opacFlg = false;
}
if (!$biblioQ->search($sType, $words, $currentPageNmbr, $sortBy, $collecs, $materials, $opacFlg)) {
    $biblioQ->close();
    displayErrorPage($biblioQ);
}
# Redirect to biblio_view if only one result
if ($biblioQ->getRowCount() == 1) {
    $biblio = $biblioQ->fetchRow();
    header('Location: ../shared/biblio_view.php?bibid=' . U($biblio->getBibid()) . '&tab=' . U($tab));
    exit;
}
#**************************************************************************
#*  Show search results
#**************************************************************************
if ($tab == "opac") {
    require_once "../shared/header_opac.php";
} else {
    require_once "../shared/header.php";
}
        echo '<th>' . $loc->getText("MarcUploadData") . '</th>';
        echo '</tr>';
        foreach ($biblio->getBiblioFields() as $field) {
            echo '<tr><td>' . H($field->getTag()) . '</td>';
            echo '<td>' . H($field->getSubfieldCd()) . '</td>';
            echo '<td>' . H($field->getFieldData()) . '</td></tr>';
        }
        echo '</table>';
    }
    echo '<hr /><h3>' . $loc->getText("MarcUploadRawData") . '</h3>';
    echo '<pre>';
    readfile($_FILES["usmarc_data"]["tmp_name"]);
    echo '</pre>';
} else {
    $bq = new BiblioQuery();
    $bq->connect();
    if ($bq->errorOccurred()) {
        $bq->close();
        displayErrorPage($bq);
    }
    foreach ($biblios as $biblio) {
        if (!$bq->insert($biblio)) {
            $bq->close();
            displayErrorPage($bq);
        }
    }
    $bq->close();
    echo $loc->getText("MarcUploadRecordsUploaded");
    echo ": " . H(count($biblios));
}
include "../shared/footer.php";
Esempio n. 21
0
    $tab = "circulation";
    $nav = "view";
    $returnNav = "../circ/mbr_view.php?mbrid=" . U($mbrid);
}
$restrictInDemo = TRUE;
require_once "../shared/logincheck.php";
require_once "../classes/BiblioHoldQuery.php";
require_once "../functions/errorFuncs.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, "shared");
#**************************************************************************
#*  Delete hold
#**************************************************************************
// we need to also insert into status history table
$holdQ = new BiblioHoldQuery();
$holdQ->connect();
if ($holdQ->errorOccurred()) {
    $holdQ->close();
    displayErrorPage($holdQ);
}
$rc = $holdQ->delete($bibid, $copyid, $holdid);
if (!$rc) {
    $holdQ->close();
    displayErrorPage($copyQ);
}
$holdQ->close();
#**************************************************************************
#*  Go back to member view
#**************************************************************************
$msg = $loc->getText("holdDelSuccess");
header("Location: " . $returnNav . "&msg=" . U($msg));
Esempio n. 22
0
$biblioStatusDm = $dmQ->getAssoc("biblio_status_dm");
$materialTypeDm = $dmQ->getAssoc("material_type_dm");
$materialImageFiles = $dmQ->getAssoc("material_type_dm", "image_file");
$dmQ->close();
#****************************************************************************
#*  Search database for member history
#****************************************************************************
$histQ = new BiblioStatusHistQuery();
$histQ->connect();
if ($histQ->errorOccurred()) {
    $histQ->close();
    displayErrorPage($histQ);
}
if (!$histQ->queryByMbrid($mbrid)) {
    $histQ->close();
    displayErrorPage($histQ);
}
#**************************************************************************
#*  Show biblio checkout history
#**************************************************************************
require_once "../shared/header.php";
?>

<h1><?php 
echo $loc->getText("mbrHistoryHead1");
?>
</h1>
<table class="primary">
  <tr>
    <th valign="top" nowrap="yes" align="left">
      <?php 
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/staff_pwd_reset_form.php");
    exit;
}
#**************************************************************************
#*  Update staff member
#**************************************************************************
$staffQ = new StaffQuery();
$staffQ->connect();
if ($staffQ->errorOccurred()) {
    $staffQ->close();
    displayErrorPage($staffQ);
}
if (!$staffQ->resetPwd($staff)) {
    $staffQ->close();
    displayErrorPage($staffQ);
}
$staffQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
echo $loc->getText("adminStaff_pwd_reset_Passwordreset");
?>
<br><br>
<a href="../admin/staff_list.php"><?php 
     $trans = new MemberAccountTransaction();
     $trans->setMbrid($saveMbrid);
     $trans->setCreateUserid($_SESSION["userid"]);
     $trans->setTransactionTypeCd("+c");
     $trans->setAmount($fee);
     $trans->setDescription($loc->getText("shelvingCartTrans", array("barcode" => $barcode)));
     $transQ = new MemberAccountQuery();
     $transQ->connect();
     if ($transQ->errorOccurred()) {
         $transQ->close();
         displayErrorPage($transQ);
     }
     $trans = $transQ->insert($trans);
     if ($transQ->errorOccurred()) {
         $transQ->close();
         displayErrorPage($transQ);
     }
     // Set fee message
     if (OBIB_LOCALE == 'th') {
         $balText = number_format($fee, 2) . ' บาท';
     } else {
         $balText = moneyFormat($fee, 2);
     }
     $_SESSION['feeMsg'] = "<font class=\"error\">" . $loc->getText("mbrViewBalMsg2", array("fee" => $balText)) . " <a href=\"../circ/mbr_account.php?mbrid=" . $saveMbrid . "&reset=Y\">" . $loc->getText('mbrAccountLink') . "</a></font><br><br>";
     $transQ->close();
 }
 // Update activity
 $mbrQ = new MemberQuery();
 $mbrQ->connect();
 $mbrQ->updateActivity($saveMbrid);
 $mbrQ->close();
Esempio n. 25
0
function insertBiblio($biblio)
{
    require_once "../classes/BiblioQuery.php";
    $biblioQ = new BiblioQuery();
    $biblioQ->connect();
    if ($biblioQ->errorOccurred()) {
        $biblioQ->close();
        displayErrorPage($biblioQ);
    }
    $bibid = $biblioQ->insert($biblio);
    if (!$bibid) {
        $biblioQ->close();
        displayErrorPage($biblioQ);
    }
    $biblioQ->close();
    return $bibid;
}
Esempio n. 26
0
function updateBiblio($biblio)
{
    require_once "../classes/BiblioQuery.php";
    $biblioQ = new BiblioQuery();
    $biblioQ->connect();
    if ($biblioQ->errorOccurred()) {
        $biblioQ->close();
        displayErrorPage($biblioQ);
    }
    if (!$biblioQ->update($biblio)) {
        $biblioQ->close();
        displayErrorPage($biblioQ);
    }
    $biblioQ->close();
}
Esempio n. 27
0
    header("Location: ../shared/suspended.php");
    exit;
}
#**************************************************************************
#*  Insert new session row with random token
#**************************************************************************
$sessionQ = new SessionQuery();
$sessionQ->connect();
if ($sessionQ->errorOccurred()) {
    $sessionQ->close();
    displayErrorPage($sessionQ);
}
$token = $sessionQ->getToken($staff->getUserid());
if ($token == false) {
    $sessionQ->close();
    displayErrorPage($sessionQ);
}
$sessionQ->close();
#**************************************************************************
#*  Destroy form values and errors and reset signon variables
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
$_SESSION["username"] = $staff->getUsername();
$_SESSION["userid"] = $staff->getUserid();
$_SESSION["token"] = $token;
$_SESSION["loginAttempts"] = 0;
$_SESSION["hasAdminAuth"] = $staff->hasAdminAuth();
$_SESSION["hasCircAuth"] = $staff->hasCircAuth();
$_SESSION["hasCircMbrAuth"] = $staff->hasCircMbrAuth();
$_SESSION["hasCatalogAuth"] = $staff->hasCatalogAuth();
if ($marcTagDmQ->errorOccurred()) {
    $marcTagDmQ->close();
    displayErrorPage($marcTagDmQ);
}
$marcTags = $marcTagDmQ->fetchRows();
$marcTagDmQ->close();
$marcSubfldDmQ = new UsmarcSubfieldDmQuery();
$marcSubfldDmQ->connect();
if ($marcSubfldDmQ->errorOccurred()) {
    $marcSubfldDmQ->close();
    displayErrorPage($marcSubfldDmQ);
}
$marcSubfldDmQ->execSelect();
if ($marcSubfldDmQ->errorOccurred()) {
    $marcSubfldDmQ->close();
    displayErrorPage($marcSubfldDmQ);
}
$marcSubflds = $marcSubfldDmQ->fetchRows();
$marcSubfldDmQ->close();
?>

<h1><?php 
echo $loc->getText('CSVloadHeader');
?>
</h1>

<?php 
echo $loc->getText('CSVUpdateContinue');
?>
</br>
</br>
Esempio n. 29
0
$_POST["aws"] = $set->getAWSAccountId();
if (!$set->validateData()) {
    //$pageErrors["sessionTimeout"] = $set->getSessionTimeoutError();
    //$pageErrors["itemsPerPage"] = $set->getItemsPerPageError();
    //$pageErrors["purgeHistoryAfterMonths"] = $set->getPurgeHistoryAfterMonthsError();
    $_SESSION["postVars"] = $_POST;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../admin/lookup_edit_form.php");
    exit;
}
#**************************************************************************
#*  Update domain table row
#**************************************************************************
$setQ = new LookupQuery();
$setQ->connect();
if ($setQ->errorOccurred()) {
    $setQ->close();
    displayErrorPage($setQ);
}
if (!$setQ->update($set)) {
    $setQ->close();
    displayErrorPage($setQ);
}
$setQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
header("Location: ../admin/lookup_edit_form.php?reset=Y&updated=Y");
exit;
 function output($html, $title = 'document', $pFilename = 'doc.pdf')
 {
     require_once '../classes/PHPExcel/Shared/PDF/tcpdf.php';
     require_once "../classes/Settings.php";
     require_once "../classes/SettingsQuery.php";
     // Create PDF
     $pdf = new TCPDF('P', 'pt', 'A4');
     $pdf->SetMargins(56.7, 56.7);
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     $pdf->setTitle($title);
     $pdf->AddPage();
     // Set the appropriate font
     $setQ = new SettingsQuery();
     $setQ->connect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $setQ->execSelect();
     if ($setQ->errorOccurred()) {
         $setQ->close();
         displayErrorPage($setQ);
     }
     $set = $setQ->fetchRow();
     $pdf->setFont($set->getFontNormal());
     $pdf->writeHTML($html);
     $pdf->SetTitle($title);
     return $pdf->output($pFilename, 'S');
 }