Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/resources/views/driver/orders/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/resources/views/driver/orders/payment.blade.php
@extends('layouts.front.app_driver')
@section('css')
<link href="{{ asset('css/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
@endsection
@section('content')
@include('layouts.front.other-menu')
<div class="main-content-350">
<section class="container content">
    <div class="row">
        <div class="col-md-12">
            <h1 class="text-center bold font-32">Order Details</h1>
        </div>
        @if( $order_data->transaction_status == 'succeeded')
       
        <div class="col-md-12">
            <div class="logincontainer bg-success">
                @if($order_data->order_status_id == '1' && $order_data->order_status == '0') 
                    <h2 class="text-success text-center">Payment is confirmed <i class="fa fa-check-circle text-success"></i></h2>
                @else
                    <h2 class="text-success text-center">Order is delivered <i class="fa fa-check-circle text-success"></i></h2>
                @endif
                @if ($errors->any())
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
                @endif
            </div>
        </div>
        <div class="col-md-12">
            <div class="logincontainer">
                <form name="fix_deliver_form" id="fix_deliver_form" action="{{ route('driver.deliver') }}" method="post">
                    @csrf
                    <input type="hidden" name="order_id" id="order_id_fix" value="{{ $order_data-> id}}" />
                    <input type="hidden" name="product_id" id="product_id" value="{{ $order_data->product_id }}">
                    <input type="hidden" name="initial_amount" id="initial_amount" value="{{ $order_data->initial_price }}" />
                    <input type="hidden" name="fill_the_tank_amount" id="fill_the_tank_amount" value="{{ $order_data->total }}" />
                    <input type="hidden" name="fill_the_tank_tax_value" id="fill_the_tank_tax_value" value="{{ $order_data->tax_value }}" />
                    <input type="hidden" name="fill_the_tank_final_amount" id="fill_the_tank_final_amount" value="{{ $order_data->total_paid }}" />
                    <input type="hidden" name="discount_amount" id="discount_amount" value="{{ $order_data->discount_amount }}">
                    <input type="hidden" name="discount_type" id="discount_type" value="{{ $order_data->discount_coupon_type }}">
                    <input type="hidden" name="discount_value" id="discount_value" value="{{ $order_data->discount_value }}">
                    <input type='hidden' name='currency_code' value='EUR'>
                <h2 class="text-center bold font-red font-28">Order ID: #{{ $order_data->id }}</h2>
                <h3 class="text-center bold font-21"><?php
                if(!empty($order_data->address_1)){ echo $order_data->address_1; }
                if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                if(!empty($order_data->zip)){ echo ", ".$order_data->zip; }
                ?></h3>
                <div class="row">
                    <div class="col-md-6">
                        <table class="table border-leftright">
                            <tbody>
                                <tr>
                                    <td class="column-size-3 bold">Customer Name</td>
                                    <td>{{ $order_data->name }}</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Address</td>
                                    <td>
                                    <?php
                                        if(!empty($order_data->address_1)){ echo $order_data->address_1; }
                                        if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                                        if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                                        if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                                    ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Ericode</td>
                                    <td><span class="findzip">{{ $order_data->zip }}</span> <span class="findinmap"><a href="https://www.google.com/maps/search/?api=1&query={{ $order_data->zip }}" class="btn btn-dark edit-btn font-black" target="_blank" title="View Map">Find in Map</a></span></td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Order Notes</td>
                                    <td>@if (!empty($order_data->delivery_note)) {{ $order_data->delivery_note }} @else ... @endif</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Phone Number</td>
                                    <td><?php if(!empty($order_data->phone)){ echo $order_data->phone; } ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-6">
                        <table class="table border-leftright">
                            <tbody>
                                <tr>
                                    <td class="column-size-3 bold">Product</td>
                                    <td>
                                        @if( isset($order_data->cover))
                                        <img src="{{ URL::asset('/public/storage/'.$order_data->cover) }}" style="height: 15px;width: 15px; margin-right:5px" />
                                        @else
                                        <img src="{{ url('/images/default.jpg') }}" style="height: 15px;width: 15px; margin-right:5px" />
                                        @endif
                                        {{ $order_data->product_name }}
                                    </td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Quantity (Litres)</td>
                                    <td>{{ $order_data->quantity }}</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Sub Total</td>
                                    <td>{{ config('cart.currency_symbol') }}{{ number_format($order_data->total_products, 2) }}</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Vat {{ '@' . floatval( $order_data->tax_percentage ) }}%</td>
                                    <td>{{ config('cart.currency_symbol') }}{{ number_format($order_data->tax_value, 2) }}</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Discount</td>
                                    <td>{{ config('cart.currency_symbol') }}{{ $order_data->discounts }}</td>
                                </tr>
                                <tr>
                                    <td class="column-size-3 bold">Total</td>
                                    <td>{{ config('cart.currency_symbol') }}{{ number_format($order_data->total_paid, 2) }}</td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="submit_button_div">
                            @if($order_data->order_status == '0')
                            <div class="col-md-6 btn-margin-top">
                                    <input type="submit" name="fix_deliver" id="fix_deliver" class="btn btn-lg btn-block btn-dark" value="Order Delivered?" />
                            </div>
                            @endif
                            <div class="col-md-6 btn-margin-top">
                                <a href="{{ url('driver/orders?tab=pending-orders') }}" class="btn btn-lg btn-block btn-send">Back to Orders</a>
                            </div>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>
        @elseif( $order_data->fill_the_tank_status == 0 )
        <div class="col-md-12">
            <div class="logincontainer bg-warning">
                <h2 class="text-warning text-center">Payment is pending <i class="fa fa-exclamation-circle text-warning"></i></h2>
            </div>
        </div>
        <div class="col-md-12">
            <div class="logincontainer">
                <h2 class="text-center bold font-red font-28">Order ID: #{{ $order_data->id }}</h2>
                <h3 class="text-center bold font-21"><?php
                if(!empty($order_data->address_1)){ echo $order_data->address_1; }
                if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                if(!empty($order_data->zip)){ echo ", ".$order_data->zip; }
                ?></h3>
                <form name="fix_deliver_form" id="fix_capture_form" action="{{ route('driver.capture') }}" method="post">
                    <input type="hidden" name="order_id" id="order_id_fix" value="{{ $order_data-> id}}" />
                    <input type="hidden" name="product_id" id="product_id" value="{{ $order_data->product_id }}">
                    <input type="hidden" name="initial_amount" id="initial_amount" value="{{ $order_data->initial_price }}" />
                    <input type="hidden" name="fill_the_tank_amount" id="fill_the_tank_amount" value="{{ $order_data->total }}" />
                    <input type="hidden" name="fill_the_tank_tax_value" id="fill_the_tank_tax_value" value="{{ $order_data->tax_value }}" />
                    <input type="hidden" name="fill_the_tank_final_amount" id="fill_the_tank_final_amount" value="{{ $order_data->total_paid }}" />
                    <input type="hidden" name="discount_amount" id="discount_amount" value="{{ $order_data->discount_amount }}">
                    <input type="hidden" name="discount_type" id="discount_type" value="{{ $order_data->discount_coupon_type }}">
                    <input type="hidden" name="discount_value" id="discount_value" value="{{ $order_data->discount_value }}">
                    <input type='hidden' name='currency_code' value='EUR'>
                    @csrf
                    <div class="row">
                        <div class="col-md-6">
                            <table class="table border-leftright">
                                <tbody>
                                    <tr>
                                        <td class="column-size-3 bold">Customer Name</td>
                                        <td>{{ $order_data->name }}</td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Address</td>
                                        <td>
                                        <?php
                                        if(!empty($order_data->address_1)){ echo $order_data->address_1; }
                                        if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                                        if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                                        if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                                        ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Ericode</td>
                                        <td><span class="findzip">{{ $order_data->zip }}</span> <span class="findinmap"><a href="https://www.google.com/maps/search/?api=1&query={{ $order_data->zip }}" class="btn btn-dark edit-btn font-black" target="_blank" title="View Map">Find in Map</a></span></td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Order Notes</td>
                                        <td>@if (!empty($order_data->delivery_note)) {{ $order_data->delivery_note }} @else ... @endif</td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Phone Number</td>
                                        <td><?php if(!empty($order_data->phone)){ echo $order_data->phone; } ?></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-md-6">
                            <table class="table border-leftright">
                                <tbody>
                                    <tr>
                                        <td class="column-size-3 bold">Product</td>
                                        <td>
                                            @if( isset($order_data->cover))
                                            <img src="{{ URL::asset('/public/storage/'.$order_data->cover) }}" style="height: 15px;width: 15px; margin-right:5px" />
                                            @else
                                            <img src="{{ url('/images/default.jpg') }}" style="height: 15px;width: 15px; margin-right:5px" />
                                            @endif
                                            {{ $order_data->product_name }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Quantity (Litres)</td>
                                        <td>
                                            <span class="fill_the_tank_quantity_show">{{ $order_data->quantity }}</span>
                                            <input type="hidden" name="fill_the_tank_quantity" id="fill_the_tank_quantity" value="{{ $order_data->quantity }}" class="form-control" />
                                            <input type="hidden" name="tax_percentage" id="tax_percentage" value="{{ $order_data->tax_percentage }}" class="form-control" />
                                            <a href="javascript:void(0);" class="btn btn-dark edit-btn font-black edit_fix_quantity" title="Edit Quantity">Edit</a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Sub Total</td>
                                        <td><span class="amount_class" id="holder_sub_total">{{ config('cart.currency_symbol') }}{{ number_format($order_data->total_products, 2) }}</span> <span class="amount_error" style="color: red;"></span></td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold" id="holder_tax_percentage">Vat {{ '@' . floatval($order_data->tax_percentage) }}%</td>
                                        <td><span class="amount_class" id="holder_tax_value">{{ config('cart.currency_symbol') }}{{ $order_data->tax_value }}</span> <span class="amount_error" style="color: red;"></span></td>
                                    </tr>
                                    @if(!is_null( $order_data->discount_amount))
                                    <tr>
                                        <td class="column-size-3 bold">Discount</td>
                                        <td><span class="amount_class" id="holder_discount_amount">{{ config('cart.currency_symbol') }}{{ $order_data->discount_amount }}</span> <span class="amount_error" style="color: red;"></span></td>
                                    </tr>
                                    @endif
                                    <tr>
                                        <td class="column-size-3 bold">Total</td>
                                        <td><span class="amount_class" id="holder_total">{{ config('cart.currency_symbol') }}{{ $order_data->total_paid }}</span> <span class="amount_error" style="color: red;"></span></td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="submit_button_div">
                                <div class="col-md-6 btn-margin-top">
                                    <input type="submit" name="fix_capture" id="fix_capture" class="btn btn-lg btn-block btn-dark" value="Order Delivered?" />
                                </div>
                                <div class="col-md-6 btn-margin-top"><a href="{{ route('driver.orders') }}?tab=pending-orders" class="btn btn-lg btn-block btn-send">Back to Orders</a></div>
                            </div>
                            <span class="fix_capture_spinner" style="display: none;"><i class="fa fa-spinner fa-spin" style="font-size:24px"></i></span>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        @else
        <div class="col-md-12">
            <div class="logincontainer bg-warning">
                <h2 class="text-warning text-center">Payment is pending <i class="fa fa-exclamation-circle text-warning"></i></h2>
            </div>
        </div>
        <div class="col-md-12">
            <div class="logincontainer">
                <h2 class="text-center bold font-red font-28">Order ID: #{{ $order_data->id }}</h2>
                <h3 class="text-center bold font-21"><?php
                if(!empty($order_data->address_1)){ echo $order_data->address_1; }
                if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                if(!empty($order_data->zip)){ echo ", ".$order_data->zip; }
                ?></h3>
                <form name="fill_the_tank_capture_form" id="fill_the_tank_capture_form" action="{{ route('driver.capture.filltank') }}" method="post">
                    <input type="hidden" name="order_id" id="order_id_fill_in_tank" value="{{ $order_data-> id}}" />
                    <input type="hidden" name="product_id" id="product_id" value="{{ $order_data->product_id }}" />
                    <input type="hidden" name="initial_amount" id="initial_amount" value="{{ $order_data->total }}" />
                    <input type="hidden" name="fill_the_tank_amount" id="fill_the_tank_amount" value="{{ $order_data->total }}" />
                    <input type="hidden" name="fill_the_tank_tax_value" id="fill_the_tank_tax_value" value="{{ $order_data->tax_value }}" />
                    <input type="hidden" name="fill_the_tank_final_amount" id="fill_the_tank_final_amount" value="{{ $order_data->total_paid }}" />
                    <input type="hidden" name="discount_amount" id="discount_amount" value="{{ $order_data->discount_amount }}">
                    <input type="hidden" name="discount_type" id="discount_type" value="{{ $order_data->discount_coupon_type }}">
                    <input type="hidden" name="discount_value" id="discount_value" value="{{ $order_data->discount_value }}">
                    <input type='hidden' name='currency_code' value='EUR'>
                    @csrf
                    <div class="row">
                        <div class="col-md-6">
                            <table class="table border-leftright">
                                <tbody>
                                    <tr>
                                        <td class="column-size-3 bold">Order ID</td>
                                        <td>#{{ $order_data->id }}</td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Delivery Date</td>
                                        <td>
                                        <?php 
                                        if(!empty($order_data->delivery_date)){
                                            echo date("d M Y",strtotime($order_data->delivery_date));
                                        }
                                        ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Address</td>
                                        <td>
                                        <?php
                                        if(!empty($order_data->address_1)){ echo "".$order_data->address_1; }
                                        if(!empty($order_data->address_2)){ echo ", ".$order_data->address_2; }
                                        if(!empty($order_data->town)){ echo ", ".$order_data->town; }
                                        if(!empty($order_data->county)){ echo ", ".$order_data->county; }
                                        ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Ericode</td>
                                        <td><span class="findzip">{{ $order_data->zip }}</span> <span class="findinmap"><a href="https://www.google.com/maps/search/?api=1&query={{ $order_data->zip }}" class="btn btn-dark edit-btn font-black" target="_blank" title="View Map">Find in Map</a></span></td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Order Notes</td>
                                        <td>@if (!empty($order_data->delivery_note)) {{ $order_data->delivery_note }} @else ... @endif</td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Customer Name</td>
                                        <td>{{ $order_data->name }}</td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Phone Number</td>
                                        <td><?php if(!empty($order_data->phone)){ echo $order_data->phone; } ?></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="col-md-6">
                            <table class="table border-leftright">
                                <tbody>
                                    <tr>
                                        <td class="column-size-3 bold">Product</td>
                                        <td>
                                            @if( isset($order_data->cover))
                                            <img src="{{ URL::asset('/public/storage/'.$order_data->cover) }}" style="height: 15px;width: 15px; margin-right:5px" />
                                            @else
                                            <img src="{{ url('/images/default.jpg') }}" style="height: 15px;width: 15px; margin-right:5px" />
                                            @endif
                                            {{ $order_data->product_name }}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Quantity (Litres)</td>
                                        <td><span class="fill_the_tank_quantity_show">Fill the Tank</span> 
                                            <input type="hidden" name="fill_the_tank_quantity" id="fill_the_tank_quantity" value="" class="form-control" />
                                            <input type="hidden" name="tax_percentage" id="tax_percentage" value="{{ $order_data->tax_percentage }}" class="form-control" />
                                            <a href="javascript:void(0);" class="btn btn-dark edit-btn font-black edit_quantity" title="Edit Quantity">Edit</a>    
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Sub Total</td>
                                        <td>
                                            <span class="amount_class" id="holder_sub_total">{{ config('cart.currency_symbol') }}{{ number_format($order_data->total_products, 2) }}</span> <span class="amount_error" style="color: red;"></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="column-size-3 bold">Vat {{ '@' . floatval( $order_data->tax_percentage ) }}%</td>
                                        <td>
                                            <span class="amount_class" id="holder_tax_value">{{ config('cart.currency_symbol') }}{{ number_format($order_data->tax_value, 2) }}</span> <span class="amount_error" style="color: red;"></span>
                                        </td>
                                    </tr>
                                    @if(!is_null( $order_data->discount_amount))
                                    <tr>
                                        <td class="column-size-3 bold">Discount</td>
                                        <td><span class="amount_class" id="holder_discount_amount">{{ config('cart.currency_symbol') }}{{ $order_data->discount_amount }}</span> <span class="amount_error" style="color: red;"></span></td>
                                    </tr>
                                    @endif
                                    <tr>
                                        <td class="column-size-3 bold">Total</td>
                                        <td>
                                            <span class="amount_class" id="holder_total">{{ config('cart.currency_symbol') }}{{ number_format($order_data->total_paid, 2) }}</span> <span class="amount_error" style="color: red;"></span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="submit_button_div">
                                <div class="col-md-6 btn-margin-top">
                                    <input type="button" name="add_quantity" id="add_quantity" class="btn btn-lg btn-block btn-dark add_quantity_class" value="Add Quantity" />
                                </div>
                                <div class="col-md-6 btn-margin-top">
                                    <a href="{{ route('driver.orders') }}?tab=pending-orders" class="btn btn-lg btn-block btn-send">Back to Orders</a>
                                </div>
                            </div>
                            <span class="fix_capture_spinner" style="display: none;"><i class="fa fa-spinner fa-spin" style="font-size:24px"></i></span>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        @endif
    </div>
</section>
<div class="modal fade" id="edit_fix_quantity_Modal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h3 class="modal-title">Edit Quantity</h3>
            </div>
            <div class="modal-body">
                <div class="row">
                    <p>Please edit the amount of litres it took to add to the oil tank in the field below.</p>
                    <div class="col-md-6">
                        <input type="number" name="fix_quantity_popup" id="fix_quantity_popup" value="{{$maxQty}}" class="form-control input-lg" max="{{$maxQty}}" data-max="{{$maxQty}}" />   
                        <span class="quantity_error quantity_error" style="color: red;"></span>
                    </div>
                    <div class="col-md-6">
                        <a href="javascript:void(0);" class="btn btn-dark btn-lg btn-block font-black submit_fix_quantity">Submit</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="editModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h3 class="modal-title">Edit Quantity</h3>
            </div>
            <div class="modal-body">
                <div class="row">
                    <p>Please edit the amount of litres it took to add to the oil tank in the field below.</p>
                    <div class="col-md-6">
                        <input type="number" name="fill_the_tank_quantity_popup" id="fill_the_tank_quantity_popup" value="{{$maxQty}}" max="{{$maxQty}}" data-max="{{$maxQty}}" class="form-control input-lg" />   
                        <span class="quantity_error quantity_error" style="color: red;"></span>
                    </div>
                    <div class="col-md-6">
                        <a href="javascript:void(0);" class="btn btn-dark btn-lg btn-block font-black submit_quantity">Submit</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="confirmModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header border-bottomnone">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h3 class="modal-title">Do you confirm the details below?</h3>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table border-leftright">
                            <tr>
                                <td class="bold">Payment Option</td>
                                <td>
                                    {{$order_data->payment_option}}
                                </td>
                            </tr>
                            <tr>
                                <td class="bold">Product</td>
                                <td>
                                    @if( isset($order_data->cover))
                                    <img src="{{ URL::asset('/public/storage/'.$order_data->cover) }}" style="height: 15px;width: 15px; margin-right:5px" />
                                    @else
                                    <img src="{{ url('/images/default.jpg') }}" style="height: 15px;width: 15px; margin-right:5px" />
                                    @endif
                                    {{ $order_data->product_name }}
                                </td>
                            </tr>
                            <tr>
                                <td class="bold">Quantity (Litres)</td>
                                <td><span class="fill_the_tank_quantity_show" id="confirm_order_qty">{{ $order_data->quantity }}</span></td>
                            </tr>
                            <tr>
                                <td class="bold">Total</td>
                                <td><span class="amount_class" id="confirm_order_total">{{ config('cart.currency_symbol') }}{{ $order_data->total }}</span></td>
                            </tr>
                        </table>
                    </div>
                </div>
                @if($order_data->payment_option == 'Credit Card' && $order_data->order_status_id == '6')
                <div class="row">
                    <div class="col-md-12">
                        <h3 class="bold margin-top-30">Payment Details</h3>
                    </div>
                </div>
                <div id="errorDiv" style="display:none;">
                            <p class="alert alert-error alert-dismissible" id="errorMessage">
                                Error
                            </p>
                </div>
                <div class="row" id="credPay">
                    <div class="col-md-12">
                        <div class="form-group">
                            <div id="cardpayment" class="card_payment_type">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="name">Card Holder Name <span class="text-danger">*</span></label>
                                            <input type="text" id="name" name="name" class="form-control input-lg" data-card-details="cardholder-name" />
                                            <span class="custom-error text-danger" id="name-err"></span>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="email">Email Address <span class="text-danger">*</span></label>
                                            <input type="text" id="email" name="email" class="form-control input-lg" readonly value="{{$order_data->email}}" />
                                            <span class="custom-error text-danger" id="email-err"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="card-number">Card Number <span class="text-danger">*</span></label>
                                            <input minlength="16" maxlength="20" type="text" id="card-number" name="card-number" class="form-control input-lg" data-card-details="card-number" />
                                           
                                            <span class="custom-error text-danger" id="card-number-err"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="month">Expiry Month / Year <span class="text-danger">*</span></label>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <select name="month" id="month" class="form-control input-lg">
                                                        <option value="01">01</option>
                                                        <option value="02">02</option>
                                                        <option value="03">03</option>
                                                        <option value="04">04</option>
                                                        <option value="05">05</option>
                                                        <option value="06">06</option>
                                                        <option value="07">07</option>
                                                        <option value="08">08</option>
                                                        <option value="09">09</option>
                                                        <option value="10">10</option>
                                                        <option value="11">11</option>
                                                        <option value="12">12</option>
                                                    </select>
                                                    <span class="custom-error text-danger" id="month-err"></span>
                                                </div>
                                                <div class="col-md-6">
                                                    <select name="year" id="year" class="form-control input-lg">
                                                        @php 
                                                            $startYr = date("Y"); 
                                                            $endYr = $startYr+20;
                                                        @endphp
                                                        @for($i=$startYr; $i<=$endYr; $i++)
                                                            <option value="{{substr($i,-2)}}">{{$i}}</option>
                                                        @endfor
                                                    </select>
                                                    <span class="custom-error text-danger" id="year-err"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="cvc">CVC <span class="text-danger">*</span></label>
                                            <input type="text" name="cvc" id="cvc" class="form-control input-lg cvv-input" data-card-details="security-code">
                                            <input type="hidden" name="card-identifier">
                                            <input type="hidden" name="merchent_key" value="<?php echo $merchantSessionKey; ?>">
                                            <span class="custom-error text-danger" id="cvv-err"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <img class="img-fluid m-1" src="{{ URL::asset('/images/opayo.png') }}" alt="Opayo Secure Payment" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                @endif
                <div class="row">
                    @if($order_data->payment_option == 'Credit Card' && $order_data->order_status_id == '6')
                        <div class="col-md-6 btn-margin-top">
                            <button type="submit" id="submit-btn" class="btn btn-lg btn-block btn-dark" onClick="stripePay(event);">Confirm Delivery?</button>
                            <span id="loader" style="display: none;"><i class="fa fa-spinner fa-spin" style="font-size:24px"></i></span>
                        </div>
                    @else
                        <div class="col-md-6 btn-margin-top">
                            <a href="javascript:void(0);" class="btn btn-dark btn-lg btn-block font-black confirmation_class"  data-value="yes" >Confirm Delivery?</a>
                        </div>
                    @endif
                    <div class="col-md-6 btn-margin-top">
                        <a href="javascript:void(0);" data-dismiss="modal" class="btn btn-lg btn-block btn-send confirmation_class" data-value="no">Back to Order</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
@endsection
@section('js')
<script src="{{ asset('js/sweetalert2.all.min.js') }}"></script>
<script src="{{ config('constants.evalon_url') }}/api/v1/js/sagepay.js"></script>
<script type="text/javascript">
function cardValidation () {
    var valid = true;
    var name = $('#name').val();
    var cardNumber = $('#card-number').val();
    var month = $('#month').val();
    var year = $('#year').val();
    var cvc = $('#cvc').val();
    $("#error-message").html("").hide();
    if (name.trim() == "") {
        valid = false;
    }
    if (cardNumber.trim() == "") {
       valid = false;
    }
    if (month.trim() == "") {
        valid = false;
    }
    if (year.trim() == "") {
        valid = false;
    }
    if (cvc.trim() == "") {
        valid = false;
    }
    if (valid == false) {
        $("#error-message").html("All Fields are required").show();
    }
    return valid;
}
    function stripePay(e) {
        e.preventDefault();
        var valid = cardValidation();
        if (valid == true) {
            var month = $('#month').val();
            var year = $('#year').val();
            $("#submit-btn").hide();
            $( "#loader" ).css("display", "inline-block");
            
            sagepayOwnForm({ 
            merchantSessionKey: "<?php echo $merchantSessionKey; ?>" })
             .tokeniseCardDetails({
                cardDetails: { 
                            cardholderName: document.querySelector('[data-card-details="cardholder-name"]').value, 
                            cardNumber: document.querySelector('[data-card-details="card-number"]').value,
                            expiryDate: month.trim()+year.trim(), 
                            securityCode: document.querySelector('[data-card-details="security-code"]').value },
                            onTokenised : function(result) { 
                                if (result.success) {
                                    
                                        document.querySelector('[name="card-identifier"]').value = result.cardIdentifier; 
                                          <?php if( $order_data->fill_the_tank_status == 0 ){ ?>
                                          var merchantSessionKey = "<?php echo $merchantSessionKey; ?>"
                                          $("#fix_capture_form").append("<input type='hidden' name='card-identifier' value='" +result.cardIdentifier + "' />");
                                            $("#fix_capture_form").append("<input type='hidden' name='merchent_key' value='" +merchantSessionKey + "' />");
                                        document.getElementById('fix_capture_form').submit();
                                         <?php } else{ ?>
                                         var merchantSessionKey = "<?php echo $merchantSessionKey; ?>"
                                          $("#fill_the_tank_capture_form").append("<input type='hidden' name='card-identifier' value='" +result.cardIdentifier + "' />");
                                            $("#fill_the_tank_capture_form").append("<input type='hidden' name='merchent_key' value='" +merchantSessionKey + "' />");
                                         document.getElementById('fill_the_tank_capture_form').submit();
                                         
                                        <?php } ?>
                                } 
                                else { 
                                    var x = document.getElementById('errorDiv');
                                    x.style.display = "block";
                                    document.getElementById("submit-btn").style.display = "block";
                                    
                                   document.getElementById("loader").style.display = "none";
                                    document.getElementById("errorMessage").innerHTML = result.errors[0].message;
                                } 
                            } 
                        });
            return false;
        } else {
            alert("Invalid Entries"); return false;
        }
    }
$(function(){
    $(document).on('click','#fix_capture', function(e) {
        e.preventDefault();
        $('#confirmModal').modal('show');
        $(document).on('click','.confirmation_class',function() {
            var confirm_val = $(this).attr('data-value');
            if (confirm_val == 'yes') {
                $('#confirmModal').modal('hide');
                $('.edit_fix_quantity').hide();
                $('#fix_capture').hide();
                $('.fix_capture_spinner').show();
                 $('#fix_capture_form').attr("action","{{ route('driver.deliver') }}").submit();
            } else {
                $('#confirmation_model').modal('hide');
            }
        });
    });
    $(document).on('click','.cred_card_details',function(){
        $('#credPay').css('display','block');
    })
    $(document).on('click','#fill_the_tank_capture', function(e) {
        e.preventDefault();
        $('#confirmModal').modal('show');
        $(document).on('click','.confirmation_class',function() {
            var confirm_val = $(this).attr('data-value');
            if (confirm_val == 'yes') {
                $('#confirmModal').modal('hide');
                $('.edit_quantity').hide();
                $('#fill_the_tank_capture').hide();
                $('.fix_capture_spinner').show();
                $('#fill_the_tank_capture_form').submit();
            } else {
                $('#confirmation_model').modal('hide');
            }
        });
    });
    $(document).on('click','.edit_fix_quantity',function() {
        $('#edit_fix_quantity_Modal').modal('show');
    });
    $(document).on('click','.add_fix_quantity_class',function() {
        $('#edit_fix_quantity_Modal').modal('show');
    });
    $(document).on('click','.edit_quantity',function() {
        $('#editModal').modal('show');
    });
    $(document).on('click','.add_quantity_class',function() {
        $('#editModal').modal('show');
    });
    $(document).on('click','.submit_quantity',function() {
        var quantity = $('#fill_the_tank_quantity_popup').val();
        var maxQuantity = $('#fix_quantity_popup').data("max");
        var payment_option_quant = "{{$order_data->payment_option}}";
        if (quantity == '' || quantity == 0) {
            $('.quantity_error').text('Quantity Required');
        } 
        //else if(quantity > maxQuantity && payment_option_quant !== 'Credit Account') {
        //     $('.quantity_error').text("Quantity needs to be <= "+maxQuantity);
        // }
        else {
            $('.quantity_error').text('');
            var order_id = $('#order_id_fill_in_tank').val();
            var product_id = $('#product_id').val();
            $.ajax({
                url:"{{ route('driver.capture.price') }}",
                method: "POST",
                data: {'quantity':quantity , 'order_id':order_id ,'product_id': product_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                    var initial_amount = $('#initial_amount').val();
                    // if (parseFloat(data) > parseFloat(initial_amount) && payment_option_quant !== 'Credit Account') {
                    //     $('.amount_error').text('Amount is higher');
                    //     $('.submit_button_div').html("<div class='col-md-6 btn-margin-top'><input type='button' name='add_quantity' id='add_quantity' class='btn btn-lg btn-block btn-dark add_quantity_class' value='Add Quantity' /></div>");
                    // } 
                    // else {
                        $('.amount_error').text('');
                        $('.fill_the_tank_quantity_show').text(quantity);
                        $('#holder_sub_total').text('€' + parseFloat(data).toFixed(2));
                        var discount_value = parseFloat( $('#discount_value').val() );
                        var discount_type = $('#discount_type').val();
                        var tax_percentage  = $('#tax_percentage').val();
                        var sub_total = parseFloat(data);
                        var final_total = 0;
                        if (!isNaN(discount_value) && discount_value != '' && discount_value != undefined) {
                            if( discount_type == 1 ) {
                                var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                                var intermediate_total = sub_total + recalculated_tax_amount;
                                var recalculated_discount = ( ( intermediate_total * discount_value ) / 100 ).toFixed(2);
                                $('#discount_amount').val(recalculated_discount);
                                $('#holder_discount_amount').html('€' + recalculated_discount);
                                final_total = intermediate_total - recalculated_discount;
                                $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                                $('#holder_total').text('€' + final_total.toFixed(2));
                                $('#fill_the_tank_quantity').val(quantity);
                                $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                                $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                                $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                                $('#confirm_order_qty').html(quantity);
                                $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                            } else {
                                var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                                var intermediate_total = sub_total + recalculated_tax_amount;
                                var discount_amount = $('#discount_amount').val();
                                final_total = intermediate_total - discount_amount;
                                $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                                $('#holder_total').text('€' + final_total.toFixed(2));
                                $('#fill_the_tank_quantity').val(quantity);
                                $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                                $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                                $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                                $('#confirm_order_qty').html(quantity);
                                $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                            }
                        } else {
                            var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                            var intermediate_total = sub_total + recalculated_tax_amount;
                            final_total = intermediate_total;
                            $('#holder_total').text('€' + final_total.toFixed(2));
                            $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                            $('#fill_the_tank_quantity').val(quantity);
                            $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                            $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                            $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                            $('#confirm_order_qty').html(quantity);
                            $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                        }
                        $('.submit_button_div').html("<div class='col-md-6 btn-margin-top'><input type='submit' name='fill_the_tank_capture' id='fill_the_tank_capture' class='btn btn-lg btn-block btn-dark' value='Order Delivered?' /></div><div class='col-md-6 btn-margin-top'><a href='{{ route('driver.orders') }}?tab=pending-orders' class='btn btn-lg btn-block btn-send'>Back to Orders</a></div>");
                    // }
                    $('#editModal').modal('hide');
                }
            });
        }
    });
    $(document).on('click','.submit_fix_quantity',function() {
        var quantity = $('#fix_quantity_popup').val();
        var maxQuantity = $('#fix_quantity_popup').data("max");
        var payment_option_quant = "{{$order_data->payment_option}}";
        if (quantity == '' || quantity == 0) {
            $('.quantity_error').text('Quantity Required');
        } else if(quantity > maxQuantity && payment_option_quant !== 'Credit Account') {
            $('.quantity_error').text("Quantity needs to be <= "+maxQuantity);
        } else {
            $('.quantity_error').text('');
            var order_id = $('#order_id_fix').val();
            var product_id = $('#product_id').val();
            $.ajax({
                url:"{{ route('driver.capture.price') }}",
                method: "POST",
                data: {'quantity':quantity , 'order_id':order_id ,'product_id': product_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                    var initial_amount = $('#initial_amount').val();
                    // if (parseFloat(data) > parseFloat(initial_amount) && payment_option_quant !== 'Credit Account') {
                    //     $('.amount_error').text('Amount is higher');
                    //     $('.submit_button_div').html("<div class='col-md-6 btn-margin-top'><input type='button' name='add_fix_quantity' id='add_fix_quantity' class='btn btn-lg btn-block btn-dark add_fix_quantity_class' value='Add Quantity' /></div>");
                    // } else {
                        $('.amount_error').text('');
                        $('.fill_the_tank_quantity_show').text(quantity);
                        $('#holder_sub_total').text('€' + parseFloat(data).toFixed(2));
                        var discount_value = parseFloat( $('#discount_value').val() );
                        var discount_type = $('#discount_type').val();
                        var tax_percentage = $('#tax_percentage').val();
                        var sub_total = parseFloat(data);
                        var final_total = 0;
                        if (!isNaN(discount_value) && discount_value != '' && discount_value != undefined) {
                            if (discount_type == 1) {
                                var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                                var intermediate_total = sub_total + recalculated_tax_amount;
                                var recalculated_discount = ( ( intermediate_total * discount_value ) / 100 ).toFixed(2);
                                $('#discount_amount').val(recalculated_discount);
                                $('#holder_discount_amount').html('€' + recalculated_discount);
                                final_total = intermediate_total - recalculated_discount;
                                $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                                $('#holder_total').text('€' + final_total.toFixed(2));
                                $('#fill_the_tank_quantity').val(quantity);
                                $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                                $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                                $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                                $('#confirm_order_qty').html(quantity);
                                $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                            } else {
                                var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                                var intermediate_total = sub_total + recalculated_tax_amount;
                                var discount_amount = $('#discount_amount').val();
                                final_total = intermediate_total - discount_amount;
                                $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                                $('#holder_total').text('€' + final_total.toFixed(2));
                                $('#fill_the_tank_quantity').val(quantity);
                                $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                                $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                                $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                                $('#confirm_order_qty').html(quantity);
                                $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                            }
                        } else {
                            var recalculated_tax_amount = ( sub_total * tax_percentage ) / 100;
                            var intermediate_total = sub_total + recalculated_tax_amount;
                            final_total = intermediate_total;
                            $('#holder_total').text('€' + final_total.toFixed(2));
                            $('#holder_tax_value').text('€' + recalculated_tax_amount.toFixed(2));
                            $('#fill_the_tank_quantity').val(quantity);
                            $('#fill_the_tank_amount').val( parseFloat(sub_total).toFixed(2) );
                            $('#fill_the_tank_tax_value').val( parseFloat(recalculated_tax_amount).toFixed(2) );
                            $('#fill_the_tank_final_amount').val( parseFloat(final_total).toFixed(2) );
                            $('#confirm_order_qty').html(quantity);
                            $('#confirm_order_total').html('€' + parseFloat(final_total).toFixed(2));
                        }
                        $('.submit_button_div').html("<div class='col-md-6 btn-margin-top'><input type='submit' name='fix_capture' id='fix_capture' class='btn btn-lg btn-block btn-dark' value='Order Delivered?' /></div><div class='col-md-6 btn-margin-top'><a href='{{ route('driver.orders') }}?tab=pending-orders' class='btn btn-lg btn-block btn-send'>Back to Orders</a></div>");
                    // }
                    $('#edit_fix_quantity_Modal').modal('hide');
                }
            });
        }
    });
});
</script>
@endsection

Spamworldpro Mini