예제 #1
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $dsn = generarDSNSistema('asteriskuser', 'asteriskcdrdb');
    $pDB = new paloDB($dsn);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case 'delete':
            $content = deleteRecord($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case 'download':
            $content = downloadFile($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "display_record":
            $content = display_record($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        default:
            $content = reportMonitoring($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
function extract_marc_fields($ar, $postit, $hit, $host)
{
    global $my_callNmbrType;
    $nl = "";
    reset($ar);
    $nHost = "host{$host}";
    $nHit = "hit{$hit}";
    $rslt = array();
    while (list($key, list($tagpath, $data)) = each($ar)) {
        if (preg_match("/^\\(3,([^)]*)\\)\\(3,([^)]*)\\)\$/", $tagpath, $res)) {
            if (!empty($theTag)) {
                $marcFlds["{$theTag}"] = $subFlds;
                // store previous data
            }
            $theTag = "{$res['1']}";
            $subFlds = array();
            //reset($subFlds);
        } elseif (preg_match("/^\\(3,([^)]*)\\)\\(3,([^)]*)\\)\\(3,([^)]*)\\)\$/", $tagpath, $res)) {
            $subFlds["{$res['3']}"] = "{$data}";
            $data = trim(htmlspecialchars($data));
            $fldId = $theTag . $res[3];
            // MAB (13Apr2008 - This is a hack to handle the author sometimes returned as 100a
            // and sometimes 700a and sometimes both
            // this assumes 100a is seen before 700a if both returned
            if ($fldId == '100a') {
                $fld100a = true;
            } elseif ($fldId == '700a' && !$fld100a) {
                $fldId = '100a';
            }
            if ($postit == false) {
                //echo "special for multi hit choice selection";
                $rsltStr = display_record($fldId, $data, $hit);
                //<<<<<<<<<<<<<<<<<
            } elseif ($postit == true) {
                //echo "normal processing";
                //					if (isset($_POST[$nHost][$nHit][$fldId])) $_POST[$nHost][$nHit][$fldId] .= '; ';
                if (isset($rslt[$fldId])) {
                    $rslt[$fldId] .= '; ';
                }
                switch ($theTag) {
                    case '538':
                        ##### Systems Details Note (R)
                        if ($res[3] == 'a') {
                            //							$_POST[$nHost][$nHit]['520a'] .= $data; ## Note (NR)
                            $rslt['520a'] .= $data;
                        }
                        ## Note (NR)
                        break;
                    case '650':
                        ##### Subject Added Entry - Topical Term (R)
                        if ($res[3] == 'a') {
                            if (isset($subjectCnt)) {
                                $subjectCnt++;
                            } else {
                                $subjectCnt = '';
                            }
                            //	      	  		$_POST[$nHost][$nHit]["650a$subjectCnt"] .= $data; // topical term (NR)
                            $rslt["650a{$subjectCnt}"] .= $data;
                            // topical term (NR)
                        } else {
                            #### following line is a patch by Hans van der Weij
                            //							if (!is_numeric($res[3])) {$_POST[$nHost][$nHit]["650a$subjectCnt"] .= ', ' . $data;}
                            if (!is_numeric($res[3])) {
                                $rslt["650a{$subjectCnt}"] .= ', ' . $data;
                            }
                        }
                        //        			$_POST["650a$subjectCnt"] .= ', ' . $data; // details (NR)
                        break;
                    default:
                        ##### everything else
                        //						$_POST[$nHost][$nHit][$fldId] .= $data;
                        $rslt[$fldId] .= $data;
                        break;
                }
            }
        }
    }
    return $rslt;
}
예제 #3
0
파일: index.php 프로젝트: rdmpage/biostor
function main()
{
    $query = '';
    $bookmark = '';
    // If no query parameters
    if (count($_GET) == 0) {
        default_display();
        exit(0);
    }
    // Error message
    if (isset($_GET['error'])) {
        $error_msg = $_GET['error'];
        default_display($error_msg);
        exit(0);
    }
    // Show a single record
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
        if (isset($_GET['page'])) {
            // we are vieiwng pages
            $page = $_GET['page'];
            // to do: sanity check
            display_record($id, $page);
            exit(0);
        }
        display_record($id);
        exit(0);
    }
    // Show journals
    if (isset($_GET['titles'])) {
        $letter = 'A';
        if (isset($_GET['letter'])) {
            $letter = $_GET['letter'];
            // sanity check
            if (!in_array($letter, range('A', 'Z'))) {
                $letter = 'A';
            }
        }
        display_titles($letter);
        exit(0);
    }
    // Show images
    if (isset($_GET['images'])) {
        display_images();
        exit(0);
    }
    // Show map
    if (isset($_GET['map'])) {
        display_map();
        exit(0);
    }
    // Show labs
    if (isset($_GET['labs'])) {
        display_labs();
        exit(0);
    }
    // Show journal (ISSN)
    if (isset($_GET['issn'])) {
        $issn = $_GET['issn'];
        $year = '';
        if (isset($_GET['year'])) {
            $year = $_GET['year'];
            display_journal_year('issn', $issn, $year);
            exit(0);
        }
        display_journal('issn', $issn, $year);
        exit(0);
    }
    // Show journal (OCLSC
    if (isset($_GET['oclc'])) {
        $oclc = $_GET['oclc'];
        $year = '';
        if (isset($_GET['year'])) {
            $year = $_GET['year'];
            display_journal_year('oclc', $oclc, $year);
            exit(0);
        }
        display_journal('oclc', $oclc, $year);
        exit(0);
    }
    // Show search (text, author)
    if (isset($_GET['q'])) {
        $query = $_GET['q'];
        $bookmark = '';
        if (isset($_GET['bookmark'])) {
            $bookmark = $_GET['bookmark'];
        }
        display_search($query, $bookmark);
        exit(0);
    }
}
예제 #4
0
파일: index.php 프로젝트: hardikk/HNH
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoMonitoring.class.php";
    include_once "libs/paloSantoACL.class.php";
    require_once "modules/{$module_name}/libs/JSON.php";
    require_once "modules/agent_console/getinfo.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    // Include language file for EN, then for local, and merge the two.
    include_once "modules/{$module_name}/lang/en.lang";
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        $arrLanEN = $arrLangModule;
        include_once $lang_file;
        $arrLangModule = array_merge($arrLanEN, $arrLangModule);
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $arrConf['dsn_conn_database'] = generarDSNSistema('asteriskuser', 'asteriskcdrdb');
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']);
    $pACL = new paloACL($pDBACL);
    $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    //$extension = $pACL->getUserExtension($user);
    $extension = '6868';
    //$esAdministrador = $pACL->isUserAdministratorGroup($user);
    $esAdministrador = true;
    if ($extension == "" || is_null($extension)) {
        if ($esAdministrador) {
            $smarty->assign("mb_message", "<b>" . _tr("no_extension") . "</b>");
        } else {
            $smarty->assign("mb_message", "<b>" . _tr("contact_admin") . "</b>");
            return "";
        }
    }
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case 'delete':
            //$content = deleteRecord($smarty, $module_name, $local_templates_dir, $pDB, $pACL, $arrConf, $user, $extension, $esAdministrador);
            break;
        case 'download':
            $content = downloadFile($smarty, $module_name, $local_templates_dir, $pDB, $pACL, $arrConf, $user, $extension, $esAdministrador);
            break;
        case "display_record":
            $content = display_record($smarty, $module_name, $local_templates_dir, $pDB, $pACL, $arrConf, $user, $extension, $esAdministrador);
            break;
        case "viewNote":
            $content = viewNote();
            break;
        case "viewDelivery":
            $content = viewDelivery();
            break;
        default:
            $content = reportMonitoring($smarty, $module_name, $local_templates_dir, $pDB, $pACL, $arrConf, $user, $extension, $esAdministrador);
            break;
    }
    return $content;
}
예제 #5
0
function main()
{
    $query = '';
    $bookmark = '';
    // If no query parameters
    if (count($_GET) == 0) {
        default_display();
        exit(0);
    }
    // If show a single record
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
        display_record($id);
    }
    if (isset($_GET['q'])) {
        $query = $_GET['q'];
        if (isset($_GET['bookmark'])) {
            $bookmark = $_GET['bookmark'];
        }
        display_search($query, $bookmark);
        exit(0);
    }
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
        display_page($page);
        exit(0);
    }
    /*
    if (isset($_GET['author']))
    {	
    	$query = $_GET['author'];
    	display_author($query);
    	exit(0);
    }
    */
}
예제 #6
0
파일: index.php 프로젝트: rdmpage/afd
function main()
{
    $query = '';
    // If no query parameters
    if (count($_GET) == 0) {
        default_display();
        exit(0);
    }
    // If show a single record
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
        display_record($id);
    }
    if (isset($_GET['search'])) {
        $query = $_GET['search'];
        display_search($query);
        exit(0);
    }
    if (isset($_GET['author'])) {
        $query = $_GET['author'];
        display_author($query);
        exit(0);
    }
    if (isset($_GET['publication_outlet'])) {
        $query = $_GET['publication_outlet'];
        display_outlet($query);
        exit(0);
    }
}
예제 #7
0
/**
 *  Shows a page with nice information on the record
 *
 */
function show_g($db, $tableinfo, $id, $USER, $system_settings, $backbutton = true, $previousid = false, $nextid = false, $viewid = false)
{
    if (!may_read($db, $tableinfo, $id, $USER)) {
        return false;
    }
    $Allfields = getvalues($db, $tableinfo, $tableinfo->fields, id, $id);
    display_record($db, $Allfields, $id, $tableinfo, $backbutton, $previousid, $nextid, $viewid);
}
예제 #8
0
파일: ebpls102.php 프로젝트: laiello/ebpls
					</td>
					<td align="center" valign="center" class='normalbold' width=50  bgcolor='#c0c0c0'>
						Certificate Type
					</td>
				</tr>
				<?php 
if ($total_ctcRecords == 0) {
    echo '<tr><td align="center" valign="center" class="errmsg" height=10 colspan=9 bgcolor="#ffffff"><hr>NO RECORD FOUND !<hr></td></tr>';
} else {
    //--- check if renew
    if ($is_ctc_renew and $code_found > 0) {
        display_record($clsCTC->getData(), true);
    } else {
        $ctc_records = $ctcRecords["result"];
        for ($i = 0; $i < count($ctcRecords["result"]); $i++) {
            display_record($ctc_records[$i]->getData(), $is_ctc_renew);
        }
    }
}
?>
				<tr>
					<td align="center" valign="center" class="normal" height=10 colspan=9 bgcolor='#ffffff'>
					<img src='images/blank.gif' height=10><br>
					&nbsp;<input type='BUTTON' name='_BACK' onClick='javascript:history.go(-1)' value='B A C K'>
					<?php 
if ($total_ctcRecords > 0) {
    echo "&nbsp;<input type='SUBMIT' name='_PROCESS' value='{$process_button}'>";
}
?>
					&nbsp;<input type='reset' name='_RESET' onClick='' value='R E S E T' >
					<br>