<?php
    $_SESSION['pay'] = 'true';
?>
<nav class="navbar fixed-top">
    <div id="specificCard" class="card col-12" style="border-radius: 20px; background: none; border: none; margin-top: 10px;">
        <div class="row">
            <div class="col-6 icon-container">
                <a href="index.php" class="fa fa-arrow-left text-light"></a>
            </div>
            <div class="col-6 text-right">
                <h6 class="text-light mt-2 mb-2">Jual Voucher</h6>
            </div>
        </div>
    </div>
</nav>
<div class="card" style="border-radius: 0px; background: none; border: none; margin-top: 100px;">
	<div class="card-body">
		<?php if($jenisAgen == 'Prabayar') { ?>
		<center>
			<p style="color: #fff;">Saldo Anda</p>
			<h1 style="font-size: 36px; color: #fff;"><small>Rp. </small><b><?php echo number_format($pcmem['saldo']); ?></b></h1>
		</center>
		<?php } else { ?>
		<center>
			<p style="color: #fff;">Jumlah Transaksi</p>
			<h1 style="font-size: 36px; color: #fff;"><small>Rp. </small><b><?php echo substr(number_format($pcmem['saldo']),1); ?></b></h1>
		</center>
		<?php } ?>
	</div>
</div>
<div class="card" id="2" style="border-top-right-radius: 40px; border-top-left-radius: 40px; min-height: 750px; border: none; z-index: 1;">
	<div class="card-body">
		<center>
			<h6><b>Voucher Hotspot</b></h6><br>
		</center>
		<?php
		$sqlPaket = (empty($pcmem['list_paket'])) ? "" : "AND id IN (".$pcmem['list_paket'].")";
		$pageBayar = ($jenisAgen === 'Prabayar') ? "voucher_bayar|" : "voucher_generate|";
		$ambil=$con->query("SELECT * FROM profile_paket WHERE id_data_server = '$pcmem[id_data_server]' AND jenis_profile = 'Hotspot' AND status = '1' $sqlPaket");
		while ($tiap = $ambil->fetch_assoc()) {
		?>
		<div class="card" style="margin-bottom: 10px; border: none; background-color: #e9e9e9e9; border-radius: 0px;">
			<div class="card-body">
				<div class="row">
					<div class="col-7">
						<h6><b><?php echo $tiap["nama"]; ?></b></h6>
						<h5>Harga : Rp. <?php echo number_format($tiap["harga_paket"]); ?></h5>
					</div>
					<div class="col-5">
					<a href="?<?php echo base64_encode($pageBayar.$tiap['id']);?>" class="btn btn-warning btn-block" style="border-radius: 20px;"><b>Jual Voucher</b></a>
					</div>
				</div>
			</div>
		</div>
		<?php } ?>
	</div>
</div>