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

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

@section('content')
	<div class="top" style="background: none;">
		<div data-href="{{ route('user.profile') }}" class="linkBTN" style="float:left; line-height:46px;width:50%; height:46px;cursor:pointer;" id="btnClose">
			<img src="/assets/images/arrow-back-up.png" style="margin-left:12px;width:32px;" />
		</div>
	</div>

    <input type="hidden" id="telegram" value="{{ config('settings')->telegram_number }}">
    <input type="hidden" id="whatsapp" value="{{ config('settings')->whatsapp_number }}">
    <input type="hidden" id="whatgroup" value="{{ config('settings')->whatsapp_url }}">
    <input type="hidden" id="telgroup" value="{{ config('settings')->telegram_url }}">

	<div style="width: 100%; margin: 0 auto; text-align: center;  position: relative; height: auto; overflow: hidden;  ">
		<img src="{{ getImage( 'assets/images/frontend/help/' .@$pageContent->data_values->backgroud, '1024x662') }}" style=" width:100%;">
		<div style="position:absolute; bottom:10px;">
			<div style="padding: 15px; color: #fff; font-size: 20px; padding-bottom: 5px; text-align: center; font-weight: bold; " id="kefutime">{{ @$pageContent->data_values->work_time }}</div>
			<div style="padding: 10px; color: #fff; padding-top: 0px; font-size: 14px; text-align: center; ">
			{{ @$pageContent->data_values->caption }}
			</div>
		</div>
	</div>
	

	@if( config('settings')->whatsapp_number )
	<div style="width: 100%; margin: 0 auto; background: #fff; height: 55px; margin-top: 10px; line-height: 55px; height: auto; overflow: hidden;" id="btn4">
		<div style="float:left;width:25%; text-align:center;">
			<img src="/assets/images/cs_t2.png" style="height:35px;">
		</div>
		<div style="float:left;width:65%;">Customer service</div>
		<div style="float:left;width:10%;">
			<img src="/assets/images/jt.png" style="height:20px;">
		</div>
	</div>
	@endif

	@if( config('settings')->telegram_number )
	<div style="width: 100%; margin: 0 auto; background: #fff; height: 55px; margin-top: 10px; line-height: 55px;  height: auto; overflow: hidden;" id="btn1">
		<div style="float:left;width:25%; text-align:center;">
			<img src="/assets/images/cs_t1.png" style="height:35px;">
		</div>
		<div style="float:left;width:65%;">Customer service</div>
		<div style="float:left;width:10%;">
			<img src="/assets/images/jt.png" style="height:20px;">
		</div>
	</div>
	@endif

	@if( config('settings')->whatsapp_url )
	<div style="width: 100%; margin: 0 auto; background: #fff; height: 55px; margin-top: 10px; line-height: 55px;  height: auto; overflow: hidden;" id="btn2">
		<div style="float:left;width:25%; text-align:center;">
			<img src="/assets/images/cs_t2.png" style="height:35px;">
		</div>
		<div style="float:left;width:65%;">WhatsApp group</div>
		<div style="float:left;width:10%;">
			<img src="/assets/images/jt.png" style="height:20px;">
		</div>
	</div>
	@endif

	@if( config('settings')->telegram_url )
	<div style="width: 100%; margin: 0 auto; background: #fff; height: 55px; margin-top: 10px; line-height: 55px;  height: auto; overflow: hidden;" id="btn3">
		<div style="float:left;width:25%; text-align:center;">
			<img src="/assets/images/cs_t1.png" style="height:35px;">
		</div>
		<div style="float:left;width:65%;">Telegram channel</div>
		<div style="float:left;width:10%;">
			<img src="/assets/images/jt.png" style="height:20px;">
		</div>
	</div>
	@endif

	<div style="width: 100%; margin: 0 auto; background: #fff; height: auto; overflow: hidden; margin-top: 10px; margin-bottom:50px; ">
		<div style="padding:25px; color:#000; padding-top:0px; font-size:12px; text-align:left; " id="kfinfo">
			<p><br></p>
			{!! @$pageContent->data_values->description !!}
			<p><br></p>
		</div>
	</div>
@endsection

@push('script')
<script>
	$().ready(function () {
		$(document).on("click", '#btn1', function () {
			var url = document.getElementById("telegram").value;
			if (window.android) {
				window.android.callAndroid("open," + url);
				return;
			}
			if (window.webkit && window.webkit.messageHandlers) {
				window.webkit.messageHandlers.nativeExt.postMessage({ msg: 'open,' + url });
				return;
			}
			window.open(url, "_blank")
		});

		$(document).on("click", '#btn2', function () {
			var url = document.getElementById("whatgroup").value;
			if (window.android) {
				window.android.callAndroid("open," + url);
				return;
			}
			if (window.webkit && window.webkit.messageHandlers) {
				window.webkit.messageHandlers.nativeExt.postMessage({ msg: 'open,' + url });
				return;
			}
			window.open(url, "_blank")
		});

		$(document).on("click", '#btn3', function () {
			var url = document.getElementById("telgroup").value;
			if (window.android) {
				window.android.callAndroid("open," + url);
				return;
			}
			if (window.webkit && window.webkit.messageHandlers) {
				window.webkit.messageHandlers.nativeExt.postMessage({ msg: 'open,' + url });
				return;
			}
			window.open(url, "_blank")
		});

		$(document).on("click", '#btn4', function () {
			var url = document.getElementById("whatsapp").value;
			if (window.android) {
				window.android.callAndroid("open," + url);
				return;
			}
			if (window.webkit && window.webkit.messageHandlers) {
				window.webkit.messageHandlers.nativeExt.postMessage({ msg: 'open,' + url });
				return;
			}
			window.open(url, "_blank")
		});

	});
</script>
@endpush