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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/resources/views/front/product-order-checkout.blade.php
@extends('layouts.front.app')
@section('content')
@include('layouts.front.other-menu')
<section class="container content">
    <div class="row">
		<div class="col-md-12">
	    	<div class="box-body">
	    	    @include('layouts.errors-and-messages')
	    	</div>
		</div>
        <div class="col-md-12">
            <ul class="stepper stepper-horizontal">
                <li class="active">
                    <a href="#!">
                        <span class="circle">1</span>
                        <span class="label">Delivery</span>
                    </a>
                </li>
                <li class="circle">
                    <a href="#!">
                        <span class="circle">2</span>
                        <span class="label">Payment</span>
                    </a>
                </li>
                <li class="circle">
                    <a href="#!">
                        <span class="circle">3</span>
                        <span class="label">Confirmation</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</section>
<section class="container content">
    <div class="row">
        <form name="order" id="order" class="" method="post" action="">
            <div class="col-md-8">
                <div class="logincontainer">
                    <div class="header-lined">
                        <h2>Your Details</h2>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label for="full_name">Full Name <span class="text-danger">*</span></label>
                            <input type="text" name="full_name" id="full_name" placeholder="First Name" readonly class="form-control input-lg" value="{{ $customer->name }}" />
                        </div>
                        <div class="col-md-6">
                            <label for="first_name">Email <span class="text-danger">*</span></label>
                            <input type="text" name="email" id="email" placeholder="Email" readonly class="form-control input-lg" value="{{ $customer->email }}" />
                        </div>
                    </div>
                    <div class="header-lined margin-top-30">
                        <h2>Billing Address</h2>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label for="address_line1">Address 1 <span class="text-danger">*</span></label>
                            <input type="text" name="address_line1_billing" id="address_line1_billing" required placeholder="Address 1" class="form-control input-lg" value="{{ $billingAddress->address_1 ?? '' }}" />
                            {{-- For no address availabe --}}
                            <input type="hidden" name="billing_address_availability" id="billing_address_availability" value="{{ !is_null( $billingAddress ) ? $billingAddress->id: '' }}">
                        </div>
                        <div class="col-md-6">
                            <label for="address_line2">Address 2</label>
                            <input type="text" name="address_line2_billing" id="address_line2_billing" placeholder="Address 2" class="form-control input-lg" value="{{ $billingAddress->address_2 ?? '' }}" />
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label for="town">Town <span class="text-danger">*</span></label>
                            <input type="text" name="town_billing" id="town_billing" placeholder="Town" required class="form-control input-lg" value="{{ $billingAddress->town ?? '' }}" />
                        </div>
                        <div class="col-md-6">
                            <label for="county">County <span class="text-danger">*</span></label>
                            <input type="text" name="county_billing" id="county_billing" required placeholder="County" class="form-control input-lg" value="{{ $billingAddress->county ?? '' }}" />
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <label for="postal_code">Eircode <span class="text-danger">*</span></label>
                            <input type="text" name="postal_code_billing" id="postal_code_billing" required placeholder="Eircode" class="form-control input-lg" value="{{ $billingAddress->zip ?? '' }}" />
                        </div>
                        <div class="col-md-6">
                            <label for="contact">Phone Number <span class="text-danger">*</span></label>
                            <input type="text" name="contact_billing" id="contact_billing" required placeholder="Contact" class="form-control input-lg" value="{{ $billingAddress->phone ?? '' }}" />
                            {{-- For payment address --}}
                            <input type="radio" style="display: none;" value="{{ $billingAddress->id ?? '' }}" name="billing_address" checked="">
                            {{-- For delivery address --}}
                            {{-- <input type="radio" value="{{ $billingAddress->id }}"name="delivery_address" checked=""> --}}
                        </div>
                    </div>
                    <div class="header-lined margin-top-30">
                        <h2>Delivery Details</h2>
                    </div>
                    <div class="row">
                    	<div class="col-md-12 margin-bottom-20">
                            <input type="checkbox" checked name="delivery_address_checkbox" id="delivery_address_checkbox" value="1" /> Same as Billing Address
                        </div>
                    </div>
                    <div class="delivery_box" style="display: none;">
                        <div class="row">
                            <div class="col-md-6">
                                @if( $deliveryAddresses )
                                <label for="available_address">Select Address</label>
                                <select name="address_list" id="address_list" class="form-control input-lg" required="" disabled="disabled">
                                    <option value="">Select Address</option>
                                    @foreach($deliveryAddresses as $address)
                                        <option value="{{ $address->id }}">{{ $address->address_1 }}</option>
                                    @endforeach
                                </select>
                                @else
                                    <div class="alert alert-warning">
                                        <strong>No Address Available !</strong> &nbsp; &nbsp;
                                        <a href="#" class="btn btn-sm btn-primary" id="bt_add_new_address">Add New Address</a>
                                    </div>
                                @endif
                            </div>
                            <div class="col-md-6">
                                <label for="available_address">New Address?</label>
                                <a href="#" class="btn btn-dark btn-lg btn-block font-black" id="bt_add_new_address">Add New Address</a>
                            </div>
                        </div>
                        <br>
                        <div class="row">
                            <div class="col-md-6">
                                <label for="address_line1">Address 1</label>
                                <input type="text" name="address_line1_delivery" id="address_line1_delivery" placeholder="Address 1" class="form-control input-lg" readonly />
                            </div>
                            <div class="col-md-6">
                                <label for="address_line2">Address 2</label>
                                <input type="text" name="address_line2_delivery" id="address_line2_delivery" placeholder="Address 2" class="form-control input-lg" readonly />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <label for="town">Town</label>
                                <input type="text" name="town_delivery" id="town_delivery" placeholder="Town" class="form-control input-lg" readonly />
                            </div>
                            <div class="col-md-6">
                                <label for="county">County</label>
                                <input type="text" name="county_delivery" id="county_delivery" placeholder="County" class="form-control input-lg" readonly />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <label for="postal_code">Eircode</label>
                                <input type="text" name="postal_code_delivery" id="postal_code_delivery" placeholder="Eircode" class="form-control input-lg" readonly />
                            </div>
                            <div class="col-md-6">
                                <label for="contact">Phone Number</label>
                                <input type="text" name="contact_delivery" id="contact_delivery" placeholder="Contact" class="form-control input-lg" readonly />
                            </div>
                        </div>
                    </div>
                    <div class="header-lined margin-top-30">
                        <h2>Order Notes</h2>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <label for="order_notes">Order Notes</label>
                            <input type="text" name="order_notes" id="order_notes" placeholder="Notes About the order" class="form-control input-lg" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-4 totals-quote">
                <div class="logincontainer">
                    <div class="header-lined">
                        <h2>Order Summary</h2>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <span>Subtotal</span>
                        </div>
                        <div class="col-md-6 pull-right">
                            <strong><span>{{config('cart.currency_symbol')}}{{ number_format($subtotal, 2, '.', ',') }}</span></strong>
                        </div>
                    </div>
                    @if(isset($shippingFee) && $shippingFee != 0)
					<div class="row">
                        <div class="col-md-6">
                            <span>Shipping</span>
                        </div>
                        <div class="col-md-6 pull-right">
                            <strong><span>{{config('cart.currency_symbol')}}{{ $shippingFee }}</span></strong>
                        </div>
                    </div>
                    @endif
                    <div class="row">
                        <div class="col-md-6">
                            <span>Vat</span>
                        </div>
                        <div class="col-md-6 pull-right">
                            <strong><span>{{config('cart.currency_symbol')}}{{ number_format($tax, 2) }}</span></strong>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <span>Discount</span>
                        </div>
                        <div class="col-md-6 pull-right">
                            <strong><span>{{config('cart.currency_symbol')}}{{ number_format($discountAmount, 2, '.', ',') }}</span></strong>
                        </div>
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-md-6">
                            <h3>TOTAL</h3>
                        </div>
                        <div class="col-md-6 pull-right">
                            <h3><span>{{config('cart.currency_symbol')}}{{ number_format( ( ( $total + $tax ) - $discountAmount ), 2, '.', ',') }}</span></h3>
                        </div>
                        @csrf
                    </div>
                    <div class="row darker-colour">
                        <div class="col-md-12">
	                        <button type="button" class="btn btn-lg btn-block btn-send" id="btn_make_payment">Continue</button>
	                        {{-- Payment options --}}
	                        <div style="display: none;">
	                        @foreach($payments as $payment)
	                            @include('layouts.front.payment-options', compact('payment', 'total', 'shipment_object_id', 'discountAmount', 'orderDetails'))
	                        @endforeach
	                    	</div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</section>
<div id="modal_create_address" 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>
				<h4 class="modal-title">Create Address</h4>
			</div>
			<div class="modal-body">
				<form class="form" name="frm_create_address" id="frm_create_address" autocomplete="off">
					<div class="row">
					    <div class="col-md-6">
					    	{{ csrf_field() }}
					        <div class="form-group">
					            <label for="address_1">Address 1 <span class="text-danger">*</span></label>
					            <input type="text" name="address_1" id="address_1" placeholder="Address 1" class="form-control input-lg" required="">
					        </div>
					    </div>
					    <div class="col-md-6">
					        <div class="form-group">
					            <label for="address_2">Address 2 </label>
					            <input type="text" name="address_2" id="address_2" placeholder="Address 2" class="form-control input-lg">
					        </div>
					    </div>
					</div>
					<div class="row">
					    <div class="col-md-6">
					        <div class="form-group">
					            <label for="town">Town <span class="text-danger">*</span></label>
					            <input type="text" name="town" id="town" required="" placeholder="Town" class="form-control input-lg">
					        </div>
					    </div>
					    <div class="col-md-6">
					        <div class="form-group">
					            <label for="county">County <span class="text-danger">*</span></label>
					            <input type="text" name="county" id="county" required="" placeholder="County" class="form-control input-lg">
					        </div>
					    </div>
					</div>
					<div class="row">
					    <div class="col-md-6">
					        <div id="provinces" class="form-group" style="display: none;"></div>
					        <div id="cities" class="form-group" style="display: none;"></div>
					        <div class="form-group">
					            <label for="zip">Eircode <span class="text-danger">*</span></label>
					            <input type="text" name="zip" id="zip" required="" placeholder="Eircode" class="form-control input-lg">
					        </div>
					    </div>
					    <div class="col-md-6">
					        <div class="form-group">
					            <label for="phone">Phone Number <span class="text-danger">*</span></label>
					            <input type="text" name="phone" id="phone" required="" placeholder="Phone number" class="form-control input-lg">
					        </div>
					    </div>
					</div>
					<div class="row">
					    <div class="col-md-6">
					        <div class="row margin-top-30">
					            <div class="col-md-12 btn-margin-top">
					                <button type="submit" class="btn btn-lg btn-block btn-send" id="bt_save_new_address">Create</button>
					            </div>
					        </div>
					    </div>
					</div>
				</form>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</div>
@include('layouts.front.call-to-action-footer')
@endsection
@section('js')
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js') }}"></script>
<script type="text/javascript">
$(function(){
	// Form validation
	$('#frm_create_address').validate({
		rules: {
			address_1: { required: true },
			county: { required: true },
			town: { required: true },
			zip: { required: true },
			phone: { required: true, digits: true, minlength: 7, maxlength: 11 }
		},
		messages: {
			address_1: { required: 'Please enter your Address 1' },
			county: { required: 'Please enter your county' },
			town: { required: 'Please enter your town' },
			zip: { required: 'Please enter your eircode' },
			phone: { required: 'Please enter your phone number', digits: 'Please enter a valid phone number', minlength: 'The phone must be between 7 and 11 digits', maxlength: 'The phone must be between 7 and 11 digits' }
		}
	});
	$('#bt_add_new_address').click(function(){
		$('#frm_create_address')[0].reset();
		$('#modal_create_address').modal({
		    backdrop: 'static',
		    keyboard: false
		});
	});
	$('#frm_create_address').submit(function(e){
	    e.preventDefault();
	});
    $('#bt_save_new_address').click(function(){
		if( $('#frm_create_address').valid() )
		{
			$.ajax({
				url: "{{ url('create-address') }}",
				method: 'post',
				data: {
					// alias: $('#alias').val(),
					address_1: $('#address_1').val(),
					address_2: $('#address_2').val(),
					county: $('#county').val(),
					town: $('#town').val(),
					zip: $('#zip').val(),
					phone: $('#phone').val(),
				},
				headers: {
			        'X-CSRF-TOKEN': '{{ csrf_token() }}',
			    },
			    success: function(response){
			    	if( response.status == 1 )
			    	{
			    		$('#modal_create_address').modal('hide');
			    		var option = '<option selected value="'+ response.data.id +'">'+ response.data.address_1 +'</option>';
			    		$("#address_list option:last").after(option);
			    		$('#address_list').change();
			    		$('#address_line1_delivery').val(response.data.address_1);
			    		$('#address_line2_delivery').val(response.data.address_2);
			    		$('#town_delivery').val(response.data.town);
			    		$('#county_delivery').val(response.data.country_id);
			    		$('#postal_code_delivery').val(response.data.zip);
			    		$('#contact_delivery').val(response.data.phone);
			    	}
			    	else
			    	{
			    		alert(response.msg);
			    	}
			    }
			});
		}
    });
    $('#order').validate({
		rules: {
			address_line1_billing: { required: true },
			county_billing: { required: true },
			town_billing: { required: true },
			postal_code_billing: { required: true },
			contact_billing: { required: true, digits: true, minlength: 7, maxlength: 11 }
		},
		messages: {
			address_line1_billing: { required: 'Please enter Address 1' },
			county_billing: { required: 'Please enter county' },
			town_billing: { required: 'Please enter town' },
			postal_code_billing: { required: 'Please enter post code' },
			contact_billing: { required: 'Please enter phone number', digits: 'Please enter a valid phone number', minlength: 'The phone must be between 7 and 11 digits', maxlength: 'The phone must be between 7 and 11 digits' }
		}
	});
	$('#btn_make_payment').click(function(){
		if( $('#delivery_address_checkbox').is(':checked')  )
		{
			if( $('#billing_address_availability').val() == '' )
			{
				if( $('#order').valid() )
				{
					$.ajax({
						url: "{{ url('create-billing-address') }}",
						method: 'post',
						data: {
							address_1: $('#address_line1_billing').val(),
							address_2: $('#address_line2_billing').val(),
							county: $('#county_billing').val(),
							town: $('#town_billing').val(),
							zip: $('#postal_code_billing').val(),
							phone: $('#contact_billing').val(),
						},
						headers: {
					        'X-CSRF-TOKEN': '{{ csrf_token() }}',
					    },
					    success: function(response){
					    	if( response.status == 1 )
					    	{
					    		alert(response.msg);

					    		setTimeout(function () { location.reload(true); }, 2000);
					    	}
					    	else
					    	{
					    		alert(response.msg);
					    	}
					    }
					});
				}
			}
			else
			{
				$('#delivery_note').val($('#order_notes').val());
				$('#paywithstripe').click();
			}
		}
		else
		{
			if( $('#address_list').val() != '' )
			{
				$('#delivery_note').val($('#order_notes').val());
				$('#paywithstripe').click();
			}
			else
			{
				alert('Please select the delivery address');
			}
		}
	});
    $("#delivery_date").datepicker({ 
        autoclose: true, 
        todayHighlight: true
    }).datepicker('update', new Date());
    $(document).on('change','#address_list',function(){
        var address_id = $(this).val();
        if(address_id != ''){
            $.ajax({
                url:"{{ route('checkout.fetch.address') }}",
                method: "POST",
                data: {'address_id':address_id , "_token": "{{ csrf_token() }}"},
                success:function(data){
                    data = JSON.parse(data);
                    if(data != ''){
                        $('#address_line1_delivery').val(data.address_1);
                        $('#address_line2_delivery').val(data.address_2);
                        $('#county_delivery').val(data.county);
                        $('#town_delivery').val(data.town);
                        $('#postal_code_delivery').val(data.zip);
                        $('#contact_delivery').val(data.phone);
                    }
                }
            });
        }else{
            $('#address_line1_delivery').val('');
            $('#address_line2_delivery').val('');
            $('#county_delivery').val('');
            $('#town_delivery').val('');
            $('#postal_code_delivery').val('');
            $('#contact_delivery').val('');
        }
    });
    $(document).on('click','#delivery_address_checkbox',function(){
        if($(this).prop('checked')==true){
            $('.delivery_box').hide();
            $('#address_list').prop('disabled', true);
            $('.delivery_address_id').val($('input[name="billing_address"]').val());
        }else{
            $('.delivery_box').show();
            $('#address_list').prop('disabled', false);
            $('.delivery_address_id').val('');
        }
    });
});
</script>
<script type="text/javascript">
        function setTotal(total, shippingCost) {
            let computed = +shippingCost + parseFloat(total);
            $('#total').html(computed.toFixed(2));
        }
        function setShippingFee(cost) {
            el = '#shippingFee';
            $(el).html(cost);
            $('#shippingFeeC').val(cost);
        }
        function setCourierDetails(courierId) {
            $('.courier_id').val(courierId);
        }
        $(document).ready(function () {
            let clicked = false;
            $('#sameDeliveryAddress').on('change', function () {
                clicked = !clicked;
                if (clicked) {
                    $('#sameDeliveryAddressRow').show();
                } else {
                    $('#sameDeliveryAddressRow').hide();
                }
            });
            let billingAddress = 'input[name="billing_address"]';
            $(billingAddress).on('change', function () {
                let chosenAddressId = $(this).val();
                $('.address_id').val(chosenAddressId);
                $('.delivery_address_id').val(chosenAddressId);
            });
            // Old code
            /*let deliveryAddress = 'input[name="delivery_address"]';
            $(deliveryAddress).on('change', function () {
                let chosenDeliveryAddressId = $(this).val();
                $('.delivery_address_id').val(chosenDeliveryAddressId);
            });*/
            $('#address_list').on('change', function () {
                let chosenDeliveryAddressId = $(this).val();
                $('.delivery_address_id').val(chosenDeliveryAddressId);
            });
            let courier = 'input[name="courier"]';
            $(courier).on('change', function () {
                let shippingCost = $(this).data('cost');
                let total = $('#total').data('total');

                setCourierDetails($(this).val());
                setShippingFee(shippingCost);
                setTotal(total, shippingCost);
            });
            if ($(courier).is(':checked')) {
                let shippingCost = $(courier + ':checked').data('cost');
                let courierId = $(courier + ':checked').val();
                let total = $('#total').data('total');

                setShippingFee(shippingCost);
                setCourierDetails(courierId);
                setTotal(total, shippingCost);
            }
        });
    </script>
@endsection

Spamworldpro Mini