Here it is, hope line-wrapping doesn't make this un-readable. Most comments added for your convenience, get comfortable with php4
SESSIONS...
<?php // Currently using php 4.0.1
require('geo_inc.php'); include('c_in_out.php');
require('choose_room.php'); include('users.inc.php');
require('choose_guest.php'); // Req/incl is still a mess here...
// Hotel soft to handle front desk operations...
$db='HTL';
hheader("<TITLE> Check-$action </TITLE>");
// f() above starts session, $cur_act is a sess registered
// variable while $action is not, so $cur_act remembers
// original intent between calls to non-session activities...
if($action != '') $cur_act = $action;
// Save to session var if page called from previous form
// but not if re-called by sub-form...
if($action == 'in' || $action == 'out') {
mysql_connect("localhost","","");
// will be moved to abstrac layer when complete...
// Select room which will be checked-in or checked-out
// and call this form back after choice made
sel_rm($db, room); // with this call...
} // if.
if(isset($room)) {
if($cur_act == 'in') {
if(isset($guestno)) { // This var submitted bu sub-form...
echo "Check guest # $guestno into room $room<br>";
in_out_form('checkin.php', $room, $guestno);
// On ch-in, confirm+execute 'checkin.php'
// only if guest AND room chosen,
} // if guestno.
else { ch_guest_in_list($db, guest_db, $room); }
// IMPORTANT: '$room' re-posted to this page when
// have a guest to put in the room...
$action = $cur_act;
// Put 'in' in action to avoid 'not supported' msg...
} // if 'in'.
if($cur_act == 'out') {
echo
"Check out room $room<br>";
$action = 'out'; // Avoid 'not supported' msg.
in_out_form('checkout.php', $room, $guestno);
// Do 'checkout.php
// pass 'guest' auto-inc nbr for name to appear in confirm...
} // if 'out'.
} // if 'room'.
if($action != 'in' && $action != 'out') {
echo "Sorry, <b>$action</b> not yet supported<br>"; } // if.
// Will add reservations & billing later...
hfooter ("Current action: $cur_act<br>");
?>