
<?php $__env->startSection('title'); ?>
    Bank Management
<?php $__env->stopSection(); ?>
<?php $__env->startSection('css'); ?>

<?php $__env->stopSection(); ?>
<!-- page content -->
<?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-md-8 col-sm-8 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>Bank Management</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('bank.list')); ?>" id="searchForm" method="Get">
								<div class="col-sm-3">
									<select class="form-control" name="show" id="show">
										<option value="<?php echo e($banks->count()); ?>"><?php echo e($banks->count()); ?></option>
										<option value="10">10</option>
										<option value="25">25</option>
										<option value="50">50</option>
										<option value="100">100</option>
										<option value="250">250</option>
										<option value="500">500</option>
									</select>
								</div>
								<div class="col-sm-6"></div>
								<div class="col-sm-3">
									<div class="input-group">
										<input type="text" id="myInput" class="form-control input-s" 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>Bank Name</th>
										<th>Branch Name</th>
										<th>Account No</th>
										<th>Bank Location</th>
										<th>Action</th>
									</tr>
								</thead>
								<tbody>
									<?php $__currentLoopData = $banks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$bran): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
										<tr>
											<td><?php echo e($key + 1); ?></td>
											<td><a href="<?php echo e(route('transaction.show',$bran->id)); ?>"><?php echo e($bran->bank_name); ?></a></td>
											<td><?php echo e($bran->branch_name); ?></td>
											<td><?php echo e($bran->account_no); ?></td>
											<td><?php echo e($bran->bank_location); ?></td>
											<td>
											
												<a  href="<?php echo e(route('bank.edit',$bran->id)); ?>" title="Edit Bank Information"><i class="ace-icon fa fa-edit bigger-130"></i></a>
											
											<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('bank-name-delete')): ?>
												<a  class="red" href="#" data-toggle="tooltip" title="Delete Bank Information!" onclick="deleteCategory(<?php echo e($bran->id); ?>)"><i class="fa fa-trash-o bigger-130" ></i></a>
												<form id="delete-form-<?php echo e($bran->id); ?>" action="<?php echo e(route('bank.delete',$bran->id)); ?>" method="POST" style="display: none;">
													@csrf
													@method('DELETE')
												</form> 
											<?php endif; ?>
											</td>
										</tr>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</tbody>
							</table>
							<div class="text-center">
								<?php echo e($banks->links()); ?>

							</div>
						</div>
                    </div>
                    </div>
                </div>
				<div class="col-xs-4 col-sm-4 col-xs-12">
					<div class="x_panel">
                        <div class="x_title">
                            <h2>Bank Information Entry</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">
							<form action="<?php echo e(route('bank.store')); ?>" method="post" class="form-horizontal" role="form" >
									<?php echo e(csrf_field()); ?>

								<div class="form-group">
									<label class="col-sm-4 control-label no-padding-right" for="form-field-1"> Bank Name <span class="red">*</span></label>
									<div class="col-sm-8">
										<input type="text" name="bank_name"  class="form-control input-sm"  value="<?php echo e(old('bank_name')); ?>" placeholder=" Bank Name">
										<p class="error-sms"><?php echo e($errors->first('bank_name')); ?></p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-4 control-label no-padding-right" for="form-field-1-1">Account No <span class="red">*</span></label>
									<div class="col-sm-8">
										<input type="text" id="form-field-1-1" name="account_no" value="<?php echo e(old('account_no')); ?>" placeholder="Bank Account No" class="form-control input-sm">
										<p class="error-sms"><?php echo e($errors->first('account_no')); ?></p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-4 control-label no-padding-right" for="form-field-1-1">Branch Name <span class="red">*</span></label>
									<div class="col-sm-8">
										<input type="text" id="form-field-1-1" name="branch_name" value="<?php echo e(old('branch_name')); ?>" placeholder="Branch Name" class="form-control input-sm">
										<p class="error-sms"><?php echo e($errors->first('branch_name')); ?></p>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-4 control-label no-padding-right" for="form-field-1-1">Location </label>
									<div class="col-sm-8">
										<input type="text" id="form-field-1-1" name="bank_location" value="<?php echo e(old('bank_location')); ?>" placeholder="Branch Location" class="form-control input-sm">
										<p class="error-sms"><?php echo e($errors->first('bank_location')); ?></p>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-12">
									<button class="btn btn-warning" type="reset">Reset</button>
									<button type="submit" class="btn  btn-success">Save</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
<script>
	$(document).ready(function(){
		
		 
	})
	
	function deleteCategory(id) {
		var conf = confirm('Do you want to really Delete?');
		  if(conf == true)
		  {
			document.getElementById('delete-form-'+id).submit();
		  }
        }
	</script>
<?php $__env->stopPush(); ?>									
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>