<?php   session_start();

if ( $_SESSION[ invcox ] == "" ) { header( "location:login.php?action=need" );} else { include( "config.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=iso-8859-1"/>
      <title>Room Entry</title>
      <link href="style.css" rel="stylesheet" type="text/css"/>
      <?php include("calendar.php");
?>   
   </head>
   <body>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="box-wrap">
         <tr>
            <td>   <?php include("top.php");
?></td>
         </tr>
         <tr>
            <td>
               <table width="100%" border="0" cellspacing="1" cellpadding="0">
                  <tr>
                     <td align="left" class="link2">&nbsp;
</td>
                  </tr>
               
                  <tr>
                     <td align="center">&nbsp;
</td>
                  </tr>
                  <tr>
                     <td>
                        <form action="insert_room.php" method="post" enctype="multipart/form-data" name="form1" class="round_box" id="form1">
                           <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
                              <tr>
                                 <td height="40" colspan="2" align="center" bgcolor="#466c74">Room Entry</td>
                              </tr>
                              <?php if($_GET[info]!=""){?>
                              <tr>
                                 <td height="40" colspan="2" align="center" bgcolor="#80E8F4"><?php echo $_GET[info];
 ?>   </td>
                              </tr>
                              <?php }?>
                              <tr>
                                 <td width="14%" height="30"> Room No :*</td>
                                 <td width="86%" class="input200"><input name="room_no" type="text" required="required" id="room_no" />   </td>
                              </tr>
                              <tr>
                                 <td bordercolor="#CCCCCC"> Room Type:</td>
                                 <td bordercolor="#CCCCCC" class="input200"><label><input name="rtype" type="text" id="rtype"  value="" /></label>   </td>
                              </tr>
                              <tr>
                                 <td>Price (for Every Day) :<span class="red">*</span>   </td>
                                 <td class="input200"><input name="rprice" type="text" required="required" id="rprice" />   </td>
                              </tr>
                              <tr>
                                <td>Short Description</td>
                                <td class="input200"><?php 

  include_once "images/fckeditor/fckeditor.php";			
  $oFCKeditor = new FCKeditor('srt_description');
  $oFCKeditor->BasePath = "images/fckeditor/";
  $oFCKeditor->Value    = "";
  $oFCKeditor->Width    = 650;
  $oFCKeditor->Height   = 300;
  echo $oFCKeditor->CreateHtml();
  ?></td>
                              </tr>
                              <tr>
                                 <td>Description :<span class="input200">
                                   <input name="url" type="hidden" id="url" value="add_client.php"/>
                                 </span></td>
                                 <td class="input200"> 
								  
								  
<?php 

  include_once "images/fckeditor/fckeditor.php";			
  $oFCKeditor = new FCKeditor('description');
  $oFCKeditor->BasePath = "images/fckeditor/";
  $oFCKeditor->Value    = "";
  $oFCKeditor->Width    = 650;
  $oFCKeditor->Height   = 400;
  echo $oFCKeditor->CreateHtml();
  ?>

								  
								  
								  </td>
                              </tr>
                              <tr>
                                <td height="50" align="left">Images : </td>
                                <td height="50" align="left"> <input type="file" name="images[]" multiple></td>
                             </tr>
                              <tr>
                                 <td height="50" align="center">&nbsp;
</td>
                                 <td height="50" align="left"><input type="submit" name="Submit23" value="Submit"/>   </td>
                              </tr>
                           </table>
                        </form>
                     </td>
                  </tr>
                  <tr>
                     <td>&nbsp;
</td>
                  </tr>
                  <tr>
                     <td align="center" class="round_box">
                        <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="list_table">
                           <tr>
                              <th height="30">SL</th>
							   <th height="30">Room No</th>
                              <th height="30" align="center">Room Type</th>
                              <th height="30" align="left">Price (for Every Day) </th>
                              <th width="106" height="30" align="center"><span class="style23">Edit</th>
                           </tr>
                           <?php $page_name="add_room.php?id=$_GET[id]";
 	$limit=$_GET['limit'];
	$start=$_GET['start'];
if(!($start > 0)) {	$start = 0;
	}	$eu = ($start - 0);
 	$limit = '50';
   	$this1 = $eu + $limit;
 	$back = $eu - $limit;
 	$next = $eu + $limit;
$ant=mysql_query("select * from hotel_room order by id desc ");
$nume=mysql_num_rows($ant);
$result=mysql_query("select * from hotel_room order by id desc limit $eu, $limit");
$row=mysql_fetch_array($result);
$sr=0;
do{
							
							$sr++;?>   
                           <tr>
							   <td width="43" align="center" valign="top" class="link"><?php    echo $sr;
            ?>  </td>
                              <td width="284" align="center" valign="top" class="link"><?php    echo $row[room_no];
            ?>   </td>
                              <td width="220" align="center" valign="top" class="link "><?php echo $row[rtype];
   ?></td>
                              <td width="185" align="left" valign="top" class="link "><?php echo $row[rprice];
?></td>
                              <td width="106" align="center" class="link"><a href="edit_room.php?id=<?php echo $row[id];
 ?>" class=" ">Edit</a></td>
                           </tr>
                           <?php }while($row=mysql_fetch_array($result));
?>
                        </table>
                    <td width="25" align="center" class="paiging">&nbsp;
</td>
                  </tr>
               </table>
            </td>
         </tr>
         <tr>
            <td height="28" align="center">
               <table border="0" align = "center" cellpadding="0" cellspacing="2">
                  <tr>
                     <?php if($back >=0) { echo  "<td  align='left' class='paiging' width='60px'><a href='$page_name&start=$back&limit=$limit'><< PREV</a></td>";
 } //// Let us display the page links at  center. We will not display the current page as a link //?>   <?php $i=0;
$l=1;
for($i=0;
$i < $nume;
$i=$i+$limit){if($i <> $eu){if($srx == "50"){$srx=0;
 echo '</tr><tr>';
}?>   
                     <td width="25px" align="center" class="paiging"><?php echo " <a href='$page_name&start=$i&limit=$limit'>$l</a>";
?></td>
                     <?php }else{echo "<td align='center' width='25px'><span class='paiging_red'>$l</td>";
}/// Current page is not displayed as link and given font color red$l=$l+1;
$srx=$srx+1;
}?>   <?php 
 ///////////// If we are not in the last page then Next link will be displayed. Here we check that 
																					  
/////if($this1 < $nume) { echo "<td  align='right' class='paiging' width='60px'><a href='$page_name&start=$next&limit=$limit'>NEXT >></a></td>";} 
					  
					  ?>
                  </tr>
               </table>
            </td>
         </tr>
         <tr>
            <td height="28"><?php include("bot.php");
?></td>
         </tr>
      </table>
   </body>
</html>
<?php }?>