Location: PHPKode > projects > SENAYAN Library Automation > senayan3-stable5/lib/contents/show_detail.inc.php
<?php

/*

VERSION : 3.0
CODENAME : SENAYAN
AUTHOR :
    Code and Programming : ARIE NUGRAHA (hide@address.com)
    Database Design : HENDRO WICAKSONO (hide@address.com) & WARDIYONO (hide@address.com)

SENAYAN Library Automation System
Copyright (C) 2007

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program (GPL License.txt); if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

/* Showing record detail in HTML and XML */

if (isset($_GET['inXML']) AND !empty($_GET['inXML'])) {
    if (!$sysconf['enable_xml_detail']) {
        die('XML Detail is disabled');
    }
    // filter the ID
    $detail_id = intval($_GET['id']);
    // include detail library and template
    include 'lib/detail.inc.php';
    include $sysconf['template']['dir'].'/detail_xml_template.php';
    // create detail object
    $detail = new detail($dbs, $detail_id, true);
    $detail->setListTemplate($detail_template);
    // send http header
    header('Content-Type: text/xml');
    echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
    echo '<senayan>'."\n";
    echo '<generate_time>'.date("D, Y-m-d H:i:s").'</generate_time>'."\n";
    echo $detail->showDetail();
    echo '</senayan>';
    exit();
} else {
    // filter the ID
    $detail_id = intval($_GET['id']);
    // include detail library and template
    include 'lib/detail.inc.php';
    include $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/detail_template.php';
    // create detail object
    $detail = new detail($dbs, $detail_id);
    $detail->setListTemplate($detail_template);
    // set the content for info box
    $info = '<strong>'.strtoupper(lang_opac_rec_detail).'</strong><hr />';
    $info .= '<a href="javascript: history.back();">'.lang_opac_back_prev.'</a> &nbsp;';
    if ($sysconf['enable_xml_detail']) {
        $info .= '<a href="index.php?p=show_detail&inXML=true&id='.$detail_id.'" class="xmlDetailLink" target="_blank">XML Detail</a>';
    }
    // include Prototype javascript library
    echo '<script type="text/javascript" src="'.JS_WEB_ROOT_DIR.'prototype.js"></script>';
    // output the record detail
    echo $detail->showDetail();
    $page_title = $sysconf['library_name'].' :: '.$detail->record_title;
    echo '<br />'."\n";
}

?>
Return current item: SENAYAN Library Automation