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/front/quote/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/resources/views/front/quote/order.blade.php
@extends('layouts.front.app')
@section('content')
@include('layouts.front.product-menu')
<section class="container content">
    <div class="row">
        <div class="col-md-12">
            <h1 class="text-center bold">Oil Quotation</h1>
        </div>
        <div class="col-md-6">
            <div class="logincontainer">
                <div class="col-md-12">@include('layouts.errors-and-messages')</div>
                <div class="header-lined">
                	@if( is_null( $order_id ) )
                    <h1>Your Quote: <span class="font-black">{{ config('cart.currency_symbol') }}</span><span class="price"><?php
	                    if ("fill the tank" != Request::get('quantity_name_quote') && !empty(Request::get('quantity_name_quote'))) {
	                        echo number_format(($initial_quote_price + $vat), 2) . '<small> incl vat</small>';
	                    } else if ("fill the tank" != Session::get('quantity_name_quote') && !empty(Session::get('quantity_name_quote'))) {
	                        echo number_format(($initial_quote_price + $vat), 2) . '<small> incl vat</small>';
	                    } else if (Session::get('quantity_name_quote') == "fill the tank" || Request::get('quantity_name_quote') == "fill the tank") {
	                        echo number_format(( $fill_the_tank_price_admin + $vat ), 2) . '<small> incl vat</small>' . " <small>*</small><br><small class='fill_tank_msg'>* this price will change once the driver confirms the amount of quantity used</small>";
	                    }
                    	?>
                    	</span></h1>
					@else
					<h1>Your Quote: <span class="font-black">{{ config('cart.currency_symbol') }}</span><span class="price">{{ number_format(($initial_quote_price + $vat), 2) }}</span></h1>
                    @endif
                    <input type="hidden" name="product_tax" id="product_tax" value="{{ floatval($product_tax) }}">
                </div>
                <form name="quote_order" id="quote_order" method="post" action="{{ route('quote.checkout') }}">
                    <input type="hidden" name="price" id="price" value="{{ $initial_quote_price }}" />
                    <input type="hidden" name="fill_the_tank_price_admin" id="fill_the_tank_price_admin" value="{{ $fill_the_tank_price_admin }}">
                    <input type="hidden" name="applied_discount_code" id="applied_discount_code" value="">
                    <input type="hidden" name="applied_discount_amount" id="applied_discount_amount" value="">
                    <input type="hidden" name="applied_discount_code_type" id="applied_discount_code_type" value="">
                    <input type="hidden" name="applied_discount_value" id="applied_discount_value" value="">
                    <input type="hidden" name="order_id" id="order_id" value="{{ $orderDetails->id ?? '' }}">
                    {{ csrf_field() }}
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="county">County <span class="text-danger">*</span></label>
                                @if( is_null( $order_id ) )
                                <select name="county_name_quote_order" id="county_name_quote_order" class="form-control input-lg" required="">
                                    @foreach($county_list as $county)
                                        <option value="{{ $county->id }}" <?php
                                        if ($county->id == Request::get('county_name_quote')) {
                                            echo "selected";
                                        } else if ($county->id == Session::get('county_name_quote')) {
                                            echo "selected";
                                        } ?>>{{ $county->name }}</option>
                                    @endforeach
                                </select>
                                @else
								<select name="county_name_quote_order" id="county_name_quote_order" class="form-control input-lg" required="">
                                    @foreach($county_list as $county)
                                        <option value="{{ $county->id }}" {{ ($orderDetails->order_county_id == $county->id) ? 'selected': '' }}>{{ $county->name }}</option>
                                    @endforeach
                                </select>
                                @endif
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="town">Town <span class="text-danger">*</span></label>
                                @if( is_null( $order_id ) )
                                <select name="town_name_quote_order" id="town_name_quote_order" class="form-control input-lg" required="">
                                    @foreach($town_list as $town)
                                        <option value="{{ $town->id }}" <?php
                                        if ($town->id == Request::get('town_name_quote')) {
                                            echo "selected";
                                        } else if ($town->id == Session::get('town_name_quote')){
                                            echo "selected";
                                        } ?>>{{ $town->name }}</option>
                                    @endforeach
                                </select>
                                @else
								<select name="town_name_quote_order" id="town_name_quote_order" class="form-control input-lg" required="">
                                    @foreach($town_list as $town)
                                        <option value="{{ $town->id }}" {{ ($orderDetails->order_town_id == $town->id) ? 'selected': '' }}>{{ $town->name }}</option>
                                    @endforeach
                                </select>
                                @endif
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="product">Product <span class="text-danger">*</span></label>
                                @if(is_null( $order_id))
                                <select name="product_quote_order" id="product_quote_order" class="form-control input-lg" required="">
                                    @foreach($product_list as $product)
                                        <option value="{{ $product->id }}" <?php
                                        if ($product->id == Request::get('product_name_quote')) {
                                            echo "selected";
                                        } else if($product->id == Session::get('product_name_quote')) {
                                            echo "selected";
                                        } ?>>{{ $product->name }}</option>
                                    @endforeach
                                </select>
                                @else
								<select name="product_quote_order" id="product_quote_order" class="form-control input-lg" required="">
								    @foreach($product_list as $product)
								        <option value="{{ $product->id }}" {{ ($orderProduct->product_id == $product->id) ? 'selected': '' }}>{{ $product->name }}</option>
								    @endforeach
								</select>
                                @endif
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="quantity">Quantity <span class="text-danger">*</span></label>
                                @if(is_null( $order_id))
                                <select name="quantity" id="quantity" class="form-control input-lg" required="">
                                    @if($fill_the_tank_price_admin && $fill_the_tank_price_admin != '0.00')
                                    <option value='fill the tank' <?php
                                    if (Request::get('quantity_name_quote') == 'fill the tank') {
                                        echo "selected";
                                    } else if (Session::get('quantity_name_quote') == 'fill the tank') {
                                        echo "selected";
                                    } ?>>Fill the Tank</option>
                                    @endif
                                    @foreach($quantity_list as $quantity)
                                        <option value="{{ $quantity->id }}" <?php
                                        if($quantity->id == Request::get('quantity_name_quote')){
                                            echo "selected";
                                        }else if($quantity->id == Session::get('quantity_name_quote')){
                                            echo "selected";
                                        } ?>>{{ $quantity->name }} : {{ $quantity->value }}</option>
                                    @endforeach
                                </select>
                                @else
								<select name="quantity" id="quantity" class="form-control input-lg" required="">
								    @if($fill_the_tank_price_admin && $fill_the_tank_price_admin != '0.00')
								    <option value="fill the tank">Fill the Tank</option>
								    @endif
								    @foreach($quantity_list as $quantity)
								        <option value="{{ $quantity->id }}" {{ ( $orderProduct->quantity == $quantity->value ) ? 'selected': '' }}>{{ $quantity->name }} : {{ $quantity->value }}</option>
								    @endforeach
								</select>
                                @endif
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6 btn-margin-top">
                        </div>
                        <div class="col-md-6 btn-margin-top">
                            <input type="hidden" name="recaptcha" id="recaptcha">
                            <button class="btn btn-lg btn-block btn-send" type="submit">Order Now</button>
                        </div>
                        <div class="col-md-12">
                            <img class="img-fluid m-1" src="{{ URL::asset('/images/opayo.png') }}" alt="Opayo Secure Payment" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="col-md-6">
            <div class="logincontainer">
                <div class="header-lined">
                    <h1>Have a discount code?</h1>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <form action="" method="post" class="form-horizontal">
                            <div class="col-md-12">
                                <div class="form-group">
                                	@if(isset($orderDetails) && !is_null($orderDetails->discount_coupon_code))
                                    	<input type="text" id="discount_code" name="discount_code" value="{{ $orderDetails->discount_coupon_code }}" class="form-control input-lg" placeholder="Enter Discount Code" />
                                    @else
										<input type="text" id="discount_code" name="discount_code" value="" class="form-control input-lg" placeholder="Enter Discount Code" />
                                    @endif
                                </div>
                            </div>
                            <div class="col-md-12">
                            	<div class="row" id="applied_discount_coupon_details">
                            		@if(isset($orderDetails) && !is_null($orderDetails->discount_coupon_code))
										<div class="alert alert-success alert-dismissible">
											<a href="#" id="applied_discount_coupon_clear" class="close" data-dismiss="alert" aria-label="close">&times;</a><strong>Success! </strong>Discount of €{{ $orderDetails->discount_amount }} will be applied
										</div>
                            		@endif
                            	</div>
                            </div>
                            <div class="col-md-6"></div>
                            <div class="col-md-6">
                            	@if(Auth::check())
                            	  	<button class="btn btn-outline-dark btn-lg btn-block font-black" id="btn_apply_discount_coupon" type="button">Apply Code</button>
                            	@else
                            	  	<button class="btn btn-outline-dark btn-lg btn-block font-black" id="btn_show_login_warning" type="button">Apply Code</button>
                            	@endif
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="modal_login_warning" class="modal fade" role="dialog">
    	<div class="modal-dialog">
    		<div class="modal-content">
    			<div class="modal-header">
    				<button type="button" class="close" data-dismiss="modal">&times;</button>
    			</div>
    			<div class="modal-body">
    			    <div class="logincontainer">
                        <h3 class="text-center">Login Required</h3>
                        <p>You must be logged in to use this discount code, please login with the button below.</p>
                        <div class="row">
                        <div class="col-md-6 btn-margin-top">
        				    <a href="{{ route('cart.login') }}" class="btn btn-dark btn-lg btn-block font-black">Login</a>
        				</div>
        				<div class="col-md-6 btn-margin-top">
        				    <button type="button" class="btn btn-lg btn-block btn-send" data-dismiss="modal">Close</button>
        				</div>
        				</div>
        			</div>
    			</div>
    		</div>
    	</div>
    </div>
</section>
@include('layouts.front.call-to-action-footer')
@endsection
@section('js')
<script src="https://www.google.com/recaptcha/api.js?render={{ config('services.recaptcha.sitekey') }}"></script>
<script type="text/javascript">
$(function(){
    grecaptcha.ready(function() {
             grecaptcha.execute('{{ config('services.recaptcha.sitekey') }}', {action: 'contact'}).then(function(token) {
                if (token) {
                  document.getElementById('recaptcha').value = token;
                }
             });
         });
	$('#btn_show_login_warning').click(function() {
		$('#modal_login_warning').modal({
		    backdrop: 'static',
		    keyboard: false
		});
	});
	$('#btn_apply_discount_coupon').click(function() {
		var coupon_code = $('#discount_code').val().trim();
		var quote_price = '{{ $initial_quote_price + $vat }}';
        if (coupon_code != ''){
            $.ajax({
                url:"{{ route('validate.discount.coupon') }}",
                method: "POST",
                data: {
                	'_token': '{{ csrf_token() }}',
                	'quote_price': quote_price,
                	'coupon_code': coupon_code
                },
                success:function(data) {
                	if( data.response == 0 ) {
                		var response = '<div class="alert alert-success alert-dismissible"><a href="#" id="applied_discount_coupon_clear" class="close" data-dismiss="alert" aria-label="close">&times;</a><strong>Success! </strong>'+ data.message +'</div>';
                		$('#applied_discount_coupon_details').html(response);

                		$('#applied_discount_code').val(coupon_code);
                		$('#applied_discount_amount').val(data.discountAmount);
                		$('#applied_discount_code_type').val(data.couponType);
                		$('#applied_discount_value').val(data.discountValue);
                	} else {
                		var response = '<div class="alert alert-warning alert-dismissible"><a href="#" id="applied_discount_coupon_clear" class="close" data-dismiss="alert" aria-label="close">&times;</a><strong>Warning! </strong>'+ data.message +'</div>';
                		$('#applied_discount_coupon_details').html(response);
                		$('#applied_discount_code').val('');
                		$('#applied_discount_amount').val('');
                		$('#applied_discount_code_type').val('');
                		$('#applied_discount_value').val('');
                	}
                }
            });
        } else {
        	$('#discount_code').focus();
        }
	});
	$(document).on('click', '#applied_discount_coupon_clear', function() {
		$('#discount_code').val('');
		$('#applied_discount_code').val('');
		$('#applied_discount_amount').val('');
		$('#applied_discount_code_type').val('');
		$('#applied_discount_value').val('');
	});
    $(document).on('change','#county_name_quote_order',function() {
        var county_id = $(this).val();
        if (county_id != '') {
            $.ajax({
                url:"{{ route('quote.fetch.towns.order') }}",
                method: "POST",
                data: {'county_id':county_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                    data = JSON.parse(data);
                    $("#town_name_quote_order").html(data);
                }
            });
        }
    });
    $(document).on('change','#town_name_quote_order',function() {
        var town_id = $(this).val();
        if (town_id != '') {
            $.ajax({
                url:"{{ route('quote.session.towns.order') }}",
                method: "POST",
                data: {'town_id':town_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                }
            });
        }
    });
    $(document).on('change','#product_quote_order',function() {
        var product_id = $(this).val();
        if (product_id != '') {
            $.ajax({
                url:"{{ route('quote.fetch.quantity.order') }}",
                method: "POST",
                data: {'product_id':product_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                    data = JSON.parse(data);
                    $("#quantity").html(data);
                }
            });
        }
    });
    $(document).on('change','#quantity',function() {
        var product_attribute_id = $(this).val();
        var product_tax = parseFloat($('#product_tax').val());
        if (product_attribute_id == 'fill the tank') {
            var price = parseFloat($('#fill_the_tank_price_admin').val());
            var recalculated_tax = ((price * product_tax ) / 100);
            var final_price = (price + recalculated_tax).toFixed(2);
            $('.price').html(final_price + '<small> incl vat</small>' + " <small>*</small><br><small class='fill_tank_msg'>* this price will change once the driver confirms the amount of quantity used</small>");
            $.ajax({
                url:"{{ route('quote.fetch.price_fill_tank.order') }}",
                method: "POST",
                data: {'product_attribute_id':product_attribute_id , "_token": "{{ csrf_token() }}"},
                success:function(data) {
                }
            });
        } else {
        	if (product_attribute_id != '') {
                $.ajax({
                    url:"{{ route('quote.fetch.price.order') }}",
                    method: "POST",
                    data: {'product_attribute_id':product_attribute_id , "_token": "{{ csrf_token() }}"},
                    success:function(data) {
                        price = JSON.parse(data);
                        price = parseFloat(price);
                        var recalculated_tax = (( price * product_tax ) / 100);
                        var final_price = (price + recalculated_tax).toFixed(2);
                        $('#price').val(price);
                        $('.price').html(final_price + '<small> incl vat</small>');
                    }
                });
            }
        }
    });
});
</script>
@endsection

Spamworldpro Mini