File "booking.php"
Full Path: /home/ichhrkpd/public_html/idcm_old/application/views/booking.php
File size: 5.2 KB
MIME-type: text/html
Charset: utf-8
<?php
require_once('add_edit_booking.php');
$booking_data = isset($booking_data)?$booking_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-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Booking</h3>
<button class="btn btn-primary btn-xs pull-right" type="button"
data-booking_id="N"
data-edit= "N"
data-toggle="modal"
data-target="#add_edit_booking" >
<i class="fa fa-plus"></i> Add Booking
</button>
</div><!-- /.box-header -->
<div class="box-body"><div class="table-responsive">
<table id="example" class="table table-bordered table-hover">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Contact No.</th>
<th>In/Out</th>
<th>Type</th>
<th>Room#</th>
<th>Night#</th>
<th>Adult#</th>
<th>Child#</th>
<th>Booking Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($booking_data as $b){
$date1=date_create($b->checkInDate);
$date2=date_create($b->checkOutDate);
$date3=date_create($b->creation_date);
$in = date_format($date1,"d-m-Y");
$out = date_format($date2,"d-m-Y");
$booking_date = date_format($date3,"d-m-Y h:i A");
if($b->status == 'P'){
$status = "<span class='badge bg-red'>Pending</span>";
}elseif($b->status == 'A'){
$status = "<span class='badge bg-green'>Approved</span>";
}elseif($b->status == 'C'){
$status = "<span class='badge bg-red'>Cancelled</span>";
}elseif($b->status == 'R'){
$status = "<span class='badge bg-yellow'>Archived</span>";
}else{
$status = "<span class='badge bg-yellow'>--</span>";
}
//$newDateTime = date('h:i A', strtotime($booking_date));yellow
?>
<tr>
<td><?php echo $b->booking_id;?></td>
<td><?php echo $b->pname;?></td>
<td><?php echo $b->email;?></td>
<td><?php echo $b->contact_no;?></td>
<td><?php echo $in . '<br>' . $out;?></td>
<td><?php echo $b->rtype_name;?></td>
<td><?php echo $b->num_room;?></td>
<td><?php echo $b->num_night;?></td>
<td><?php echo $b->num_adult;?></td>
<td><?php echo $b->num_child;?></td>
<td nowrap="nowrap"><?php echo $booking_date;?></td>
<td><?php echo $status;?></td>
<td nowrap="nowrap">
<a class="btn-xs btn-success" type="button"
data-booking_id="<?php echo $b->booking_id; ?>"
data-edit= "Y"
data-toggle="modal"
data-target="#add_edit_booking" >
<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>