Current File : //home/tradevaly/new.tradevaly.com.bd/resources/views/frontend/pages/advertiser_buy_view.blade.php
@extends('frontend.layouts.app')

@section('content')
 @php
        $my_ip = ip_country(visitorip())->country_code;
@endphp
  <section class="services-banner services-background elite-banner">
            <div class="container">
                <div class="row">
                    <div class="mob-bg">
                        <h1 class="mb-0 text-danger"> Advertiser </h1>
                        <h2 style="color:#438634;"> Advertiser </h2>
                        <span style="opacity:0;" id="bdt_rate" data-bdt_rate="{{ settings()->bdt_rate }}"></span>
                    </div>
                </div>
            </div>
        </section>
        <!--/*********************Banner *********************************************** -->

        <section class="container">
            <div class="elite-memeber-sec services-card">
                <div class="row">
                    <div class="col-md-6" id="premiumPaymentForm">
                      <div class="col-lg-12 mb-4">
                        <div class="card" id="home_section">
                            <div class="card-body">
                              
                              <form method="POST" action="{{ route('advertiser.buy',$slug) }}" accept-charset="UTF-8" class="checkout elite-register-form" id="premiumPackageFormGuest" novalidate="novalidate">
                            @csrf
                            <input type="hidden" name="duration" value="{{ $duration }}"/>
                            <div class="header-content">
                                <h2 class="text-center w-100 elite-bg">Activate your Banner</h2>
                            </div>
                            <div class="">  
                                <div class="form-row">
                                    <table class="table">
                                    <thead class=" ">
                                     <tr><th>Placement</th>
                                     <th>Duration</th>
                                     <th>Tariff In BDT</th>
                                    </tr></thead>
                                    <tbody>                                     
                                    <tr>
                                        <td>{{ $slug }}</td>

                                        <td>
                                            <select name="duration" id="" class="form-control duration_change" data-name="{{ $slug }}" 
                                            data-price="{{ $amount }}" data-after_price="{{ after_discount($amount,$discount) }}">
                                                <option {{ $duration == 1? 'selected':' ' }} value="1">1 Month</option>
                                                <option {{ $duration == 2? 'selected':' ' }} value="2">2 Months</option>
                                                <option {{ $duration == 3? 'selected':' ' }} value="3">3 Months</option>
                                                <option {{ $duration == 4? 'selected':' ' }} value="4">4 Months</option>
                                                <option {{ $duration == 5? 'selected':' ' }} value="5">5 Months</option>
                                                <option {{ $duration == 6? 'selected':' ' }} value="6">6 Months</option>
                                                <option {{ $duration == 7? 'selected':' ' }} value="7">7 Months</option>
                                                <option {{ $duration == 8? 'selected':' ' }} value="8">8 Months</option>
                                                <option {{ $duration == 9? 'selected':' ' }} value="9">9 Months</option>
                                                <option {{ $duration == 10? 'selected':' ' }} value="10">10 Months</option>
                                                <option {{ $duration == 11? 'selected':' ' }} value="11">11 Months</option>
                                                <option {{ $duration == 12? 'selected':' ' }} value="12">1 Year</option>
                                            </select>
                                        </td>
                                         <td id="{{ $slug }}">
                                             
                                             <!--<del>Tk {{ $amount*$duration }}</del>  ${{ after_discount($amount,$discount)*$duration  }}-->
                                            
                                             @if($discount != 0)  <del>Tk {{ ($amount*$duration) * settings()->bdt_rate }}</del> @endif Tk{{ (after_discount($amount,$discount)*$duration) * settings()->bdt_rate  }}
                                             
                                             </td>
                                      </tr>
                                    </tbody>
                                  </table>
                                </div> 
                                <div class="col-12 form-p-0 mt-3">
                                        <div class="col-lg-6 p-0 mb-3">
                                             {!! app('captcha')->display() !!}
                                    @if ($errors->has('g-recaptcha-response'))
                                        <span class="help-block">
                                            <strong>{{ translate($errors->first('g-recaptcha-response')) }}</strong>
                                        </span>
                                    @endif
                                       </div> 
                                     <div class="col-lg-12">
                                       <div class="form-check mb-4">
                                          <input class="form-check-input" type="checkbox" id="invalidCheck" name="check_status" required>
                                          <label class="form-check-label" for="invalidCheck">
                                           I agree to the <a href="{{ url('terms') }}">terms and conditions </a>  and  <a href="{{ url('privacy&policy') }}">privacy policy </a>
                                          </label>
                                          <div class="invalid-feedback">
                                            You must agree before submitting.
                                          </div>
                                        </div>
                                     </div>

                                    <button type="submit" class="btn btn-outline-danger elite-package-bg-with-color" id="paymentformbutton">Confirm</button>

                                    <nav class="mt-3 cards-image">
                                        <ul class="list-inline">
                                            <li class="list-inline-item">
                                                <img src="/public/stripe.png" alt="Secure Payment">
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                            </div>              
                        </form>
                            </div>
                        </div>
                    </div>
                    </div>
                    <div class="col-lg-6">
                        <nav>
                            <h3 class="elite">Dear Concern</h3>
                            <p>For your attachment please follow the following instruction</p>
                            <h4>Banner Details :</h4>
                            <ul class="packageDetailList package-detail-elite-scroll">
                                <li data-toggle="tooltip" data-html="true" data-placement="left" title="" data-original-title="Yes"><i class="far fa-check-square" aria-hidden="true"></i> Banner Placement  : {{ $slug }}</li>
                                <li data-toggle="tooltip" data-html="true" data-placement="left" title="" data-original-title="Yes"><i class="far fa-check-square" aria-hidden="true"></i> Banner Dimensions: @php $dymension = $slug.'_dymension' @endphp - {{ settings()->$dymension }}  px </li>
                                <li data-toggle="tooltip" data-html="true" data-placement="left" title="" data-original-title="Yes"><i class="far fa-check-square" aria-hidden="true"></i> Image size (MB) : @php $size = $slug.'_size' @endphp Max- {{ settings()->$size }} </li>
                                <li data-toggle="tooltip" data-html="true" data-placement="left" title="" data-original-title="Yes"><i class="far fa-check-square" aria-hidden="true"></i> Banner Location : <a href="{{ $link }}" target="_blank">Link</a></li>
                            </ul>
                            <p><strong>Please send the banner image to the following E-mail address ;</strong></p>
                            <p><strong>E-mail :</strong> <a href="mailto:add@tradevaly.com.bd">add@tradevaly.com.bd</a></p>
                        </nav>
                    </div>
                </div>
            </div>
        </section>


@endsection
@section('script')
 <script>
        $(document).on('change', '[name=ccountry_id]', function() {
            var state_id = $(this).val();
            get_ccity(state_id);
        });
        
        function get_ccity(country_id) {
            $("#pegphone").val("");
            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                url: "{{route('country.code')}}",
                type: 'POST',
                data: {
                    id  : country_id
                },
                success: function (response) {
                    $("#pegphone").val(response);
                }
            });
        }
        </script>
        <script type="text/javascript">
    $(document).ready(function() {
         $('.duration_change').change(function(){
        let banner_name = $(this).data('name');
        let afterPrice = $(this).data('after_price');
        let banner_price = $(this).data('price');
        let bdt_rate = $('#bdt_rate').data('bdt_rate');
        let duration = $(this).val();
        
        
       let className =  document.getElementById(banner_name);
        afterPrice = afterPrice*duration
        banner_price = banner_price*duration
        
        bdt_afterPrice = afterPrice*bdt_rate
        bdt_banner_price = banner_price*bdt_rate
        
        // import value in html
        className.innerHTML = `@if($discount != 0) <del>Tk${bdt_banner_price} </del> @endif Tk${bdt_afterPrice}  `;
    })
       
    });
</script>
@endsection