@php $pageContent = getContent(config('settings')->active_template, 'raffle.content', true); @endphp

@extends($activeTemplate.'layouts.users')

@push('style')
	<link rel="stylesheet" href="{{ asset($activeTemplateTrue.'css/invitation.css') }}{{$catch}}">
	<link rel="stylesheet" href="{{ asset($activeTemplateTrue.'css/withdraw.css') }}{{$catch}}">
@endpush

@section('content')
    <div class="invitation">
        <h1 style="margin-bottom:0.16rem;">{{ @$pageContent->data_values->title }}</h1>
		<div class="wrap">
			<div class="box" style="background-image:url('{{ getImage( 'assets/images/frontend/raffle/' .@$pageContent->data_values->backgroud, '1024x662') }}');background-size: 100% auto;">
				<div style="height:2.56rem"></div>
				<div>
					<p>&nbsp;</p>
					<h3>&nbsp;</h3>
				</div>
			</div>
			<div class="btncopy" style="font-size: .42rem;">{{ @$pageContent->data_values->caption }}</div>
		</div>
		
		<div style="background: #fff; width: 100%; margin-top: 8px; padding-bottom:10px; height: auto; overflow: hidden; position: relative;margin-bottom: 5px;border-radius: 10px;">
			<div style="width:98%;margin:0 auto;" class=" collapse" id="question" >
				<div style=" text-align:justify; font-size:16px;  border-radius: 10px; width: 95%; color:#666; margin: 0 auto; height: auto; overflow: hidden; margin-top: 10px; position: relative;">
				{!! @$pageContent->data_values->details !!}
				</div>
			</div>
		</div>
		
		@if( $invests )
			@if( $raffles )
            <div class="wrap" style="height: auto;margin-bottom:5px @if( $raffles->status == 2 ) border: 2px solid #f00; @endif">
                <div class="box">
                    <img src="/assets/images/network/{{ strtolower($raffles->network) }}.png" alt="" style="border-radius:10px;" />
                    <div>
                        <p>{{ config('settings')->cur_sym}}{{ $raffles->amount }} CARD</p>
                        <h2 style="width:3rem;">{{ $raffles->network }}</h2>
						@if( $raffles->status == 2 )
                        <h3 style="">{{ $raffles->cards }}</h3>
                        <h3 style="margin-top:18px;float:right;padding: 2px 8px;border-radius: 4px;border: 1px solid #F00;cursor: pointer;color: #F00;font-weight: 700;">USED</h3>
						@else
                        <h3 style="">{{ substr($raffles->cards, 0, 6) . str_repeat('▒', 3) .'-'. str_repeat('▒', 3)  . substr($raffles->cards, -5) }}</h3>
                        <h3 onclick="questionBox('ANSWER THE QUESTION','{{ htmlspecialchars($raffles->quiz->question)}}','{{ route('user.raffle.post') }}',{{$raffles->id}})" style="margin-top:18px;float:right;padding: 2px 8px;border-radius: 4px;border: 1px solid #0078e8;cursor: pointer;color: #0078e8;font-weight: 700;">COPY CARD</h3>
						@endif
                    </div>
                </div>
            </div>
			@endif
			
			@foreach( $myown as $draws )
            <div class="wrap" style="height: auto;margin-bottom:5px;border: 2px solid #f00;">
                <div class="box">
                    <img src="/assets/images/network/{{ strtolower($draws->network) }}.png" alt="" style="border-radius:10px;" />
                    <div>
                        <p>{{ config('settings')->cur_sym}}{{ $draws->amount }} CARD</p>
                        <h2 style="width:3rem;">{{ $draws->network }}</h2>
						@if( $raffles->status == 2 )
                        <h3 style="">{{ $draws->cards }} </h3>
                        <h3 style="margin-top:18px;float:right;padding: 2px 8px;border-radius: 4px;border: 1px solid #F00;cursor: pointer;color: #F00;font-weight: 700;">USED</h3>
						@else
                        <h3 style="">{{ substr($draws->cards, 0, 6) . str_repeat('▒', 3) .'-'. str_repeat('▒', 3)  . substr($draws->cards, -5) }}</h3>
                        <h3 onclick="questionBox('ANSWER THE QUESTION','{{$draws->quiz->question}}','{{ route('user.raffle.post') }}',{{$draws->id}});" style="margin-top:18px;float:right;padding: 2px 8px;border-radius: 4px;border: 1px solid #0078e8;cursor: pointer;color: #0078e8;font-weight: 700;">COPY CARD</h3>
						@endif
                    </div>
                </div>
            </div>
			@endforeach
		@else
		<div style="background: #fff; width: 100%; margin: 0 auto; margin-top: 0px;  padding-bottom:10px; height: auto; overflow: hidden; position: relative;margin-bottom: 5px;">
			<div style="padding:25px; color:#000; padding-top:0px; font-size:16px; text-align:justify; " id="kfinfo">
				<p><br></p>
				<p><br></p>
			</div>
		</div>
		@endif
    </div>

@endsection

@section('menu')
	@include($activeTemplate.'layouts.menu',['activeLink'=>'dashboard'])
@endsection

@push('script')
<script>
</script>

@endpush