<?php session_start(); ?> <!-- session start -->
<?php include("../include/config.php"); ?> <!-- database connection -->
<?php include("../include/connect_url.php"); ?> <!-- connection url/link folder -->
<?php include("../include/date_time.php"); ?> <!-- date & time format -->
<?php include("../database/account.php"); ?> <!-- query database account -->
<?php include("../include/lang.php"); ?> <!-- language -->
<?php include("../include/session_login.php"); ?> <!-- session login -->

<!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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php echo $lang['Room']; ?></title>

<link rel="shortcut icon" href="<?php echo $connect_url_data; ?>/favicon.ico" />

<link href="<?php echo $connect_url_data; ?>/css/styles.css" rel="stylesheet" type="text/css" />
<!--[if IE]> <link href="<?php echo $connect_url_data; ?>/css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->
<link rel="stylesheet" href="<?php echo $connect_url_data; ?>/font/font-awesome-4.3.0/css/font-awesome.min.css">

<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/download/jquery183.js"></script> 
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/download/jquery192.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/charts/jquery.sparkline.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.collapsible.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.breadcrumbs.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/plugins/ui/jquery.easytabs.min.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data; ?>/js/files/functions_blank_no_sidebar.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data ?>/datatable/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo $connect_url_data ?>/datatable/js/columnFilter.js"></script>

<script type="text/javascript" src="<?php echo $connect_url_data ?>/js/files/bootstrap.js"></script>

</head>

<body>

<!-- header-->
<?php include("../template/header.php"); ?>

<!-- sidebar-->
<?php include("../template/sidebar.php"); ?>
   
<!-- Content begins -->
<div id="content">
    
    <!-- Breadcrumbs line -->
    <div class="breadLine">
        <div class="bc">
            <ul id="breadcrumbs" class="breadcrumbs">
                       <li><a href="<?php echo $connect_url_data; ?>/dashboard"><?php echo $lang['Dashboard']; ?></a></li>
                <li class="current"><a href="#"><?php echo $lang['Room']; ?></a></li>
            </ul>
        </div>
        
<!-- breaklink -->
<?php include("../menu/breadlink.php"); ?>
	
    </div>
    
    <!-- Main content -->
    <div class="wrapper">
    
  <div class="widget">
            <div class="whead">
                <h6><span class="fa fa-minus-square" style="margin-top:-2px;"></span>&nbsp; <?php echo $lang['Room']; ?></h6>
                <div class="titleOpt">
                    <a href="<?php echo $connect_url_data; ?>/create-room" style="color:#3e76af;"><span class="icos-add" ></span>&nbsp;<u><?php echo $lang['Create Room']; ?></u></a>
                </div>
            </div>
											
<div style="position:relative;height:1px;left:-15px;float:right;top:12px;z-index:10;">
  <a class="buttonM bBlue" href="javascript:void(0);" onclick="oTable.fnReloadAjax();" style="border-radius:5px;"><span class="fa fa-refresh"></span><span><?php echo $lang['Refresh']; ?></span></a>
</div>

<script type="text/javascript" charset="utf-8">      
$(document).ready(function () {
  
  oTable =$('#room-datatable').dataTable(
  {
    
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
      
if ( aData[0]){$('td:eq(0)', nRow).html( '<center><i class="fa fa-minus-square"></i></center>');}

if ( aData[0]){$('td:eq(7)', nRow).html("<center><a href='#' onclick=\"window.open('<?php echo $connect_url_data; ?>/room/e/"+ aData[0] +"', 'popup1',  'status,menubar=0,resizable=0,scrollbars=1,top=50,left=50,width=1220,height=550')\" class='btn' rel='tooltip' title='Edit'><i class='fa fa-edit'></i> <?php echo $lang['Edit']; ?></a> </center>");}
      
     },

"sPaginationType": "full_numbers",
"aaSorting": [[ 2, "asc" ]],
"sDom": '<"top"f>rt<"bottom"i><"bottom"p>',
"bAutoWidth": false,
"oLanguage": {
"sSearch": "<i class='fa fa-search' style='margin-left:20px;'></i>"
},
"sAjaxSource": "<?php echo $connect_url_data; ?>/room/room-datatable.php",

"aoColumns": [
    { "mData": null },
           null,
           null,
           null,
	   null,
	   null,
	   null,
    { "mData": null },
           
         ]          
  });

$('.dataTables_filter input').attr("placeholder", "<?php echo $lang['Search Keywords']; ?>");

});
//end ready function

 $.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
{
    if ( sNewSource !== undefined && sNewSource !== null ) {
        oSettings.sAjaxSource = sNewSource;
    }
 
    // Server-side processing should just call fnDraw
    if ( oSettings.oFeatures.bServerSide ) {
        this.fnDraw();
        return;
    }
 
    this.oApi._fnProcessingDisplay( oSettings, true );
    var that = this;
    var iStart = oSettings._iDisplayStart;
    var aData = [];
 
    this.oApi._fnServerParams( oSettings, aData );
 
    oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aData, function(json) {
        /* Clear the old information from the table */
        that.oApi._fnClearTable( oSettings );
 
        /* Got the data - add it to the table */
        var aData =  (oSettings.sAjaxDataProp !== "") ?
            that.oApi._fnGetObjectDataFn( oSettings.sAjaxDataProp )( json ) : json;
 
        for ( var i=0 ; i<aData.length ; i++ )
        {
            that.oApi._fnAddData( oSettings, aData[i] );
        }
         
        oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
 
        that.fnDraw();
 
        if ( bStandingRedraw === true )
        {
            oSettings._iDisplayStart = iStart;
            that.oApi._fnCalculateEnd( oSettings );
            that.fnDraw( false );
        }
 
        that.oApi._fnProcessingDisplay( oSettings, false );
 
        /* Callback room function - for event handlers etc */
        if ( typeof fnCallback == 'function' && fnCallback !== null )
        {
            fnCallback( oSettings );
        }
    }, oSettings );
};
</script>

<div class="shownpars">					
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dTable" id="room-datatable">
<thead>
    <tr>
	<th width="3%"></th>
	<th width="11%"><?php echo $lang['Room No']; ?></th>
	<th width="20%"><?php echo $lang['Room Name']; ?></th>
	<th width="12%"><?php echo $lang['Room Type']; ?></th>
	<th width="25%"><?php echo $lang['Beds']; ?></th>
	<th width="12%"><?php echo $lang['Price']; ?></th>
	<th width="10%"><?php echo $lang['Status']; ?></th>
	<th width="9%"><?php echo $lang['Action']; ?></th>
    </tr>	
</thead>
<tbody>

</tbody>
</table>
</div>

	    
	    
        </div>
	
    </div>
    <!-- Main content ends -->
    
</div>
<!-- Content ends -->  
             
</body>
</html>
