Location: PHPKode > projects > ARBS > arbs-1.5.1.78/print_single.php
<?php
/*
 * ARBS - Advanced Resource Booking System
 * Copyright (C) 2005-2007 ITMC der TU Dortmund
 * Based on MRBS by Daniel Gardner <http://mrbs.sourceforge.net/>
 * 
 * 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; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */


include_once("glob_inc.inc.php");
//execute this query one time to enable ticket info to be saved
//mysql_query("ALTER TABLE `mrbs_entry` ADD `ticket_number` VARCHAR( 32 ) NOT NULL ,ADD `ticket_coment` VARCHAR( 255 ) NOT NULL,ADD `ticket_recv` VARCHAR( 32 ) NOT NULL  ;");



if(!getAuthorised(getUserName(), getUserPassword(), 1)){
        showAccessDenied($day, $month, $year, $area);
        exit;
}

if(isset($_GET['number'])){
        mysql_query("UPDATE mrbs_entry SET ticket_recv='".mysql_real_escape_string($_GET['recv'])."', ticket_number='".mysql_real_escape_string($_GET['number'])."',ticket_coment='".mysql_real_escape_string($_GET['coment'])."' WHERE ID=".((int)$_GET['id']));
        echo "<b><font color=#009900 size=3>", _("Input has been saved"), "</font></b><br/><br/>";
}

$res=mysql_query("SELECT ticket_number,ticket_recv,ticket_coment FROM mrbs_entry WHERE ID=".((int)$_GET['id'])." LIMIT 0,1");
$ticket_zeile=mysql_fetch_array($res);

drawTicket(((int)$_GET['id']));


?>
<script language=Javascript>
var vis=true;
function doOff(){
        document.getElementById('hideme').style.visibility='hidden';
        vis=false;
}
function doOn(){
        document.getElementById('hideme').style.visibility='visible';
        vis=true;
}
function doToggle(){
        if(vis)
                doOff();
        else
                doOn();
}
</script>
<br><br>
<a href="javascript:doOff();window.print();"><?php echo(_("Print this page")); ?></a> || <a href="javascript:doToggle();"><?php echo(_("Form on/off")); ?></a>
<div style="visibility:visible;" id="hideme">
<hr>
        <h4><?php echo(_("Input infos for the borrower's ticket")); ?></h4>
        <?php
        ?>
<form method=get action=print_single.php>
        
        <input type=hidden name=id value="<?php echo(((int)$_GET['id'])); ?>">
        <table>
        <tr><TD><?php echo(_("ID of the borrower's ticket:")); ?></td><td><input type=text name=number value="<?php echo($ticket_zeile[0]); ?>"></td></tr>
        <tr><TD><?php echo(_("Receiver:")); ?></td><td><input type=text name=recv value="<?php echo($ticket_zeile[1]); ?>"></td></tr>
        <tr><TD><?php echo(_("Comment:")); ?></td><td><textarea name=coment rows=3 cols=50><?php echo($ticket_zeile[2]); ?></textarea></td></tr>
        <tr><TD colspan=2 align=center><input type=submit value="<?php echo(_("Save")); ?>"></td></tr>
         </table>
</form>
</div>
Return current item: ARBS