Viewing file: index.blade.php (23.3 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.admin')
@section('title') Order @endsection
@section('extra-css') <link rel="stylesheet" href="{{asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css')}}"> <link rel="stylesheet" href="{{asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css')}}"> <style> .custom-modal-dialog { max-width: 1000px !important; }
.table thead th { vertical-align: bottom; border-bottom: 2px solid #dee2e6; font-size: 13px !important; } </style> @endsection
@section('content') <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header order-card-header d-flex"> <h2 class="card-title">@lang('admin.order_request')</h2>
<ul class="nav nav-pills ml-5" id="pills-tab" role="tablist"> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover active order-nav-tabs trigger-first-btn" data-data-order-status={{"all"}} id="pills-all" data-toggle="pill" href="#pills__all" role="tab" aria-controls="pills-all" aria-selected="true">All</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"processing"}} id="pills-processing-tab" data-toggle="pill" href="#pills-processing" role="tab" aria-controls="pills-processing" aria-selected="false">Processing ({{isset($processing_orders)?$processing_orders:'0'}})</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"inprogress"}} id="pills-progress-tab" data-toggle="pill" href="#pills-progress" role="tab" aria-controls="pills-progress" aria-selected="false">In Progress ({{isset($inprogress_orders)?$inprogress_orders:'0'}})</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"pending"}} id="pills-pending-tab" data-toggle="pill" href="#pills-pending" role="tab" aria-controls="pills-pending" aria-selected="false">Pending ({{isset($pending_orders)?$pending_orders:'0'}})</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"completed"}} id="pills-completed-tab" data-toggle="pill" href="#pills-completed" role="tab" aria-controls="pills-completed" aria-selected="false">Completed ({{isset($completed_orders)?$completed_orders:'0'}})</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"partial"}} id="pills-partial-tab" data-toggle="pill" href="#pills-partial" role="tab" aria-controls="pills-partial" aria-selected="false">Partial ({{isset($partial_orders)?$partial_orders:'0'}})</a> </li> <li class="nav-item contact-data"> <a class="nav-link custom nav-link-hover order-nav-tabs" data-data-order-status={{"cancelled"}} id="pills-cancel-tab" data-toggle="pill" href="#pills-cancel" role="tab" aria-controls="pills-cancel" aria-selected="false">Cancelled ({{isset($cancelled_orders)?$cancelled_orders:'0'}})</a> </li> </ul> </div> <!-- /.card-header --> <div class="card-body table-body"> <div class="tab-content" id="myTabContent"> <div class="tab-pane fade show active" id="pills__all" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-all" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div>
<div class="tab-pane fade" id="pills-pending" role="tabpanel" aria-labelledby="pending-tab"> <table id="categories_pending" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> <div class="tab-pane fade" id="pills-completed" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-completed" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> <div class="tab-pane fade" id="pills-progress" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-progress" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> <div class="tab-pane fade" id="pills-cancel" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-cancelled" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> <div class="tab-pane fade" id="pills-partial" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-partial" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> <div class="tab-pane fade" id="pills-processing" role="tabpanel" aria-labelledby="approved-tab"> <table id="categories-processing" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('customer.order_number')</th> <th>@lang('admin.table.name')</th> <th>@lang('customer.order_basic_details')</th> <th>@lang('admin.table.status')</th> <th>@lang('admin.table.action')</th> </tr> </thead> </table> </div> </div> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <div class="modal fade" id="massOrderRequestModal" tabindex="-1" role="dialog" aria-labelledby="massOrdereModalLabel" aria-hidden="true"> <div class="modal-dialog custom-modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="massOrdereModalLabel">@lang('admin.order_request')</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form action="" id="massOrderRequestFrom" method="post"> @csrf <div class="modal-body" id="massOrderRequestService"> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label for="service_id">@lang('admin.order_service')</label> <select class="form-control" name="service_id" id="service_id"> <option selected disabled>@lang('admin.choose_a_option')</option> </select> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label for="status">@lang('admin.form.status')</label> <select class="form-control" name="status" id="status"> <option value="processing">@lang('customer.processing')</option> <option value="inprogress">@lang('customer.inProgress')</option> <option value="completed">@lang('customer.completed')</option> <option value="partial">@lang('customer.partial')</option> </select> </div> </div> </div> <div id="mass-service">
</div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">@lang('admin.form.button.close')</button> <button type="submit" class="btn btn-primary">@lang('admin.form.button.save')</button> </div> </form>
</div> </div> </div> <!-- /.content --> <!-- Button trigger modal --> <!-- Modal --> @endsection
@section('extra-scripts') <script src="{{asset('plugins/datatables/jquery.dataTables.min.js')}}"></script> <script src="{{asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js')}}"></script> <script src="{{asset('plugins/datatables-responsive/js/dataTables.responsive.min.js')}}"></script> <script src="{{asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js')}}"></script>
<script> "use strict"; function initializeDataTable(selector, status) { return $(selector).DataTable({ processing: true, serverSide: true, responsive: true, ajax: { url: '{{ route('admin.order.request.get.all') }}', data: { status: status } }, columns: [ { "data": "order_number" }, { "data": "name" }, { "data": "order_basic_details" }, { "data": "status" }, { "data": "action" }, ] }); } $(document).ready(function() { var dataTablePending; var dataTable_complted; var dataTable_in_progress; var dataTable_processing; var dataTable_cancelled; var dataTable_partial; var dataTable_all;
$('#pills-all').on('click', function (e) { if(!dataTable_all){ dataTable_all = initializeDataTable('#categories-all', 'all'); }else{ dataTable_all.ajax.reload(); } }); $('#pills-pending-tab').on('click', function (e) { if(!dataTablePending){ dataTablePending = initializeDataTable('#categories_pending', 'pending'); }else{ dataTablePending.ajax.reload(); } }); $('#pills-completed-tab').on('click', function (e) { if(!dataTable_complted){ dataTable_complted = initializeDataTable('#categories-completed', 'completed'); }else{ dataTable_complted.ajax.reload(); } });
$('#pills-processing-tab').on('click', function (e) { if(!dataTable_processing){ dataTable_processing = initializeDataTable('#categories-processing', 'processing'); }else{ dataTable_processing.ajax.reload(); } }); $('#pills-progress-tab').on('click', function (e) { if(!dataTable_in_progress){ dataTable_in_progress = initializeDataTable('#categories-progress', 'inprogress'); }else{ dataTable_in_progress.ajax.reload(); } }); $('#pills-partial-tab').on('click', function (e) { if(!dataTable_partial){ dataTable_partial = initializeDataTable('#categories-partial', 'partial'); }else{ dataTable_partial.ajax.reload(); } }); $('#pills-cancel-tab').on('click', function (e) { if(!dataTable_cancelled){ dataTable_cancelled = initializeDataTable('#categories-cancelled', 'cancelled'); }else{ dataTable_cancelled.ajax.reload(); } }); });
$(document).on('click', '.massOrderModal', function() { const action = $(this).attr('data-action') $('#massOrderRequestFrom').attr('action',action); const id = $(this).attr('data-order')
$.ajax({ url: '{{route('admin.order.request.get.service')}}', method: "GET", data: { id: id, }, success: function (res) { if (res.status == 'success') { let html = '<option value="">--select option--</option>'; $.each(res.data, function (index, value) { html += `<option value="${value.service_id}" data-id="${value.id}" data-counter="${value.counter}" data-charges="${value.charges}" data-quantity="${value.order_quantity}" data-link="${value.link}" data-name="${value.name}">${value.name}</option>`; }); $('#service_id').html(html); } } }); $('#massOrderRequestModal').modal('show'); });
$(document).ready(function(){ $('.trigger-first-btn').trigger('click'); });
$('#service_id').change(function(){ const id = $('option:selected', this).attr('data-id') const link = $('option:selected', this).attr('data-link') const quantity = $('option:selected', this).attr('data-quantity') const charges = $('option:selected', this).attr('data-charges') const counter = $('option:selected', this).attr('data-counter') const name = $('option:selected', this).attr('data-name'); const remains = Number(quantity) - Number(counter); let html = `<div class="row"> <div class="col-lg-6"> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label for="mass_order_quantity">@lang('customer.order_quantity')</label> <input type="hidden" class="massOrderId" name="mass_order_id" value="${id}"> <input value="${quantity}" type="number" class="form-control mass_order_quantity" disabled placeholder="@lang('customer.enter_order_quantity')"> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label for="mass_link">@lang('admin.link')</label> <input value="${link}" type="text" class="form-control" disabled placeholder="@lang('https://')"> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label for="start_counter">@lang('customer.start_counter')</label> <input value="" type="number" class="form-control" name="order_counter" placeholder="@lang('customer.start_counter')"> </div> </div> </div> </div> <div class="col-lg-6"> <div class="row"> <div class="col-lg-12"> <div class="row"> <div class="col-lg-6"> <div class="form-group"> <label for="link">@lang('admin.service_name')</label> <input value="${name}" type="text" class="form-control" disabled placeholder="@lang('admin.service_name_input')">
</div> </div> <div class="col-lg-6"> <div class="form-group"> <label for="link">@lang('customer.total_charges')</label> <input value="${charges}" type="number" class="form-control" disabled placeholder="@lang('customer.total_charges')"> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label for="remains">@lang('customer.remains')</label> <input value="${remains}" type="number" name="remains" class="form-control" id="remains" disabled placeholder="@lang('customer.remains')"> </div> </div> </div> </div> </div> </div> </div>`; const values = $(".mass_order_id").map(function(){return $(this).val();}).get(); $('#mass-service').html(html); });
</script> @endsection
|