<style>
	.textStyle {
		padding: 30px 30px 23px !important;
		border-radius: 10px !important;
		font-size: 2.5rem;
		text-transform: uppercase;
		letter-spacing: 2px;
		color: #000 !important;
		margin: 0;
	}

	.imgDiv {
		height: 115px;
		text-align: center;
		width: 100%;
		overflow: hidden;
		border: 5px solid #EAC301;
		border-radius: 14px;
		margin-bottom: 5px;
	}

	.imgDiv img {
		height: 100%;
		transform: scale(1.8);
		cursor: pointer;
	}


	.frameText {
		padding: 5px 20px;
		border: 2px solid #F3CB00;
		border-radius: 5px;
	}
</style>


<div class="page-header">
	<h3 class="page-title">
		<span class="page-title-icon bg-gradient-primary text-white mr-2">
			<i class="mdi mdi-home"></i>
		</span>
		Activation Process
	</h3>
	<nav aria-label="breadcrumb">
		<ul class="breadcrumb">
			<li class="breadcrumb-item active" aria-current="page">
				<span></span>Steps
				<i class="mdi mdi-alert-circle-outline icon-sm text-primary align-middle"></i>
			</li>
		</ul>
	</nav>
</div>

<div class="row justify-content-center">

	<?php
	if ($methods) {
		foreach ($methods as $key => $method) {
			$bkash = base_url("app-assets/images/bkash/BKash-Logo-English.jpg");
			$rocket = base_url("app-assets/images/bkash/rocket.png");
			$nagad = base_url("app-assets/images/bkash/nagad.svg");
	?>
			<div class="col-lg-4">
				<div class="imgDiv">
					<img data-phone="0<?= $method->mobile ?>" data-id="<?= $method->id ?>" data-typeCode="<?php echo  $method->method_name == 'bKash'
																												? '*247#'
																												: ($method->method_name == 'rocket' ? '*322#' : '*167#')
																											?>" data-isRegistration="0" data-method="<?= $method->method_name ?>" class="textStyle" title="<?= $method->method_name ?>" src="<?= $method->method_name == 'bKash' ? $bkash : ($method->method_name == 'rocket' ? $rocket : $nagad) ?>" alt="">
				</div>
			</div>
	<?php
		}
	}
	?>




	<div class="col-md-12 col-sm-12 text_center align-items-center card m-2 p-2">
		<!--		<img src="-->
		<?//=base_url('app-assets/images/bkash/BKash-Logo-English.jpg')?>
		<!--" width="200px" alt="quick-earn.info bkash">-->
		<!--        <br>-->
		<?php
		if ($methods) {
			$i = 0;
			foreach ($methods as $key => $method) {
				if ($i == 0) {
		?>
					<input type="hidden" value="<?= $method->id ?>" class="join_fee_id">
					<input type="hidden" value="<?= $method->join_fee ?>" class="amount">
		<?php
					break;
				}
			}
		}
		?>

		<h4 class="text-center frameText"> Type <b class="typeCode">*247#</b> </h4>
		<h4 class="text-center frameText"> Our <b class="isRegistration">Training </b>
			Fee : <b class="fee"><?= $join_fee_mobile->join_fee ?> Tk</b>
		</h4>
		<h4 class="text-center frameText"> Please Send us fee in this</h4>
		<h4 class="text-center frameText">
			<b class="method"></b>
			<u> <?= $join_fee_mobile->pay_type ?></u>
			Number : <b class="number">0<?= $join_fee_mobile->mobile ?></b>
		</h4>
		<!--		<small class-"text-center">Mali-Mart এর রেজিস্ট্রেশন এর জন্য নির্ধারিত ফি বিকাশের এজেন্ট(Agent) নাম্বার এর  মাধ্যমের পাঠানোর সময় যদি লিমিট-এক্সিড (Limit Exceed) দেখায় কিংবা কোন কারনে পাঠানো সম্ভব না হয় তবে দয়া করে পার্সোনাল(Personal) বিকাশ নাম্বার থেকে সেন্ড -মানি (Send Money)  অপশন থেকে পুনরায় টাকা পাঠানোর চেস্টা করুন। -->
		<!--ধন্যবাদ</small> -->
	</div>

</div>

<div class="row justify-content-center bg-warning border10 shadow p-3">

	<h4 class="col-12">Activation</h4>

	<div class="form-group col-md-3 col-12">
		<label for="ac_pin">Account Activation Pin
	
		</label>
		<input type="text" class="form-control" id="ac_pin" placeholder="Pin" value="<?php
		foreach($user_pin as $u){
		        echo $u->activation_pin ;
		}
		?>" readonly>

	</div>

	<div class="form-group col-md-3 col-12">
		<label for="inlineFormInputGroup">Sender Number</label>
		<input type="number" class="form-control" id="sndr_num" placeholder="Sender Number">
	</div>

	<div class="form-group col-md-3 col-12">
		<label for="inlineFormInputGroup">TrxID (Transection ID)</label>
		<input type="text" class="form-control" id="tran_id" placeholder="Transection ID">
	</div>

	<div class="form-group col-md-3 col-12">
		<label for="inlineFormInputGroup">Rreferal ID</label>
		<input type="text" class="form-control" id="refer_id" placeholder="Rreferal ID (Optional)">
	</div>

	<div class="form-group col-md-3 col-12 text-center">
		<button onclick="active_req(this)" type="button" class="btn btn-gradient-dark btn-rounded shadow">Send Request <i class="mdi mdi-chevron-right"></i><br><small>(Proceed Time 24hrs)</small><i style="display:none" class="mdi mdi-loading mdi-spin loading"></i></button>
		<div id="activ_rst"></div>
	</div>

</div>

<script>
	$(document).on("click", ".textStyle", function() {
		var phone = $(this).attr("data-phone");
		var typeCode = $(this).attr("data-typeCode");
		var isRegistration = $(this).attr("data-isRegistration");
		var method = $(this).attr("data-method");
		var id = $(this).attr("data-id");

		$(".typeCode").text(typeCode);

		$(".isRegistration").text(isRegistration == 1 ? 'Registration' : 'Training');
		$(".fee").text($(".amount").val() + ' Tk');
		$(".method").text(method);
		$(".join_fee_id").val(id);

		$(".number").text(phone);

	});



	function resend_code() {
		let id = '<?= $this->session->user_id ?>';
		$.ajax({
			type: "post",
			url: "<?= base_url('ActivateCtrl/resend_code') ?>",
			data: {
				id: id
			},
			dataType: "json",
			success: function(response) {
				if (response.success == 1) {
					document.getElementById('resend_c').innerHTML += "<i class='mdi mdi-check'></i>";
					$(".loading").hide();
				}
			}
		});
	}
</script>