
@extends('layoutsutama.peserta')
@section('content')
<!-- Page-content -->
<div class="group-data-[sidebar-size=lg]:ltr:md:ml-vertical-menu group-data-[sidebar-size=lg]:rtl:md:mr-vertical-menu group-data-[sidebar-size=md]:ltr:ml-vertical-menu-md group-data-[sidebar-size=md]:rtl:mr-vertical-menu-md group-data-[sidebar-size=sm]:ltr:ml-vertical-menu-sm group-data-[sidebar-size=sm]:rtl:mr-vertical-menu-sm pt-[calc(theme('spacing.header')_*_1)] pb-[calc(theme('spacing.header')_*_0.8)] px-4 group-data-[navbar=bordered]:pt-[calc(theme('spacing.header')_*_1.3)] group-data-[navbar=hidden]:pt-0 group-data-[layout=horizontal]:mx-auto group-data-[layout=horizontal]:max-w-screen-2xl group-data-[layout=horizontal]:px-0 group-data-[layout=horizontal]:group-data-[sidebar-size=lg]:ltr:md:ml-auto group-data-[layout=horizontal]:group-data-[sidebar-size=lg]:rtl:md:mr-auto group-data-[layout=horizontal]:md:pt-[calc(theme('spacing.header')_*_1.6)] group-data-[layout=horizontal]:px-3 group-data-[layout=horizontal]:group-data-[navbar=hidden]:pt-[calc(theme('spacing.header')_*_0.9)]">
        <div class="container-fluid group-data-[content=boxed]:max-w-boxed mx-auto">
            <div class="mt-1 -ml-3 -mr-3 rounded-none card">
                <div class="card-body !px-2.5">
                    <h4>Konfirmasi Pendaftaran</h4>
                </div>
               
            </div>
            <!--end card-->

            <div class="tab-content">
                <div class="block tab-pane" id="overviewTabs">
                    <div class="grid grid-cols-1 gap-x-5 2xl:grid-cols-12">
                        <div class="2xl:col-span-9">
                            <div class="grid grid-cols-1 gap-x-5 xl:grid-cols-12">
                            </div>
                            <!--end grid-->
                        </div>
                        <!--end col-->
                        <div class="2xl:col-span-12">
                            <div class="card">
                                <div class="card-body">
                                        <div class="grid grid-cols-1 gap-5 lg:grid-cols-2 xl:grid-cols-12">
                                                <div class="xl:col-span-6">
                                                    
                                                    <p class="mb-1"></p>Bukti dan konfirmasi pendaftaran akan dikirimkan ke detail informasi kontak yang tertera di sini</p>
                                                    <h6 class="mb-1 text-15">Informasi Kontak</h6>
                                                    <p class="mb-4"></p>
                                                    <div class="overflow-x-auto">
                                                        <table class="w-full ltr:text-left rtl:ext-right">
                                                            <tbody>
                                                                <tr>
                                                                    <div class="grid grid-cols-1 gap-5 lg:grid-cols-2 xl:grid-cols-12">
                                                                        <div class="xl:col-span-4">
                                                                            <p class="mb-1 text-15 text-slate-500">Nama Lengkap</p>
                                                                            <p class="mb-1 text-15 text-slate-500">Email</p>
                                                                            <p class="mb-1 text-15 text-slate-500">No. Handphone</p>
                                                                            <p class="mb-1 text-15 text-slate-500">Alamat Lengkap</p>
                                                                            <p class="mb-1 text-15 text-slate-500">Category</p>
                                                                            <p class="mb-1 text-15 text-slate-500">Category Run</p>
                                                                            @if($peserta->package != 'ELyx4')
                                                                            <p class="mb-1 text-15 text-slate-500">Size T-Shirt</p>
                                                                            @endif
                                                                        </div>
                                                                        <div class="xl:col-span-4">
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->full_name}}</p>
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->email}}</p>
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->phone}}</p>
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->alamat}}</p>
                                                                            @if($peserta->category == 1)
                                                                                @php
                                                                                $category = 'UMUM';
                                                                                @endphp
                                                                            @elseif($peserta->category == 2)   
                                                                                @php
                                                                                $category = 'PELAJAR';
                                                                                @endphp
                                                                            @elseif($peserta->category == 3)
                                                                                @php
                                                                                $category = 'BUNDLING';
                                                                                @endphp
                                                                    
                                                                            @elseif($peserta->category == 4)
                                                                                @php
                                                                                $category = 'ELITE';
                                                                                @endphp
                                                                            @elseif($peserta->category == 5)
                                                                                @php
                                                                                $category = 'MASTER';
                                                                                @endphp    
                                                                            @endif  
                                                                            <p class="mb-1 text-15 text-black-500">{{$category}}</p>
                                                                            @if($peserta->lokasi_run == 'AL2')
                                                                                @php
                                                                                $lok_run = 'Non Surabaya';
                                                                                @endphp
                                                                            @elseif($peserta->lokasi_run =='AL')
                                                                                @php  
                                                                                $lok_run = 'Include Surabaya';
                                                                                @endphp
                                                                            @elseif($peserta->lokasi_run =='BW')
                                                                                @php
                                                                                $lok_run ='Banyuwangi';
                                                                                @endphp
                                                                            @elseif($peserta->lokasi_run =='KD')
                                                                                @php
                                                                                $lok_run ='Kediri';
                                                                                @endphp
                                                                            @elseif($peserta->lokasi_run =='MN')
                                                                                @php
                                                                                $lok_run ='Madiun';
                                                                                @endphp
                                                                            @elseif($peserta->lokasi_run =='SB')
                                                                                @php
                                                                                $lok_run ='Surabaya';
                                                                                @endphp
                                                                            @endif                      
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->nama_kat_event}} - {{$lok_run}}</p>
                                                                            @if($peserta->package != 'ELyx4')
                                                                            <p class="mb-1 text-15 text-black-500">{{$peserta->tshirt_size}}</p>
                                                                            @endif
                                                                        </div>
                                                                    </div>
                                                                </tr>
                                                                
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="xl:col-span-6">
                                                    <br class="mb-4">
                                                    <h6 class="mb-4 text-15">Detail Payment</h6>
                                                    <div class="overflow-x-auto">
                                                        <table class="w-full ltr:text-left rtl:ext-right">
                                                            <tbody>
                                                                <tr>
                                                                    <div class="grid grid-cols-1 gap-5 lg:grid-cols-2 xl:grid-cols-12">
                                                                        <div class="xl:col-span-4">
                                                                            <p class="mb-1 text-15 text-slate-500">Registrasi Payment</p>
                                                                       
                                                                        </div>
                                                                        <div class="xl:col-span-4">
                                                                            <p class="mb-1 text-15 text-black-500"><b>Rp. {{number_format($peserta->price)}}</b></p>
                                                            
                                                                        </div>
                                                                    </div>
                                                                </tr>
                                                                
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>

                                             
                                        </div>
                                            <div class="xl:col-span-2 xl:col-start-11">
                                                <div class="ltr:lg:text-left rtl:lg:text-left">
                                                    <a href="#" type="button" id="pay-button" class="text-white btn bg-custom-500 border-custom-500 hover:text-white hover:bg-custom-600 hover:border-custom-600 focus:text-white focus:bg-custom-600 focus:border-custom-600 focus:ring focus:ring-custom-100 active:text-white active:bg-custom-600 active:border-custom-600 active:ring active:ring-custom-100 dark:ring-custom-400/20">
                                                        <span class="align-middle">Bayar</span>
                                                    </a>
                                                </div>
                                            </div>
                                </div>
                            </div>
                        </div>
                       
                        <!--end col-->
                    </div>
                    <!--end grid-->
                </div>
                <!--end tab pane-->
            
             
            </div>
            <!--end tab content-->
        </div>
        <!-- container-fluid -->
    </div>
<!-- End Page-content -->

@section('script')
<script src="https://app.sandbox.midtrans.com/snap/snap.js" data-client-key="{{env('MIDTRANS_CLIENT_KEY')}}"></script>
<script type="text/javascript">
      document.getElementById('pay-button').onclick = function(){
        // SnapToken acquired from previous step
        snap.pay('{{$peserta->snap_token}}', {
          // Optional
        //   checkout-success
          onSuccess: function(result){
           
            window.location.href ='{{URL::to('checkout/success/'.$peserta->order_id)}}';
            // 'registrasiPree/'
        },
          // Optional
          onPending: function(result){
            /* You may add your own js here, this is just example */ document.getElementById('result-json').innerHTML += JSON.stringify(result, null, 2);
            window.location.href ='{{URL::to('/peserta')}}';   
        },
          // Optional
          onError: function(result){
            /* You may add your own js here, this is just example */ document.getElementById('result-json').innerHTML += JSON.stringify(result, null, 2);
          }
        });
      };
</script>
@endsection
@endsection