<?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('payments_add')): ?>


    <!-- panel -->

    <div class="panel panel-piluku">
      <div class="panel-heading">
        <h3 class="panel-title">
          Payments Management
          <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' => 'insertpayment', 'id' => 'form-a', 'class' => 'form form-horizontal')); ?>

                <div class="form-group">
            <label class="col-sm-2 control-label">Title:</label>
            <div class="col-sm-8">
              <select class="name_search form-control" name="title" data-validation="required" required data-validation-error-msg="Please make a choice">
      <option value="Mr.">Mr.</option>
      <option value="Ms.">Ms.</option>
      <option value="Mrs.">Mrs.</option>
      <option value="Dr.">Dr.</option>
                    </select>
                  </div>
            </div>

      


          <div class="form-group">
            					<label class="col-sm-2 control-label">Customer Name:</label>
					                <div class="col-sm-8">
					                  
					                  <input type="text" class="form-control" required name="customer_name" >
					                </div>
        </div>


        <div class="form-group">
            					<label class="col-sm-2 control-label">Customer Email:</label>
					                <div class="col-sm-8">
					                  
					                  <input type="text" class="form-control" required name="customer_email" >
					                </div>
        </div>



         <div class="form-group">
            					<label class="col-sm-2 control-label">Invoice No.:</label>
					                <div class="col-sm-8">
					                  
					                  <input type="text" class="form-control" required name="invoice_no" >
					                </div>
        </div>




      
          <div class="form-group">
						<label class="col-sm-2 control-label">Currency:</label>
						<div class="col-sm-8">
							<select class="name_search form-control" name="currency" data-validation="required" required data-validation-error-msg="Please make a choice">
							
								<option value="USD">USD</option>
								<option value="MVR">MVR</option>
						
							</select>
						</div>
			</div>




        <div class="form-group">
            					<label class="col-sm-2 control-label">Amount</label>
					                <div class="col-sm-8">
					                  
					                  <input type="text" id="amount" class="form-control" required name="amount" >
					                </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 Payments
              <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: 11px;">
								<thead>
									<tr>
                    <th>#</th>
										<th>Customer</th>
										<th>Email</th>
										<th>Invoice No.</th>
						                <th>Amount</th>
						                <th>Currency</th>
						                <th>Status</th>
						                <th>Reference</th>
						                <th>By:</th>
						                <th>Created Date</th>
										<th>&nbsp;</th>
									
									</tr>
								</thead>
								<tbody>
                <?php 
                    $count = count($payments) + 1;
                ?>
								     <?php foreach($payments as $payment): ?>
                      <?php 
                     $count = $count - 1;
                     ?>
									<tr class="table-row">
                    <td><?php echo $count; ?></td>
										<td><?php echo $payment->customer_name; ?></td>
										<td><?php echo $payment->customer_email; ?></td>
										<td><?php echo $payment->invoice_no; ?></td>
	
						                <td><?php echo $payment->amount; ?></td>
						                <td><?php echo $payment->currency; ?></td>
						                <td><?php echo $payment->status; ?></td>
						                <td><?php echo $payment->reference_no; ?></td>
						                <td><?php echo AppHelper::getUser($payment->user_id); ?></td>
                            <td><?php echo Carbon\Carbon::parse($payment->created_at)->format('d-m-Y H:m:i'); ?></td>
					
						                

										<td>
									
										<a href="<?php echo 'https://alltravels.mv/pay/'.$payment->payment_slug; ?>" target="_blank"  class="btn btn-green">URL</a>
										<?php if(Entrust::can('payments_delete')): ?>

										<a href="<?php echo URL('admin/payments/delete'); ?>/<?php echo $payment->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>
<!-- /main content -->        
<?php $__env->stopSection(); ?>


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