<?php
require_once('add_edit_room_type.php');
$rtype_data = isset($rtype_data)?$rtype_data:array();
$i = 1;
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Hotel Aristocrat Inn Ltd.
</h1>
</section>
<section class="content">
<div class="row">
<?php //GPrint($rtype_data);?>
<div class="col-xs-9">
<div class="box">
<div class="box-header">
<h3 class="box-title">Room Type</h3>
<button class="btn btn-primary btn-xs pull-right" type="button"
data-rtype_id="N"
data-edit= "N"
data-toggle="modal"
data-target="#add_edit_room_type" >
<i class="fa fa-plus"></i> Add Room Type
</button>
</div><!-- /.box-header -->
<div class="box-body"><div class="table-responsive">
<table id="example" class="table table-bordered table-hover">
<thead>
<tr>
<th>Sl#</th>
<th>Name</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($rtype_data as $r){
$status = '';
if($r->status == 'A'){
$status = "<span class='badge bg-green'>Active</span>";
}else{
$status = "<span class='badge bg-red'>Inactive</span>";
}
?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $r->rtype_name;?></td>
<td><?php echo $status;?></td>
<td nowrap="nowrap">
<a class="btn-xs btn-success" type="button"
data-rtype_id="<?php echo $r->rtype_id; ?>"
data-edit= "Y"
data-toggle="modal"
data-target="#add_edit_room_type" >
<i class="fa fa-edit"></i>
</a>
</td>
</tr>
<?php $i++;}?>
</tbody>
</table></div>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div>
<script src="<?php echo base_url();?>lib/bootstrap/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>lib/bootstrap/js/dataTables.bootstrap.min.js"></script>
<script>
$(document).ready(function() {
$('#example').dataTable({
/* Disable initial sort */
"aaSorting": []
});
} );
</script>