/
home
/
sjslayjy
/
public_html
/
assets
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Customer'); ?> <?php $__env->startPush('plugin-styles'); ?> <?php echo Html::style('//cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css'); ?> <?php echo Html::style('//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css'); ?> <style type="text/css"> .table th, .table td { white-space: break-spaces !important; } </style> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="<?php echo e(url('')); ?>">Home</a> </li> /<li class="active">Customers</li> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-12"> <h3 class="header smaller lighter blue">Customers</h3> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> Results for "Latest Registered Customers" <div class="widget-toolbar no-border"> <a class="btn btn-xs bigger btn-danger dropdown-toggle" data-toggle="modal" href='#addCustomerModal'> Add <i class="ace-icon fa fa-plus icon-on-right"></i> </a> </div> </div> <!-- div.table-responsive --> <!-- div.dataTables_borderWrap --> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table id="dynamic_table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>ID</th> <th>Circle</th> <th>Customer Code</th> <th>Customer Name</th> </tr> </thead> <tbody> <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr id="tr_<?php echo e($customer->id); ?>"> <td><?php echo e($customer->id); ?></td> <td><?php echo e($customer->Circle); ?></td> <td><?php echo e($customer->Cust_Code); ?></td> <td><?php echo e($customer->Cust_Name); ?></td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <!-- Add Role Modal --> <div class="modal fade" id="addCustomerModal"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add New Customer</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <form action="" role="form" id="addCustomerForm"> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="login_id">Circle</label> <input type="text" class="form-control" name="circle" id="circle" placeholder="Enter Circle"> <span class="text text-danger error" id="add_circle_error" style="display: none;"></span> </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="customer_code">Customer Code</label> <input type="text" class="form-control" name="customer_code" id="customer_code" placeholder="Enter Customer Code"> <span class="text text-danger error" id="add_customer_code_error" style="display: none;"></span> </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="customer_name">Customer Name</label> <input type="text" class="form-control" name="customer_name" id="customer_name" placeholder="Enter Customer Name"> <span class="text text-danger error" id="add_customer_name_error" style="display: none;"></span> </div> </div> </div> </div> <div class="modal-footer" id="modal_footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" id="addCustomerBtn" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> <!-- Add Role Modal --> <?php $__env->stopSection(); ?> <?php $__env->startPush('custom-scripts'); ?> <?php echo Html::script('js/app.js'); ?> <?php echo Html::script('/assets/js/dashboard.js'); ?> <?php echo Html::script('//cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js'); ?> <script> jQuery(function($) { $('#dynamic_table').DataTable( { bAutoWidth: false, "aaSorting": [], }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $('#addCustomerBtn').click(function(e){ e.preventDefault(); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); $.ajax({ url: "<?php echo e(url('admin/add-customer')); ?>", method: 'POST', data: $('#addCustomerForm').serialize(), success: function(data){ if(data.errors){ handleError(data); } else{ swal({ title: "Success!", text: data.message, type: "success" }).then(function() { window.location.reload(); }); } } }); }); }); function showError(id,error){ if(typeof(error) === "undefined"){ $('#'+id).hide(); }else{ $('#'+id).show(); $('#'+id).text(error); } } function handleError(data) { if(data.status == 1) { $.each(data.errors, function(key, error){ $('#add_'+key+'_error').show(); $('#add_'+key+'_error').text(error); }); } else { swal({ title: "Error!", text: data.errors, type: "error" }).then(function() { window.location.reload(); }); } } </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/assets/resources/views/master/customers.blade.php ENDPATH**/ ?>