<?php session_start(); 
if ( $_SESSION['P1_Login_uid'] == '' )
	{
		header("Location: login.php");
	}
	
	 // for fix time in bahrain 
	 
	 date_default_timezone_set("Asia/Kuwait"); 
	
		include("config.php");
		include("session.php"); 
		include("db.php"); 
?>
<!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=windows-1256" />
<title><? echo $life_software ?></title>
<link href="wstyle.css" rel="stylesheet" type="text/css" />

					<? if ( $_GET['page'] == '2' or $_GET['page'] == '3' or  $_GET['page'] == '4' or  $_GET['page'] == '7' )
							{
								?><meta http-equiv="Refresh" content="60" /><?
								
							}
						?>


</head>

<body>
<? if ( $_GET['stat'] <> 'print' )     { ?>

<p align="center"><img src="images/top.gif" width="842" height="150" /></p>
<? } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<? if ( $_GET['stat'] <> 'print' )     { ?>
    <td width="20%" valign="top"><div align="center">
      <table width="80%" border="0">
        <tr>
          <td height="26" class="td1"><div align="center" dir="rtl">Main</div></td>
        </tr>
	<? if($_SESSION['P1_Login_appointments'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=1" class="td2">Appointments</a></div></td>
        </tr>
    <? } ?>
	<? if($_SESSION['P1_Login_factory'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=2" class="td2">Factory</a></div></td>
        </tr>
    <? } ?>
	<? if($_SESSION['P1_Login_delivery'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=3" class="td2">Printed</a></div></td>
        </tr>
    <? } ?>
	
	<? if($_SESSION['P1_Login_search'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=6" class="td2">Requests</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=7" class="td2">Requested Plates</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=5" class="td2">Search</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=17" class="td2">Agent</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=20" class="td2">VIP</a></td>
        </tr>
      <? /* <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=18" class="td2">Delevery VIP</a></div></td>
        </tr> */ ?>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=26" class="td2">Sales</a></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=27" class="td2">Damage</a></td>
        </tr>

    <? } ?>
    <? if($_SESSION['P1_Login_fixing'] == 5 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=4" class="td2">Delivery</a></div></td>
        </tr>
    <? } ?>
        <tr>
          <td height="26" class="td1"><div align="center" dir="rtl">Control</div></td>
        </tr>
	<? if($_SESSION['P1_Login_add_new_date'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=10" class="td2">Add New Date</a></div></td>
        </tr>
    <? } ?>
	<? if($_SESSION['P1_Login_control_user'] == 1 ) { ?>
        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=11" class="td2">Control User</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=16" class="td2">Edit</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=22" class="td2">Remove</a></td>
        </tr>
        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=14" class="td2">Default Time</a></div></td>
        </tr>
       <tr>
         <td class="td2"><div align="center"><a href="index.php?page=15" class="td2">Change Receipt Text</a></div></td>
       </tr>
        <tr>
          <td height="26" class="td2"><div align="center"><a href="index.php?page=19" class="td2">Manage Agent</a></div></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=21" class="td2">Manage VIP</a></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=24" class="td2">Change Status</a></td>
        </tr>
        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=13" class="td2">Technician</a></div></td>
        </tr>
        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=25" class="td2">Staff</a></div></td>
        </tr>
        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=28" class="td2">Return Date</a></div></td>
        </tr>
      <? /*  <tr>
          <td class="td2"><a href="index.php?page=29" class="td1">Return Agent Date</a></td>
        </tr> */ ?>
    <? } ?> 
	<? if($_SESSION['P1_Login_report_os'] == 1 ) { ?>
        <tr>
          <td height="26" class="td1">Accounts</td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=23" class="td2">Cash by user</a></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=58" class="td2">Cash</a></td>
        </tr>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=59" class="td2">Cash by Agent</a></td>
        </tr>
   <? } ?> 
	<? if($_SESSION['P1_Login_manage_sales'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=62" class="td2">Sales Log</a></td>
        </tr>   
   <? } ?> 
	<? if($_SESSION['P1_Login_control_user'] == 1 ) { ?>
        <tr>
          <td height="26" class="td2"><a href="index.php?page=61" class="td2">Sales</a></td>
        </tr>

        <tr>
          <td height="26" class="td1"><div align="center">Reports</div></td>
        </tr>
       <tr>
          <td class="td2"><div align="center"><a href="index.php?page=50" class="td2">Order / Delivery Report<br />
 By Plate</a></div></td>
        </tr>
       <tr>
          <td class="td2"><div align="center"><a href="index.php?page=56" class="td2">Order / Delivery Report<br />
 By Car</a></div></td>
        </tr>
       <tr>
         <td class="td2"><a href="index.php?page=51" class="td2">Payment Report</a></td>
       </tr>
       <tr>
         <td class="td2"><a href="index.php?page=52" class="td2">Technician Report</a></td>
       </tr>
       <tr>
         <td class="td2"><a href="index.php?page=53" class="td2">Order and Delivery<br />
 Vehicles Report</a></td>
       </tr>      
       <tr>
         <td class="td2"><a href="index.php?page=54" class="td2">Delivered Onsite</a></td>
       </tr>
       <tr>
         <td class="td2"><a href="index.php?page=55" class="td2">General Report</a></td>
       </tr>   
       <? } ?>  
       <? if($_SESSION['P1_Login_report_os'] == 1 ) { ?> 
       <tr>
         <td class="td2"><a href="index.php?page=57" class="td2">Summary of POS Transactions</a></td>
       </tr>      
       <? } ?> 
       <tr>
         <td class="td2"><a href="index.php?page=60" class="td2">UnDelivered</a></td>
       </tr>      


        <tr>
          <td class="td2"><div align="center"><a href="index.php?page=12" class="td2">Reset Password</a></div></td>
        </tr>
		
        <tr>
          <td height="26" class="td1"><a href="login.php?stat=logout" class="td1">Exit</a></td>
        </tr>
      </table>
      </div></td>
<? } ?>      
    <td width="80%" valign="top">
    		<?
    					if ( $_GET['page'] == '')
							{
									include("page0.php");
							}
    					if ( $_GET['page'] == '1')
							{
							   if($_SESSION['P1_Login_appointments'] == 1 ) {
									include("page1.php");
									}
							}
							
    					if ( $_GET['page'] == '2')
							{
							   if($_SESSION['P1_Login_factory'] == 1 ) {
									include("page2.php");
									}
							}
							
    					if ( $_GET['page'] == '3')
							{
							   if($_SESSION['P1_Login_delivery'] == 1 ) {
									include("page3.php");
									}
							}
    					if ( $_GET['page'] == '4')
							{
							   if($_SESSION['P1_Login_fixing'] == 1 ) {
									include("page4.php");
									}
							}
    					if ( $_GET['page'] == '5')
							{
							   if($_SESSION['P1_Login_search'] == 1 ) {
									include("page5.php");
									}
							}
							
    					if ( $_GET['page'] == '6')
							{
									include("page6.php");
							}
    					if ( $_GET['page'] == '7')
							{
									include("page7.php");
							}



    					if ( $_GET['page'] == '10')
							{
									include("page10.php");
							}
    					if ( $_GET['page'] == '11')
							{
									include("page11.php");
							}
    					if ( $_GET['page'] == '12')
							{
									include("page12.php");
							}
    					if ( $_GET['page'] == '13')
							{
									include("page13.php");
							}
    					if ( $_GET['page'] == '14')
							{
									include("page14.php");
							}
    					if ( $_GET['page'] == '15')
							{
									include("page15.php");
							}
    					if ( $_GET['page'] == '16')
							{
									include("page16.php");
							}
    					if ( $_GET['page'] == '17')
							{
									include("page17.php");
							}


    					if ( $_GET['page'] == '19')
							{
									include("page19.php");
							}
    					if ( $_GET['page'] == '20')
							{
									include("page20.php");
							}
    					if ( $_GET['page'] == '21')
							{
									include("page21.php");
							}
    					if ( $_GET['page'] == '22')
							{
									include("page22.php");
							}
    					if ( $_GET['page'] == '23')
							{
									include("page23.php");
							}
    					if ( $_GET['page'] == '24')
							{
									include("page24.php");
							}
    					if ( $_GET['page'] == '25')
							{
									include("page25.php");
							}
    					if ( $_GET['page'] == '26')
							{
									include("page26.php");
							}
    					if ( $_GET['page'] == '27')
							{
									include("page27.php");
							}
    					if ( $_GET['page'] == '28')
							{
									include("page28.php");
							}
							
							
    					if ( $_GET['page'] == '50')
							{
									include("page50.php");
							}
							
    					if ( $_GET['page'] == '51')
							{
									include("page51.php");
							}
							
    					if ( $_GET['page'] == '52')
							{
									include("page52.php");
							}
    					if ( $_GET['page'] == '53')
							{
									include("page53.php");
							}
    					if ( $_GET['page'] == '54')
							{
									include("page54.php");
							}
    					if ( $_GET['page'] == '55')
							{
									include("page55.php");
							}
    					if ( $_GET['page'] == '56')
							{
									include("page56.php");
							}
    					if ( $_GET['page'] == '57')
							{
									include("page57.php");
							}
    					if ( $_GET['page'] == '58')
							{
									include("page58.php");
							}
    					if ( $_GET['page'] == '59')
							{
									include("page59.php");
							}
						if ( $_GET['page'] == '60')
							{
									include("page60.php");
							}
						if ( $_GET['page'] == '61')
							{
									include("page61.php");
							}
							
						if ( $_GET['page'] == '62')
							{
									include("page62.php");
							}
    		?>    </td>
    
  </tr>
</table>
</body>
</html>
