Viewing file: completed.blade.php (8.88 KB) -rwxrwxrwx Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.master')
@section('title') Completed Order @endsection
@section('content')
@component('components.breadcrumb')
@slot('li_1') Order @endslot
@slot('title')Completed List @endslot
@endcomponent
<div class="row">
<div class="col-lg-12">
<div class="card">
@if ($errors->any())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
<span class="each-error">{{ $error }} </span><br/>
@endforeach
</div>
@endif
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
<div class="card-header border-0">
<div class="d-flex align-items-center">
<h5 class="card-title mb-0 flex-grow-1">Completed Orders List</h5>
<!-- <div class="flex-shrink-0">
<button type="button" class="btn btn-success add-btn" data-bs-toggle="modal"
id="create-btn" data-bs-target="#addModal"><i
class="ri-add-line align-bottom me-1"></i> Create New
</button>
</div> -->
</div>
</div>
<div class="card-body border border-dashed border-end-0 border-start-0">
<form action="{{ route('delivered')}}" method="POST">
@csrf
<div class="row g-3">
<div class="col-xxl-2 col-sm-3">
<div class="search-box">
@php
$input_dt = (isset($search_input)) ? $search_input : "";
@endphp
<input type="text" id="search_input" name="search_input" value="{{$input_dt}}" class="form-control search"
placeholder="Search by order id">
<i class="ri-search-line search-icon"></i>
</div>
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-3">
<div>
@php
$dt=date('d M, Y', strtotime("-1 month")) ." to ".date('d M, Y', strtotime("+0 days"));
$date_dt = (isset($date_range)) ? $date_range :$dt;
@endphp
<input type="text" class="form-control" data-provider="flatpickr"
data-date-format="d M, Y" data-range-date="true"
id="demo-datepicker" data-deafult-date="{{ $date_dt }}" name="date_range" placeholder="Select date">
</div>
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-3" style="max-height:40px;">
<div>
<select class="js-example-basic-single form-control"
name="shop" id="idShop">
<option value="" disabled>Select Shop</option>
<option value="all" selected>All Shop</option>
@php
$shop_dt = (isset($shop)) ? $shop : "all";
@endphp
@if(isset($shops))
@foreach($shops as $shop)
<option value="{{$shop->id}}">{{ $shop->shop_name }}</option>
@endforeach
@endif
</select>
</div>
</div>
<!--end col-->
<div class="col-xxl-1 col-sm-3">
<div>
<button type="submit" class="btn btn-primary w-100"> <i
class="ri-equalizer-fill me-1 align-bottom"></i>
Filters
</button>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
</form>
</div>
<div class="card-body pt-0">
<div class="">
<table id="partnerTable" class="table dt-responsive align-middle table-hover table-bordered" style="width:100%">
<thead>
<tr>
<th>Order Id</th>
<th>Invoice No</th>
<th>Date</th>
<th>Receiver</th>
<th>Address</th>
<th>Shop</th>
<th>Address</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@php
$i=1;
@endphp
@if(isset($deliveries))
@foreach($deliveries as $data)
@php
$customer= json_decode($data->customer,true);
$vendor= json_decode($data->vendor,true);
@endphp
<tr>
<td>
<a href="{{ route('order_details',['order_id'=>$data->sale_id]) }}" class="fw-medium link-primary">
<!-- <button class="btn btn-sm btn-soft-success text-uppercase"> -->
{{ $data->order_id }}
<!-- </button> -->
</a>
</td>
<td>#{{ $data->invoice_no }} </td>
<td>{{ date('d M, Y H:i', strtotime($data->created_at)) }}</td>
<td>{{ $customer['receiver_name'] }}</td>
<td>{{ $customer['address'] }}</td>
<td>{{ $vendor['shop_name'] }}</td>
<td>{{ $vendor['address'] }}</td>
<td>
@if($data->status==1)
<span class="badge badge-soft-secondary text-uppercase">Requested</span>
@elseif($data->status==2)
<span class="badge badge-soft-info text-uppercase">Picked up</span>
@else
<span class="badge badge-soft-success text-uppercase">Delivered</span>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
@endsection
@section('script')
<script>
$(document).ready(function() {
new DataTable('#partnerTable', {
"columns": [
{"name": "Order ID", "orderable": "true"},
{"name": "Invoice No", "orderable": true},
{"name": "Date", "orderable": "true"},
{"name": "Receiver", "orderable": false},
{"name": "Address", "orderable": false},
{"name": "Shop", "orderable": false},
{"name": "Address", "orderable": false},
{"name": "Status", "orderable": false},
],
order:[],
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
var shop = "<?php echo $shop_dt; ?>";
$('#idShop').val(shop);
$('#idShop').trigger('change.select2');
});
</script>
@endsection
|