<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<button style="display:none;" id="openCryptoPopup"  type="button" data-bs-toggle="modal"  data-bs-target="#cryptoCurrency"></button>
<div class="modal fade cryptoCurrency" id="cryptoCurrency" tabindex="-1" aria-hidden="true">
	<div class="modal-dialog modal-dialog-centered modal-sm">
		<div class="modal-content position-relative">
			<div class="modal-header">
				<h5 class="modal-title fs-5"><?php echo $this->translate("Select Crypto Currency"); ?></h5>
				<a href="javascript:void(0)" type="button" class="modal_close_btn" data-bs-dismiss="modal" aria-label="Close"><i class="fa-regular fa-circle-xmark"></i></a>
			</div>
			<div class="modal-body cryptoCurrency_content">
					<div class="form-elements">
						<p class="_txt pb-0 mb-2">
							<?php echo $this->translate("Please select a crypto currency in which you want to make the payment."); ?> 
						</p>
						<div class="pb-1 gap-2">
							<select name="currency" id="crypto_currency_select" class="w-100" onchange="cryptoPayment();">
								<?php 
								$coins = Engine_Api::_()->coinpayments()->crypto();
								foreach($cryptoConfig['coin'] as $currency){ ?>
									<option value="<?php echo $currency ?>"><?php echo $coins[$currency] ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="wallet_form_payment_inner">
							<div class="form-wrapper d-flex justify-content-center flex-column">
								<button class="btn btn-primary justify-content-center gap-2 mt-2" type="button" name="execute" onclick="cryptoPayment();"><?php echo $this->translate("Continue") ?></button>                  
							</div>
						</div>  
					</div>
					<script type="text/javascript">
						function cryptoPayment(){
							let currency = scriptJquery("#crypto_currency_select").val();
							scriptJquery("#crypto_currency").val(currency);
							scriptJquery('#gatewayButton').trigger('click');
						}
					</script>
			</div>
		</div>
	</div>
</div>