Viewing file: 6cde2cae6b6ecba7eaaf26fc6f541dfe.php (8.1 KB) -rwxr--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $__env->startSection('title', trans('admin.numbers.number')); ?>
<?php $__env->startSection('extra-css'); ?> <link rel="stylesheet" href="<?php echo e(asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css')); ?>"> <link rel="stylesheet" href="<?php echo e(asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css')); ?>"> <?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h2 class="card-title"><?php echo app('translator')->get('admin.numbers.list'); ?> <i data-toggle="tooltip" data-placement="right" class="fa fa-question-circle alert-tooltip" title="Admin can create unlimited number for their customer. Also admin can sell them and can make a number free for his customer."></i> </h2> <div class="float-right"> <a class="btn btn-primary" href="<?php echo e(route('admin.numbers.create')); ?>"><?php echo app('translator')->get('admin.form.button.new'); ?></a> <a class="btn btn-info" href="<?php echo e(route('admin.number.requests')); ?>"><?php echo app('translator')->get('admin.form.button.request'); ?> <span class="diff-counter numberreq_counter_2">0</span> </a> </div> </div> <!-- /.card-header --> <div class="card-body"> <table id="numbers" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th><?php echo app('translator')->get('admin.table.number'); ?></th> <th><?php echo app('translator')->get('admin.form.platform'); ?></th> <th><?php echo app('translator')->get('Capabilities'); ?></th> <th><?php echo app('translator')->get('admin.form.purchase_price'); ?></th> <th><?php echo app('translator')->get('admin.form.sell_price'); ?></th> <th><?php echo app('translator')->get('admin.form.status'); ?></th> <th><?php echo app('translator')->get('admin.table.created_at'); ?></th> <th><?php echo app('translator')->get('admin.table.action'); ?></th> </tr> </thead>
</table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> </div>
<div class="modal fade" id="addSubstrack" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered modal-md" role="document"> <div class="modal-content"> <form action="<?php echo e(route('admin.customer.number.assign')); ?>" method="post"> <?php echo csrf_field(); ?> <input type="hidden" name="id"> <input type="hidden" name="old_customer_id" id="oldId"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle"><?php echo e(trans('admin.assign')); ?></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="form-group mt-2"> <label for=""><?php echo e(trans('admin.select_customer')); ?></label> <select name="customer_id" class="form-control customer-select" id="customer_id"> <?php if(isset($customers) && $customers): ?> <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($customer->id); ?>"><?php echo e($customer->full_name); ?> ( <?php echo e($customer->email); ?> )</option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </select> </div> <div> <span id="error" class="text-danger"></span> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.close')); ?></button> <button type="submit" id="assignBtn" class="btn btn-primary" disabled><?php echo e(trans('admin.assign')); ?></button> </div> </form> </div> </div> </div> <!-- /.row --> </section> <!-- /.content --> <?php $__env->stopSection(); ?>
<?php $__env->startSection('extra-scripts'); ?> <script src="<?php echo e(asset('plugins/datatables/jquery.dataTables.min.js')); ?>"></script> <script src="<?php echo e(asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js')); ?>"></script> <script src="<?php echo e(asset('plugins/datatables-responsive/js/dataTables.responsive.min.js')); ?>"></script> <script src="<?php echo e(asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js')); ?>"></script>
<script> "use strict"; $('#numbers').DataTable({ processing: true, serverSide: true, responsive:true, ajax:'<?php echo e(route('admin.number.get.all')); ?>', columns: [ { "data": "number" }, { "data": "from" }, { "data": "capabilities" }, { "data": "purch_price" }, { "data": "sell_price" }, { "data": "status" }, { "data": "created_at" }, { "data": "action" }, ] }); </script>
<script> $(document).on('click', '.addSubstract', function (e) { e.preventDefault(); const number_id = $(this).attr('data-number_id'); const customer_id = $(this).attr('data-customer_id'); $('input[name=id]').val(number_id); $('#oldId').val(customer_id); $('#addSubstrack').modal('show'); }); $(document).on('change','#customer_id',function(){ let value = $(this).val(); let customer_id = $('#oldId').val();
let error = '' if (value == customer_id) { error = "This number is already assigned to the selected customer." }else{ error = '' }
if (value && value !== customer_id) { $('#assignBtn').prop('disabled', false); } else { $('#assignBtn').prop('disabled', true); }
$('#error').text(error); }) $(document).ready(function() { $('#customer_id').select2({ placeholder: "Select a customer", allowClear: true, width: '100%', }); }); </script> <?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/picotech/domains/test.sms.picotech.app/public_html/resources/views/admin/numbers/index.blade.php ENDPATH**/ ?>
|