<? 
require_once "include/application.php"; 
require_once "include/function.php";

	$sql="select * from ivc_reservation left join ivc_members on irs_memberno=im_formno left join 
	ivc_products on im_scheme=ip_id left join ivc_rooms on ip_room = ir_id 	where irs_id='$id' and irs_confirm_night='0' ";
	$result=mysql_query($sql);	
	while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
	{
		$reserv=$myrow["irs_for"];
		$gname=$myrow["irs_guestname"];
		$gic=$myrow["irs_guestic"];
		$gcontact=$myrow["irs_guestcontact"];
		$gemail=$myrow["irs_guestemail"];
		$cin1=window_date($myrow["irs_checkin1"]);
		$cout1=window_date($myrow["irs_checkout1"]);
		$adult1=$myrow["irs_adult1"];
		$child1=$myrow["irs_child1"];
		$cin2=window_date($myrow["irs_checkin2"]);
		$cout2=window_date($myrow["irs_checkout2"]);
		if($cin2=="00/00/0000")$cin2="";
		if($cout2=="00/00/0000")$cout2="";
		$cin3=window_date($myrow["irs_checkin3"]);
		$cout3=window_date($myrow["irs_checkout3"]);
		if($cin3=="00/00/0000")$cin3="";
		if($cout3=="00/00/0000")$cout3="";

		$remark=$myrow["irs_remark"];

		$ivcremark=$myrow["irs_ivcremark"];
		$rooms=$myrow["irs_room1"];
        		
		$cardno=$myrow["im_cardno"];
		$no=$myrow["irs_memberno"];
		$name=$myrow["im_name"];
		$scheme=$myrow["ip_code"]." - ".$myrow["ip_name"];
		$roomtype=$myrow["ir_type"]." - ".$myrow["ir_descr"];
		$ic=$myrow["im_ic"];
		$email=$myrow["im_email"];
		$home=$myrow["im_phome"];
		$mobile=$myrow["im_mobile"];
		$fax=$myrow["im_fax"];
		$nationality=$myrow["im_nationality"];

		$freemaint=$myrow["im_freemaint"];
		$exp=window_date($myrow["im_expired"]);
		$program=$myrow["im_program"];
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo TITLE?></title>

<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
}
</style>
</head>

<body onload="window.print();">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><U>ROOM REQUEST FORM</U> </td>
    <td colspan="2">&nbsp;</td>
    <td width="288" rowspan="3" align="right" valign="top"><img src="../images/iconic_07.jpg" width="113" height="68" /></td>
  </tr>
  <tr>
    <td>Owner's Free Stay </td>
    <td>[ &nbsp; ]</td>
    <td width="209">House Use</td>
    <td width="209">[ &nbsp; ]</td>
  </tr>
  <tr>
    <td width="200">IVC Member </td>
    <td width="94">[X]</td>
    <td width="209">Complimentary Use</td>
    <td width="209">[ &nbsp; ]</td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td align="right">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><table border="0" cellpadding="2" width="100%" cellspacing="1" class="small">
          <tr>
            <td width="151" >Card No. :</td>
            <td width="255" ><? echo $cardno ?></td>
          </tr>
          <tr>
            <td ><span class="TextH1">Principal's</span> Name  :</td>
            <td ><? echo $no ?></td>
          </tr>
          <tr>
            <td >Nationality     :</td>
            <td ><? echo $nationality; ?></td>
          </tr>
          <tr>
            <td >NRIC/Passport  :</td>
            <td ><? echo $ic ?></td>
          </tr>
          <tr >
            <td height="23" ><div align="left">Home Contact No. : </div></td>
            <td ><? echo $home ?></td>
          </tr>
          <tr >
            <td height="23" ><div align="left">Mobile No. :</div></td>
            <td ><? echo $mobile ?></td>
          </tr>
          <tr >
            <td height="23" ><div align="left">Email : </div></td>
            <td ><? echo $email ?></td>
          </tr>
          <tr>
            <td class="TextH1">Type of Product    :</td>
            <td class="TextH1"><? echo $scheme ?></td>
          </tr>
          <tr>
            <td class="TextH1">Rooms    :</td>
            <td class="TextH1"><? echo $roomtype ?></td>
          </tr>
          <tr>
            <td class="TextH1">No. of Villas :              </td>
            <td class="TextH1"><? echo $rooms; ?>
</td>
          </tr>
          <tr>
            <td class="TextH1">No. of Adults :
              &nbsp;</td>
            <td class="TextH1"><? echo $adult1; ?>
</td>
          </tr>
          <tr >
            <td height="23" ><span class="TextH1">No. of Childrens :</span></td>
            <td ><? echo $child1; ?>

</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Special Request :</td>
          </tr>
          <tr>
            <td height="50" colspan="2" valign="top" class="TextH1"><? echo str_replace("\r\n","<br>",$remark); ?></td>
          </tr>
          <tr>
            <td colspan="2" >IVC Remarks :</td>
          </tr>
          <tr>
            <td colspan="2" valign="top" ><span class="TextH1"><? echo str_replace("\r\n","<br>",$ivcremark); ?></span></td>
          </tr>
          <tr >
            <td height="23" colspan="2" >&nbsp;</td>
          </tr>
        </table></td>
        <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
          <tr class="small" >
            <td height="23" align="left" >Booking No :</td>
            <td height="23" align="left" >&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Reservation Request</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1"><input name="reserv" type="radio" value="Personal" <?=($reserv=="Personal" ? "CHECKED" : " ")?> onclick="guestinfo(this.value)""/>
              For personal
              use
              <input name="reserv" type="radio" value="Guest" <?=($reserv=="Guest" ? "CHECKED" : " ")?>/>
              For guest use </td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">If for guest use, please indicate the following:</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Guest's Full Name:
              <? echo $gname ?></td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Guest's IC / Passport No : <? echo $gic ?></td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Guest's Contact No : <? echo $gcontact ?></td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">Guest's Email : <? echo $gemail ?></td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1"><input name="confirmchoice" type="radio" value="1" <?=($confirmchoice=="1" ? "CHECKED" : " ")?>/>
              Confirm 1st Choice </td>
          </tr>
          <tr>
            <td width="41%" class="TextH1">Check In Date :</td>
            <td width="59%" class="TextH1"><? echo $cin1 ?>
            </td>
          </tr>
          <tr>
            <td class="TextH1">Check Out Date :</td>
            <td class="TextH1"><? echo $cout1 ?></td>
          </tr>
          <tr>
            <td class="TextH1">&nbsp;</td>
            <td class="TextH1">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1"><input name="confirmchoice" type="radio" value="2" <?=($confirmchoice=="2" ? "CHECKED" : " ")?>/>
              Confirm 2nd Choice </td>
          </tr>
          <tr>
            <td class="TextH1">Check In Date :</td>
            <td class="TextH1"><? echo $cin2 ?>
</td>
          </tr>
          <tr>
            <td class="TextH1">Check Out Date :</td>
            <td class="TextH1"><? echo $cout2 ?>
            </td>
          </tr>
          <tr>
            <td class="TextH1">&nbsp;</td>
            <td class="TextH1">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1"><input name="confirmchoice" type="radio" value="3" <?=($confirmchoice=="3" ? "CHECKED" : " ")?>/>
              Confirm 3rd Choice </td>
          </tr>
          <tr>
            <td class="TextH1">Check In Date :</td>
            <td class="TextH1"><? echo $cin3 ?>
             </td>
          </tr>
          <tr>
            <td class="TextH1">Check Out Date :</td>
            <td class="TextH1"><? echo $cout3 ?>
              </td>
          </tr>
          <tr>
            <td colspan="2" class="TextH1">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="22%" height="35" rowspan="2">Requested By :</td>
        <td width="37%"><?=$_SESSION["egoUser"]; ?></td>
        <td width="10%" rowspan="2">Date :</td>
        <td width="31%"><?=date("d/m/Y");?></td>
      </tr>
      <tr>
        <td>________________________</td>
        <td width="31%">________________________</td>
      </tr>
      <tr>
        <td height="35">Appeoved By </td>
        <td>________________________</td>
        <td>Date :</td>
        <td>________________________</td>
      </tr>
      <tr>
        <td height="35">Acknowledged By :</td>
        <td>________________________</td>
        <td>Date :</td>
        <td>________________________</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
</table>
</body>
</html>