@extends('user.app')



@section('pagetitle')



   {{ $cms->title }}



@stop



@section('pagedescription')



    @php 



      echo $meta_details = trim($cms->meta_details);



    @endphp



@stop



@section('pagekeywords')



    @php 



      echo $meta_tags = trim($cms->meta_tags);



    @endphp



@stop



@section('main-content')



<script src="https://code.jquery.com/jquery-1.12.4.js"></script>



<script>



$( function() {



        $('#ship_dif').change(function () {

            if ($(this).prop("checked")) {



            var first_name_shipping = $("#first_name_shipping").val();



            var last_name_shipping = $("#last_name_shipping").val();



            var email_shipping = $("#email_shipping").val();



            var mobile_no_shipping = $("#mobile_no_shipping").val();



            var country_shipping = $("#country_shipping").val();



            var addreess_shipping = $("#addreess_shipping").val();



            var city_shipping = $("#city_shipping").val();



            var state_shipping = $("#state_shipping").val();



            var postcode_shipping = $("#postcode_shipping").val();



            // alert(first_name_shipping);

            // alert(last_name_shipping);

            // alert(email_shipping);

            // alert(mobile_no_shipping);

            // alert(country_shipping);

            // alert(addreess_shipping);

            //  alert(city_shipping);

            // alert(state_shipping);

            // alert(postcode_shipping);



            $("#first_name_billing").val(first_name_shipping);



            $("#last_name_billing").val(last_name_shipping);



            $("#email_billing").val(email_shipping);



            $("#mobile_no_billing").val(mobile_no_shipping);



            $("#country_billing").val(country_shipping);



            $("#addreess_billing").val(addreess_shipping);



            $("#city_billing").val(city_shipping);



            $("#state_billing").val(state_shipping);



            $("#postcode_billing").val(postcode_shipping);

         }



    });



});



</script>



<div class="banner-part">



     <img src="{{ asset('user/images/inner-ban1.jpg') }}" alt="">    



    <div class="inner-ban-tx">

        <div class="container">

            <div class="row">

        <h2>CHECKOUT</h2>

        </div>

            </div>

    </div>



</div>







<section class="checkout-area ptb-100">



    <div class="container">



@php 



           $first_name_shipping = '';



           $last_name_shipping = '';



           $email_shipping = '';



           $mobile_no_shipping = '';



           $country_shipping = '';



           $addreess_shipping = '';



           $city_shipping = '';



           $state_shipping ='';



           $postcode_shipping='';







           $first_name_billing = '';



           $last_name_billing = '';



           $email_billing = '';



           $mobile_no_billing = '';



           $country_billing = '';



           $addreess_billing  = '';



           $city_billing = '';



           $state_billing  = '';



           $postcode_billing = '';



          



           if(isset($usermeta))



           {



            $shipping_data = json_decode($usermeta->shipping_address);



             $billing_data = json_decode($usermeta->billing_address);







             $first_name_shipping = $shipping_data->first_name_shipping;



             $last_name_shipping = $shipping_data->last_name_shipping;



             $email_shipping = $shipping_data->email_shipping;



             $mobile_no_shipping = $shipping_data->mobile_no_shipping;



             $country_shipping = $shipping_data->country_shipping;



             $addreess_shipping = $shipping_data->addreess_shipping;



             $city_shipping = $shipping_data->city_shipping;



             $state_shipping = $shipping_data->state_shipping;



             $postcode_shipping = $shipping_data->postcode_shipping;







             $first_name_billing = $billing_data->first_name_billing;



             $last_name_billing = $billing_data->last_name_billing;



             $email_billing = $billing_data->email_billing;



             $mobile_no_billing = $billing_data->mobile_no_billing;



             $country_billing = $billing_data->country_billing;



             $addreess_billing = $billing_data->addreess_billing;



             $city_billing = $billing_data->city_billing;



             $state_billing = $billing_data->state_billing;



             $postcode_billing = $billing_data->postcode_billing;



           }



             







           @endphp



            {!! Form::open(array('route' => 'checkout.store','method'=>'POST', 'id' =>'facaltyadd')) !!} 



            <div class="row">



                <div class="col-lg-12 col-md-12">



                    <div class="cart-table table-responsive">



                        @include('user/layouts/messages');



                    </div>



                </div>



                <div class="col-md-8">



                    <div class="checkout">



                        <div class="cartleft">



                            <div class="col-md-12"><h5>Order Details</h5></div>



                            @php



                               $totalprice = 0;



                               $subtotalprice = 0;



                               $coupon_code = '';



                               $coupon_discount = 0;



                               $shipping_charge = 0;



                            @endphp



                            @if(isset($carts))



                                @foreach($carts as $cart)



                                    @php



                                        $subtotalprice =  $subtotalprice + ($cart->price * $cart->quantity);



                                        $coursesimage = coursesimage($cart->product_id);



                                    @endphp



                                <div class="cartsec">



                                    <div class="col-md-3">



                                        <a href="{{url('/')}}/enrol/{{ $cart->slug }}"><img src="{{ $coursesimage }}" alt="shop"></a>



                                    </div>



                                    <div class="col-md-9">



                                        <h3><a href="{{url('/')}}/enrol/{{ $cart->slug }}">{{$cart->name}}</a> X {{ $cart->quantity }}</h3>



                                         <p class="tutor">By <a href="{{url('/')}}/educator/{{ coursesfacaltyurl($cart->product_id) }}" class="educatorlink">{{ coursesfacalty($cart->product_id) }}</a></p>                                       



                                        <h4 class="cross-t">



                                           Rs.{{ $cart->price }}



                                       </h4>                                   



                                    </div>



                                </div>



                                </br>



                                @endforeach



                            @endif



                            <div class="form-group mb-0">



                                <label>Order Notes</label>



                                {{ Form::textarea('message', null, array('placeholder'=>'Notes about your order, e.g. special notes for delivery...' ,'class'=>'form-control')) }}



                            </div>



                        </div>



                    </div>



                    <div class="checkout">



                        <div class="cartleft">



                            <div class="col-md-12"><h5>Shipping Details</h5></div>







                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>First Name*</label>



                                    {{ Form::text('first_name_shipping', $first_name_shipping, array('required','placeholder'=>'First Name','class'=>'form-control','id'=>'first_name_shipping'  )) }}



                                </div>



                            </div>



                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>Last Name*</label>



                                    {{ Form::text('last_name_shipping',$last_name_shipping, array('required','placeholder'=>'Last Name','class'=>'form-control','id'=>'last_name_shipping'  )) }}



                                </div>



                            </div>



                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>Email*</label>



                                    {{ Form::email('email_shipping', $email_shipping , array('required', 'placeholder'=>'Email ID*' ,'id'=>'email_shipping' )) }}



                                </div>



                            </div>



                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>Phone*</label>



                                   {{ Form::text('mobile_no_shipping',$mobile_no_shipping, array('required', 'placeholder'=>'Mobile No*' ,'id'=>'mobile_no_shipping' )) }}



                                </div>



                            </div>



                            <div class="col-lg-12 col-md-12">



                                <div class="form-group">



                                    <label>Country*</label>



                                    {{ Form::text('country_shipping',$country_shipping, array('required', 'placeholder'=>'Country','class'=>'form-control' ,'id'=>'country_shipping' )) }}



                               



                                </div>



                            </div>



                            <div class="col-lg-12 col-md-12">



                                <div class="form-group">



                                    <label>Addreess*</label>



                                     {{ Form::text('addreess_shipping',$addreess_shipping, array('required', 'placeholder'=>'Addreess','class'=>'form-control' ,'id'=>'addreess_shipping' )) }}



                                </div>



                            </div>



                            <div class="col-lg-12 col-md-12">



                                <div class="form-group">



                                    <label>Town/City*</label>



                                     {{ Form::text('city_shipping', $city_shipping, array('required', 'placeholder'=>'City','class'=>'form-control','id'=>'city_shipping'  )) }}



                                </div>



                            </div>



                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>State*</label>



                                     {{ Form::text('state_shipping',$state_shipping, array('required', 'placeholder'=>'State','class'=>'form-control' ,'id'=>'state_shipping' )) }}



                                </div>



                            </div>



                            <div class="col-lg-6 col-md-6">



                                <div class="form-group">



                                    <label>Postcode/ZIP*</label>



                                     {{ Form::text('postcode_shipping',$postcode_shipping, array('required', 'placeholder'=>'Postcode','class'=>'form-control' ,'id'=>'postcode_shipping' )) }}



                                </div>



                            </div>



                        </div>



                    </div>



                    <div class="checkout">



                        <div class="cartleft">



                            <div class="col-md-12"><h5>Billing Details  <span>



                                <input type="checkbox" id="ship_dif">Same as Shipping Address</span></h5> </div>



                            <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>First Name*</label>



                                        {{ Form::text('first_name_billing',  $first_name_billing , array('required','placeholder'=>'First Name','class'=>'form-control','id'=>'first_name_billing' )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>Last Name*</label>



                                        {{ Form::text('last_name_billing', $last_name_billing, array('required','placeholder'=>'Last Name','class'=>'form-control','id'=>'last_name_billing'  )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>Email*</label>



                                        {{ Form::email('email_billing', $email_billing , array('required', 'placeholder'=>'Email ID*','id'=>'email_billing'  )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>Phone*</label>



                                       {{ Form::text('mobile_no_billing',  $mobile_no_billing , array('required', 'placeholder'=>'Mobile No*','id'=>'mobile_no_billing'  )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-12 col-md-12">



                                    <div class="form-group">



                                        <label>Country*</label>



                                        {{ Form::text('country_billing',  $country_billing, array('required', 'placeholder'=>'Country','class'=>'form-control' ,'id'=>'country_billing' )) }}



                                   



                                    </div>



                                </div>



                                



                                <div class="col-lg-12 col-md-12">



                                    <div class="form-group">



                                        <label>Addreess*</label>



                                         {{ Form::text('addreess_billing',  $addreess_billing , array('required', 'placeholder'=>'Addreess','class'=>'form-control','id'=>'addreess_billing'  )) }}



                                    </div>



                                </div>



                                <div class="col-lg-12 col-md-12">



                                    <div class="form-group">



                                        <label>Town/City*</label>



                                         {{ Form::text('city_billing',  $city_billing , array('required', 'placeholder'=>'City','class'=>'form-control' ,'id'=>'city_billing' )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>State*</label>



                                         {{ Form::text('state_billing',  $state_billing , array('required', 'placeholder'=>'State','class'=>'form-control','id'=>'state_billing'  )) }}



                                    </div>



                                </div>



                                



                                <div class="col-lg-6 col-md-6">



                                    <div class="form-group">



                                        <label>Postcode/ZIP*</label>



                                         {{ Form::text('postcode_billing',  $postcode_billing , array('required', 'placeholder'=>'Postcode','class'=>'form-control' ,'id'=>'postcode_billing' )) }}



                                    </div>



                                </div>



                        </div>



                    </div>



                </div>







                <div class="col-md-4 floatdiv">



                    <div class="checkout">



                        <div class="cartright">



                            <h5>Price Details</h5>



                            @php



                               $totalprice = 0;



                               $subtotalprice = 0;



                               $coupon_code = '';



                               $coupon_discount = 0;



                               $shipping_charge = 0;



                            @endphp



                            @if(isset($carts))



                                @foreach($carts as $cart)



                                    @php



                                        $subtotalprice =  $subtotalprice + ($cart->price * $cart->quantity);



                                        $coursesimage = coursesimage($cart->product_id);



                                    @endphp



                                @endforeach



                            <h3>Price( 1 items)<span>Rs.{{number_format((float)$subtotalprice, 2, '.', '')}}</span></h3>



                            @if(isset($ucart_data) && $ucart_data->coupon_code!='')



                            @php 



                             $coupon_code = $ucart_data->coupon_code;



                            @endphp



                            <h3>Coupon : {{$ucart_data->coupon_code}}<a href="<?php echo url('/couponremove/');?>">x</a>



                                @php 



                                $coupon_discount = $ucart_data->coupon_discount;



                                @endphp



                                <span>Rs.{{number_format((float)$ucart_data->coupon_discount, 2, '.', '')}}</span>



                            </h3>



                            @endif



                            @if(isset($ucart_data))



                            <h3>Shipping and Handling



                                @php 



                                $shipping_charge = $ucart_data->shipping_charge;



                                @endphp



                                <span>Rs.0.00</span>



                            </h3>



                             @endif



                            <h4>Order Total



                                @php 



                                if(isset($ucart_data)){



                                $coupon_discount = $ucart_data->coupon_discount;



                                }



                                



                                $totalprice = $subtotalprice - $coupon_discount + $shipping_charge;



                                @endphp



                                <span>Rs.{{number_format((float)$totalprice, 2, '.', '')}}</span>







                            </h4>



                            @endif



                            



                            <!-- <ul>



                                <li><a href="{{ url('/') }}" class="btn btn-primary">Continue Shopping</a></li>



                                <li><a href="{{ url('/checkout') }}" class="btn btn-primary">Place Order</a></li>



                            </ul> -->



                        </div>



                    </div>



                    <div class="checkout">



                        <div class="cartright">



                            <h5>Payment Information</h5>



                            <div class="form-group">



                                <input type="checkbox" id="option3" checked="checked">



                                <label>CC-Avenue Payment</label>



                                <img src="http://buyonlineclasses.com/staging/public/user/images/payimg.jpg" alt="">



                            </div>



                            {!! Form::hidden('user_id',Auth::user()->id ) !!}



                            {!! Form::hidden('cart_subtotal', $subtotalprice ) !!}



                            {!! Form::hidden('shipping_charge',$shipping_charge) !!}



                            {!! Form::hidden('coupon_code', $coupon_code ) !!}



                            {!! Form::hidden('coupon_discount', $coupon_discount ) !!}



                            {!! Form::hidden('cart_total', $totalprice ) !!}



                            <div class="place-order">


                                 <input type="checkbox" name="terms" value="1" required/>                         
                                     <label  class="control-label" >You have read our <a class="special" href="{{ url('/terms-offer')}}" target="_blank" role="link">Terms of offer</a>  for sale.</label>
                                </div>
                                {!! Form::submit('Place Order',array('class'=>'btn btn-primary')) !!}



                            </div>



                        </div>



                    </div>



                </div>



              {!! Form::close() !!}



              <div class="clearfix"></div>



                {{-- <div class="clearfix"></div> --}}



                <div id="exTab1" class="coucont"> 



                    <ul  class="nav nav-pills">



                        <li class="active">



                            <a  href="#1a" data-toggle="tab">Coupon</a>



                        </li>



                        <li>



                            <a href="#2a" data-toggle="tab">Wallet</a>



                        </li>



                    </ul>







                    <div class="tab-content clearfix">



                        <div class="tab-pane active" id="1a">



                            {!! Form::open(array('route' => 'coupon.deduct','method'=>'POST', 'class' => 'form' ,'id' =>'createroomsform')) !!}



                                 {!! Form::text('coupon_code', null,array('placeholder'=>'Coupon Code')) !!}



                                    {{ Form::hidden('user_id',Auth::user()->id ) }}



                                   {{ Form::hidden('subtotalprice',$subtotalprice) }}



                                   {{--  {{ Form::hidden('shipping_charge',$shipping_charge) }}



                                    {{ Form::hidden('subtotalprice',$subtotalprice) }}



                                     {{ Form::hidden('totalprice',$totalprice) }} --}}







                                 {!! Form::submit('Apply Coupon', array('class'=>'add-acte')) !!}



                             {!! Form::close() !!}



                        </div>



                        <div class="tab-pane" id="2a">



                            <h3>Wallet will be implemented soon !!!</h3>



                        </div>



                    </div>



                </div>



                </section>







               







@endsection