
<?php $__env->startSection('title'); ?>
   Customer Management
<?php $__env->stopSection(); ?>
<?php $__env->startPush('css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('backend/plugins/select2.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('myfile/backend/assets/datepicker/zebra_datepicker.min.css')); ?>" type="text/css">
	<link rel="stylesheet" href="<?php echo e(asset('myfile/backend/assets/datepicker/examples.css')); ?>" type="text/css">
	<style>
		#search-btn{
			margin-top:24px;
		}
	</style>
<?php $__env->stopPush(); ?>
<!-- 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-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>Manage Customer
                                 <a href="<?php echo e(route('account.cpi')); ?>" class="btn btn-xs btn-primary"> Payment</a>
                                  <a href="<?php echo e(route('supplier.create')); ?>" class="btn btn-xs btn-primary">New Customer</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="">
                            <form id="demo-form2" action="<?php echo e(route('supplier.supplier-records')); ?>" method="post" data-parsley-validate class="form" autocomplete="off" >
								<?php echo e(csrf_field()); ?>

								<?php echo e(method_field('Post')); ?>

								<div class="row">
									<div class="col-sm-1"></div>
									<div class="col-sm-3">
										<div class="form-group">
											<label>Customer List </label>
											<select name="supplier" id="supplier_id" class="form-control input-sm select2">
												<option value="All">All</option>
												<?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
													<option value="<?php echo e($pr->id); ?>" <?php echo e(request()->supplier == $pr->id ? 'selected' : ''); ?> ><?php echo e($pr->name); ?> </option>
												<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
											</select>
										</div>
									</div>
									<div class="col-sm-2">
										<div class="form-group">
											<label>From</label>
											<input id="datepicker-range-start" type="text" name="from_date"  class="form-control" data-zdp_readonly_element="false" value="<?php echo e(request()->from_date != '' ? date('d-m-Y',strtotime(request()->from_date)) : ''); ?>" >
										</div>
									</div>
									<div class="col-sm-2">
										<div class="form-group">
											<label>To</label>
											<input id="datepicker-range-end" type="text" name="to_date"  class="form-control" data-zdp_readonly_element="false" value="<?php echo e(request()->to_date != '' ? date('d-m-Y',strtotime(request()->to_date)) : ''); ?>">
										</div>
									</div>
									<div class="col-sm-1">
										<div class="form-group">
											<button class="btn btn-primary btn-xs" id="search-btn">
												<i class="ace-icon fa fa-search fa-2x icon-only"></i>
											</button>
										</div>
									</div>
								</div>
							</form>
							<div class="text-center">
							    <p>From: <?php echo e(date('d-m-Y',strtotime($from_date))); ?> To <?php echo e(date('d-m-Y',strtotime($to_date))); ?></p>
							</div>
							<hr/>
                            <div class="x_content table-responsive">
                                <table class="table table-condensed table-bordered " id="">
                                    <thead>
                                    <tr class="bg-primary">
                                        <th>SL</th>
                                        <th>Customer</th>
                                        <th>Phone</th>
                                        <th>Date</th>
                                        <th>Total Price</th>
                                        <th>Payment</th>
                                        <th>Due</th>
                                        <th>Previous Due</th>
                                        <th>Total Due</th>
                                        <th>Action</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php $__currentLoopData = $records; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i=>$pc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <th> <?php echo e($i+1); ?></th>
                                            <td> <?php echo e($pc->supplier->name); ?></td>
                                            <td> <?php echo e($pc->supplier->phone); ?></td>
                                            <td> <?php echo e(date('d-m-Y',strtotime($pc->transaction_date))); ?></td>
                                            <td> <?php echo e($pc->total_price); ?></td>
                                            <td> <?php echo e($pc->payment_amount); ?></td>
                                            <td> <?php echo e($pc->due_amount); ?></td>
                                            <td> <?php echo e($pc->previous_due); ?></td>
                                            <td> <?php echo e($pc->total_due); ?></td>
                                            <td>
                                                <div class="row">
                                                    <div class="col-md-4">
                                                        <!--<form action="http://api.greenweb.com.bd/api.php" method="post">-->
                                                        <!--    <input type="hidden" name="token" value="7a787dd847f4650b1ba1adfb8771c733">-->
                                                        <!--    <input type="hidden" name="to" value="<?php echo e($pc->supplier->phone); ?>">-->
                                                        <!--    <input type="hidden" name="message" value="<?php echo "Dear supplier invoice total is :".$pc->total_price.'/=, payment:'.$pc->payment_amount.'/=, due: '.$pc->due_amount.'/=, previous due: '.$pc->previous_due.'/= total due: '.$pc->total_due.'. Thank and best regards from '.about()->english_name.', '.about()->phone.', '.about()->email.', '.about()->web ?>">-->
                                                        <!--    <?php echo e(csrf_field()); ?>-->
                                                        <!--    <button type="submit" class="btn btn-xs btn-primary" onclick="return confirm('do you want to send sms ?')" ><i class="fa fa-envelope-o"></i>  Send</button>-->
                                                        <!--</form>-->
                                                        <form action="<?php echo e(route('supplier.supplier_record_send',$pc->id)); ?>" method="Get">
                                                            <button type="submit" class="btn btn-xs btn-primary" onclick="return confirm('do you want to send sms ?')" ><i class="fa fa-envelope-o"></i>  Send</button>
                                                        </form>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /page content -->
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
   <script src="<?php echo e(asset('backend/plugins/select2.min.js')); ?>"></script>
    <!-- Jquery Plugin For Date Calender-->
    <script type="text/javascript" src="<?php echo e(asset('myfile/backend/assets/datepicker/zebra_datepicker.src.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('myfile/backend/assets/datepicker/examples.js')); ?>"></script>
   <script>
       $(document).ready(function() {
	        // select2 section
            $('.select2').select2()	;
       })
   </script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>