<?php $__env->startSection('content'); ?>


<div class="content" id="content">			
	<div class="overlay"></div>			
	
<?php echo $__env->make('admin.includes.topbar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
	
	<!-- main content -->
	<div class="main-content">

	<?php if(Entrust::can('bookings_add')): ?>

		<div class="manage_buttons">
			<div class="row">
				<div class="col-md-12">
			
				</div>
			</div>
		</div>


		<div class="row">
			<div class="col-md-12">


					<!-- panel -->

		<div class="panel panel-piluku">
			<div class="panel-heading">
				<h3 class="panel-title">
					Add Booking
					<span class="panel-options">
						<a href="#" class="panel-refresh">
							<i class="icon ti-reload"></i>
						</a>
						<a href="#" class="panel-minimize">
							<i class="icon ti-angle-up"></i>
						</a>
						<a href="#" class="panel-close">
							<i class="icon ti-close"></i>
						</a>
					</span>
				</h3>
			</div>

<?php if(Session::has('error')): ?>
<div class="alert bg-danger text-white">
              <?php echo Session::get('success'); ?>

            </div>

<?php endif; ?>

<?php if(Session::has('success')): ?>
<div class="alert bg-success text-white">
              <?php echo Session::get('success'); ?>

            </div>

<?php endif; ?>





			<div class="panel-body">
					<?php echo Form::open(array('route' => 'insertbooking', 'files'=>true, 'id' => 'form-a', 'class' => 'form form-horizontal')); ?>

		


					<div class="form-group">
						<label class="col-sm-2 control-label" for="inline-suggestions">Booking Voucher #:</label>
						<div class="col-sm-8">
							<input name="booking_no" type="text" required class="form-control"  />
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-2 control-label">Hotel:</label>
						<div class="col-sm-8">
							<select class="name_search form-control" name="hotelid" data-validation="required" required data-validation-error-msg="Please make a choice">
							<?php foreach($hotels as $hotel): ?>
								<option value="<?php echo $hotel->id; ?>"><?php echo $hotel->name; ?></option>
							<?php endforeach; ?>
								
							</select>
						</div>
					</div>


					<div class="form-group">
						<label class="col-sm-2 control-label" for="inline-suggestions">Special Request:</label>
						<div class="col-sm-8">
							<input name="special_request" type="text" class="form-control"  />
						</div>
					</div>






					<div class="form-group">
						<label class="col-sm-2 control-label" for="inline-suggestions">Remarks:</label>
						<div class="col-sm-8">
							<input name="remarks" type="text" class="form-control"  />
						</div>
					</div>








				
					





					
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-8">
					<input type="submit" class="btn btn-success">
					<input type="reset" class="btn btn-danger">
				</div>
			</div>
		</form>
	</div>
</div>
<!-- /panel -->

	<?php endif; ?>

				<!-- panel -->
				<div class="panel panel-piluku panel-users">

					<div class="panel-heading">
						<h3 class="panel-title">
							List of Bookings
							<span class="panel-options">
								<a href="#" class="panel-refresh">
									<i class="icon ti-reload"></i> 
								</a>
								<a href="#" class="panel-minimize">
									<i class="icon ti-angle-up"></i> 
								</a>
								<a href="#" class="panel-close">
									<i class="icon ti-close"></i> 
								</a>
							</span>
						</h3>
					</div>
					<div class="panel-body nopadding">
						<div class="table-responsive">
							<table class="table table-hover" style="font-size: 12px;">
								<thead>
									<tr>
										<th>#</th>
						                <th>Booking Voucher #</th>
						                <th>Hotel Name</th>
						                <th>Lead Guest</th>
						                <th>By:</th>
						                <th>Created Date</th>
										<th>&nbsp;</th>
									
									</tr>
								</thead>
								<tbody>
								<?php 

								$count = count($bookings) + 1;


								 ?>
								     <?php foreach($bookings as $booking): ?>
								     <?php 
								     $count = $count - 1;

								      ?>
									<tr class="table-row">
										<td><?php echo $count; ?></td>
						                <td><?php echo $booking->booking_no; ?></td>
						                <td><?php echo $booking->hotel_name; ?></td>
						                <?php if($booking->lead): ?>
						                <td><?php echo $booking->lead; ?></td>
						                <?php else: ?>
						                <td>
						                <a style="font-size: 9px;" href="<?php echo URL('admin/bookings/clients/'); ?>/<?php echo $booking->id; ?>" class="btn btn-primary">SELECT</a>
						                </td>
						                <?php endif; ?>

						                <td><?php echo AppHelper::getUser($booking->user_id); ?></td>
						                <td><?php echo Carbon\Carbon::parse($booking->created_at)->format('d-m-Y H:m:i'); ?></td>
					
						                

										<td>
									
										<a style="font-size: 9px;" href="<?php echo URL('admin/bookings'); ?>/<?php echo $booking->id; ?>" class="btn btn-green"><i class="ion ion-edit"></i></a>

										<a style="font-size: 9px;" href="<?php echo URL('admin/bookings/rooms/'); ?>/<?php echo $booking->id; ?>" class="btn btn-primary">Rooms</a>



										<a style="font-size: 9px;" href="<?php echo URL('admin/bookings/clients/'); ?>/<?php echo $booking->id; ?>" class="btn btn-primary">Customers</a>

								

										<a style="font-size: 9px;" href="<?php echo URL('admin/bookings/voucher/add'); ?>/<?php echo $booking->id; ?>" class="btn btn-primary">Booking Voucher</a>

										<a  style="font-size: 9px;" href="<?php echo URL('admin/bookings/confirmation/add'); ?>/<?php echo $booking->id; ?>" class="btn btn-primary">Booking Confirmation</a>
										
										<?php if(Entrust::can('bookings_delete')): ?>
										<a style="font-size: 9px;" href="<?php echo URL('admin/bookings/delete'); ?>/<?php echo $booking->id; ?>" class="btn btn-red"><i class="ion ion-ios-trash-outline"></i></a>
										<?php endif; ?>
								
										</td>
											
									</tr>
									<?php endforeach; ?>
									
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<!-- /panel -->
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<ul class="pagination small-pagination pull-right">
					
				</ul>
			</div>
		</div>
	</div>
	<!-- /main content -->		

</div>  
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>