<?php session_start();
 if( !isset($_SESSION['ps_user']) )
 {
	echo "<script>location='../../devices.php'</script>";
	    die();
}
 
include('../../includes/config.php');
if($lang == 'en'){include('../../languages/en.php');}else if($lang == 'ar'){include('../../languages/ar.php');}
 mysql_connect("$host", "$user", "$pass") or die(mysql_error()); 
 mysql_select_db("$db") or die(mysql_error()); 
 

$id = $_GET['id']; // To connect to the database
mysql_connect("$host", "$user", "$pass")or die("cannot connect");
mysql_select_db("$db")or die("cannot select DB");
 $sql="SELECT * FROM reservation ORDER BY id DESC LIMIT 1";
$result=mysql_query($sql);
while($row = mysql_fetch_array($result))
  {
  $id = $row['id'];
   $odate = $row['date'];
 $otime = $row['time'];
 $name = $row['name'];
 $mobile = $row['mobile'];
 $type = $row['type'];
 $money = $row['money'];
  }
 // $name = $_GET['name'];
 // $mobile = $_GET['mobile'];
 // $type = $_GET['type'];
 // $money = $_GET['money'];

    	mysql_connect("$host", "$user", "$pass") or die(mysql_error()); 
	mysql_select_db("$db") or die(mysql_error()); 
	$sql="SELECT * FROM config";
	$result=mysql_query($sql);
	while($row = mysql_fetch_array($result))
		{
			$logo = $row['logo'];
			$store = $row['store'];
			$phone = $row['phone'];
			$facebook = $row['facebook'];
		} 
   
?>
  <html>
 <head>
 <style>
 @font-face {
    font-family: "DroidArabicKufiRegular";
    src: url(../../fonts/DroidKufi/DroidKufi-Bold.ttf) format("truetype");
}
body {
    font-family: 'DroidArabicKufiRegular'; 
    font-style: normal; 
  
  }
  *{
	  direction:rtl;
	  font-size: 13px;
  }
    @page 
        {
            size: auto;   /* auto is the current printer page size */
            margin: 0mm;  /* this affects the margin in the printer settings */
        }
		table {
    border-collapse: collapse;
}

.t1 table, th, td {
    border: 1px dashed black;
}

th {
    height: 50px;
}
  </style>
 </head>
 <body <?if($printornot == 'yes'){?>onload="window.print()"<?}?>> 
<center>
<img src="../../img/<?echo $logo;?>" style="width:150px" height="150px"/>
<h3><?echo $store;?></h3>
</center>
<table border="1" width="95%">
<tr>
<td align = 'center'><b><?echo $lang_250;?></b></td>
<td align = 'center'><? echo $id; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_77;?></b></td>
<td align = 'center'><? echo $odate; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_78;?></b></td>
<td align = 'center'><? echo $otime; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_21;?></b></td>
<td align = 'center'><? echo $name; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_79;?></b></td>
<td align = 'center'><? echo $mobile; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_80;?></b></td>
<td align = 'center'><? echo $type; ?></td>
</tr>
<tr>
<td align = 'center'><b><?echo $lang_81;?></b></td>
<td align = 'center'><? echo $money; ?></td>
</tr>

</table>
 <table border="1" width="95%">

 <tr>
 	<td><b><?echo $lang_183;?></b></td>
    <td><?echo $phone; ?></td>
 </tr>
 <tr>
	<td><b><font size="3"> <?echo $lang_184;?> </b></td>
	<td><font size="4"><?echo $facebook;?> </font>  / <img src="../../img/app/social/facebook.png" width= "20" height="20"/></font></td>
</tr>	
</table>


 </body>
 </html>