Edit File: new_orders.blade.php
@extends('layouts.stores_dashboard_layout') @section('title') {{trans('stores_dashboard.new_orders')}} @endsection @section('content') <!-- start new order table --> <div class="table-cont p-2 "> <div class="row align-items-center"> <div class="dash-title col-md p-0 mt-0"> <h6 class="bold">{{trans('stores_dashboard.recent_orders')}}</h6> <p class="mb-1">{{trans('stores_dashboard.recent_orders_info')}}</p> </div> <div class="form-group col-md p-0 m-0 "> <div class="row align-items-center justify-content-between "> <div class="col p-0 password-cont"> <input type="text" class="form-control" id="dataTableSearchInput1" aria-describedby="emailHelp" placeholder="{{trans('stores_dashboard.keywords')}}"> <i class="fa fa-search color-gray" ></i> </div> </div> </div> </div> <table id="dataTable1" data-order='[[ 1, "asc" ]]' data-page-length='25' class="table text-center table-striped table-ed" style="width:100%"> <thead class="table-head"> <tr > <th>{{trans('stores_dashboard.number')}}</th> <th>{{trans('stores_dashboard.order_number')}}</th> <th>{{trans('stores_dashboard.name')}}</th> <th>{{trans('stores_dashboard.deliver_address')}}</th> <th>{{trans('stores_dashboard.total_price')}}</th> <th>{{trans('stores_dashboard.created_at')}}</th> <th>{{trans('stores_dashboard.deliver_time')}}</th> <th></th> <th></th> </tr> </thead> <tbody data-class-name="table-body"> @foreach($orders as $order) <tr> <td>{{ $i++ }}</td> <td>{{$order->citc_referenceCode}}</td> <td>{{$order->user?->name}}</td> <td>{{$order->receive_address}}</td> <td>{{$order->total_price}}</td> <td>{{date('d-m-Y', strtotime($order->created_at))}}</td> <td>{{$order->deliver_time}}{{trans('stores_dashboard.hour')}}</td> <td class="table-menu" > <i onclick="openTableMenu(this)" class=" cp p-2 fa fa-ellipsis-h"></i> <div class="menu-cont" > <ul class="white-bg round7 pt-1 pb-1 shadow1"> <li> <a href="{{route('stores_dashboard.get_order_details',$order->id)}}"><i class="fa fa-eye color1"></i> {{trans('stores_dashboard.details')}}</a> </li> <li class="border-bottom"></li> @if($order->store_status=='pending' && $order->status=='open') <li> <form id="submitform"> @csrf <input type="hidden" name="id" value="{{$order->id}}"> <button id="submitbtn" type="submit" class="button5 m-2 material-button">{{trans('stores_dashboard.accept')}}</button> </form> </li> <li class="border-bottom"></li> <li> <form id="refuseform"> @csrf <input type="hidden" name="id" value="{{$order->id}}"> <button id="refusebtn" type="submit" class="button4 m-2 material-button"> {{trans('stores_dashboard.refuse')}}</button> </form> </li> @endif </ul> </div> </td> </tr> @endforeach </tbody> </table> </div> <!-- end new order table --> @endsection @section('scripts') <script> $(function(){ $('.side-button .active').siblings('.side-dropdown').slideDown(); }); </script> <script> function deleteElement(){ Swal.fire({ title: '<h5 class="bold">{{trans("stores_dashboard.submit_delete")}}</h5>', icon: 'warning', html:'<p>{{trans("stores_dashboard.order_deletion")}}</p> ' +'<div class="row">' +' <div class="col"><button class="button1 w-100" onclick="Swal.clickConfirm()">{{trans("stores_dashboard.delete")}}</button></div>' +' <div class="col"><button class="button3 w-100" onclick="Swal.clickCancel()" >{{trans("stores_dashboard.back")}}</button></div>' +'</div>', showCancelButton: false, showConfirmButton: false, }).then((result) => { if (result.isConfirmed) { Swal.fire({icon: 'success', title: '<h5 class="bold">{{trans("stores_dashboard.delete_order_success")}}</h5>', html : '<a href="#" class="button1 w-100 d-block">{{trans("stores_dashboard.confirm")}}</a>', showConfirmButton: false, timer: 1500 }); } }) } </script> <script> $(document).on('click','#submitbtn',function (e) { e.preventDefault(); //get form data var form = $('#submitform').get(0); var formData = new FormData(form); $.ajax({ url: "{{route('stores_dashboard.accept_order')}}", type: "POST", data: formData, dataType: "json", processData: false, contentType: false, cache: false, success: function (data) { //got a resposne? if (data.key == 'success') { Swal.fire({ icon: 'success', title: '<h5 class="bold">'+data.msg+'</h5>', showConfirmButton: false, timer: 1500 }); location.assign(data.url); } else { swal.fire({ title: data.msg, type: 'error', timer: 3000, showCloseButton: true, showConfirmButton: false, animation: true, }).catch(swal.noop); } } }); }); </script> <script> $(document).on('click','#refusebtn',function (e) { e.preventDefault(); //get form data var form = $('#refuseform').get(0); var formData = new FormData(form); $.ajax({ url: "{{route('stores_dashboard.refuse_order')}}", type: "POST", data: formData, dataType: "json", processData: false, contentType: false, cache: false, success: function (data) { //got a resposne? if (data.key == 'success') { Swal.fire({ icon: 'success', title: '<h5 class="bold">'+data.msg+'</h5>', showConfirmButton: false, timer: 1500 }); location.assign(data.url); } else { swal.fire({ title: data.msg, type: 'error', timer: 3000, showCloseButton: true, showConfirmButton: false, animation: true, }).catch(swal.noop); } } }); }); </script> @endsection
Back to File Manager