

<?php $__env->startSection('title', 'Payment'); ?>

<?php $__env->startPush('css'); ?>
	<link rel="stylesheet" href="<?php echo e(asset('backend/plugins/select2.min.css')); ?>">
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
	<div class="right_col" role="main">
        <div class="">
            <div class="clearfix"></div>
            <?php if(Session::has('success')): ?>
                <div class="alert alert-success">
                    <?php echo e(Session::get('success')); ?>

                </div>
            <?php endif; ?>
            <?php if(Session::has('error')): ?>
                <div class="alert alert-danger">
                    <?php echo e(Session::get('error')); ?>

                </div>
            <?php endif; ?>
            <div class="row">
                <div class="col-sm-9">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>
								Employee Payment
								<a href="<?php echo e(route('employee.list')); ?>" class="btn btn-xs btn-primary">Employee List</a>
							</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                       aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
							<div class="row search-section">
								<form action="<?php echo e(route('employee.list')); ?>" id="searchForm" method="Get">
									<div class="col-sm-3">
										<select class="form-control" name="show" id="show">
											<option value="<?php echo e($payments->count()); ?>"><?php echo e($payments->count()); ?></option>
											<?php $__currentLoopData = explode(",",setting()->pdl); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<option value="<?php echo e($d); ?>"><?php echo e($d); ?></option>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</select>
									</div>
									<div class="col-sm-5"></div>
									<div class="col-sm-4">
										<div class="input-group">
											<input type="text" id="myInput" class="form-control" placeholder="Search">
											<span class="input-group-btn">
												<button type="button" class="btn btn-primary">
												<span class="ace-icon fa fa-search icon-on-right bigger-110"></span></button>
											</span>
										</div>
									</div>
								</form> 
							</div>
							<div class="table-content">
								<table id="" class="table table-bordered table-condensed" role="grid" aria-describedby="dynamic-table_info">
									<thead>
										<tr class="bg-primary">
											<th>SL</th>
                                            <th>Pay Date</th>
    										<th>Name</th>
    										<th>Phone</th>
    										<th>Payment</th>
    										<th>Total Paid</th>
    										<th>Note</th>
    										<th>Action</th>
										</tr>
									</thead>
									<tbody>
										<?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<tr>
    											<td><?php echo e($key + 1); ?></td>
                                                <td><?php echo e(date("d-m-Y", strtotime($pay->payment_date))); ?></td>
                                                <td><?php echo e($pay->employee->name); ?></td>
                                                <td><?php echo e($pay->employee->phone); ?></td>
                                                <td><a href="<?php echo e(url('csrs').'?employee_id='.$pay->employee_id.'&report_type=Product'); ?>" target="_blank"><?php echo e($pay->amount); ?></a></td>
                                                <td><a href="<?php echo e(url('csrs').'?employee_id='.$pay->employee_id.'&report_type=Statement'); ?>" target="_blank"><?php echo e($pay->total_payment); ?></a></td>
                                                <td><?php echo e($pay->note); ?></td>
                                                <td><a  href="<?php echo e(route('salary.edit',$pay->id)); ?>" ><i class="ace-icon fa fa-lg fa-edit "></i></a></td>
    										</tr>
										<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
									</tbody>
								</table>
								<div class="text-center">
									<?php echo e($payments->links()); ?>

								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-3">
					<div class="x_panel">
                        <div class="x_title">
                            <h5>Employee Search </h5>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                       aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a></li>
                                        <li><a href="#">Settings 2</a></li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
						<form action="<?php echo e(route('salary.create')); ?>" method="Get" class="form-" role="form" >
							<?php echo e(csrf_field()); ?>

							<div class="form-group">
							    <label>Employee Name</label>
								<select name="employee_name"  class="form-control select2" required>
									<option value="">- Select Employee -</option>
									<?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cus): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
										<option value="<?php echo e($cus->id); ?>" <?php echo e($cus->id == old('employee_name') ? 'selected' : ''); ?>><?php echo e($cus->name); ?> (<?php echo e($cus->phone); ?>)</option>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</select> 
								<p class="error-sms"><?php echo e($errors->first('employee_name')); ?></p>
							</div>
							<div class="form-group">
								<div class="col-sm-12 ">
								  <button class="btn btn-warning" type="reset">Reset</button>
								  <button type="submit"  class="btn btn-primary">Search</button>
								</div>
							</div>
						</form>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
	<script src="<?php echo e(asset('backend/plugins/select2.min.js')); ?>"></script>
	<!-- Print Memo Section-->
	<script src="<?php echo e(asset('myfile/backend/assets/js/print-page.js')); ?>"></script>
<script>
	$(document).ready(function(){
		// select2 section
		$('.select2').select2()	;
		$('.printPage').printPage();
	})
	</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>