Example #1
0
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);
    }
}
Example #2
0
      <?php 
            $staff_module = '';
            foreach ($papers as $moduleID => $paper_list) {
                if ($moduleID != $staff_module) {
                    $staff_module = $moduleID;
                    echo "<table style=\"clear:both; font-size:100%\"><tr><td class=\"subsect\"><nobr>{$moduleID}</nobr></td><td style=\"width:98%\"><hr class=\"head-line\" /></td></tr></table>\n";
                }
                foreach ($paper_list as $paper) {
                    $warnings = array();
                    $screen_plural = $paper['screens'] > 1 ? 'screens' : 'screen';
                    $start_hour = substr($paper['start_date'], 11, 2);
                    if (intval($start_hour) < $configObject->get('cfg_hour_warning')) {
                        $warnings[] = sprintf($string['startwarning'], $configObject->get('cfg_hour_warning'));
                    }
                    $labs = get_labs($mysqli, $paper['labs']);
                    $lab_html = display_labs($labs, $computer_lab_short, $string, $warnings);
                    ?>
            <div class="file">
                <table cellpadding="0" cellspacing="0" border="0" style="font-size:100%">
                    <tr>
                        <td style="width:60px; vertical-align:top"><a class="blacklink" href="user_index.php?id=<?php 
                    echo $paper['crypt_name'];
                    ?>
&mode=preview" rel="<?php 
                    echo $paper['fullscreen'];
                    ?>
"><img src="../artwork/summative.png" width="48" height="48" alt="Type: Summative Exam" border="0"/></a></td>
                        <td>
                            <a href="user_index.php?id=<?php 
                    echo $paper['crypt_name'];
                    ?>