<style>
.error {
	color: red;
	font-size: .7em;
}

</style>
<!-- Begin Page Content -->
<div class="container-fluid page-custum">
	<!-- Page Heading -->
	<h1 class="h3 mb-4 text-gray-800"><?= $title ?></h1>
	<div class="row">
		<div class="col-6">
			<?= $this->session->flashdata('message') ?>
		</div>
	</div>
	<div class="row">
		<input type="hidden" class="url" value="<?= base_url() ?>">
		<div class="col-12">
			<div class="card p-2">
				<div class="card-body">
					<a href="<?= base_url('assets/fileupload/FormatBiodata.xlsx'); ?>" class="btn btn-success mb-2"><i
							class="fas fa-file-excel"></i> Download Format Biodata</a>
					<button class="btn btn-primary mb-2" data-toggle="modal" data-target="#modalUploadBiodata"><i
							class="fas fa-upload"></i> Upload Data Biodata</button>
					<table class="table table-sm tabel-upload-pendaftaran" id="tabelUploadPendaftaran">
						<thead>
							<tr>
								<th>No</th>
								<th>NISN</th>
								<th>Nama</th>
								<th>Pin</th>
								<th>Action</th>
							</tr>
						</thead>
						<tbody>
							<?php $no = 1;
                            foreach ($pendaftar as $value) : ?>
							<tr>
								<td><?= $no++; ?></td>
								<td><?= $value['nisn'] ?></td>
								<td><?= $value['nama'] ?></td>
								<td> <?php
                                            if ($value['statusDaftar'] == 1) {
                                                echo ""; ?>
									<?php } else {
                                                echo $value['panto'];
                                            } ?>
								</td>
								<td>
									<?php
                                        if ($value['statusDaftar'] == 1) { ?>
									<?php if ($setting['aksesOperator'] == 1) { ?>
									<a href="<?= base_url('Operator/setPendaftaran/') . $value['id']; ?>"
										class="btn btn-sm btn-danger">Daftarkan</button>
										<?php } else { ?>
										<button class="btn btn-sm secondary disabled">Pedaftaran Ditutup</button>
										<?php } ?>
										<?php } else if ($value['statusDaftar'] == 3) {
                                            ?>
										<!-- // block jika sudah terverifikasi -->
										<a href="<?= base_url('Operator/setStatusDaftar/') . $value['id']; ?>"
											class="btn btn-sm btn-success">Cek Pendaftaran</button>
											<?php
                                            } else if ($value['statusDaftar'] == 2) {
                                                ?>
											<a href="<?= base_url('Operator/cetakBuktiDaftar/') . $value['koreg']; ?>"
												target="_blank" class="btn btn-sm btn-primary">cetak Bukti Daftar</a>

											<?php } else {
                                                echo "";
                                            }; ?>


								</td>
							</tr>
							<?php endforeach; ?>
						</tbody>
					</table>
				</div>
			</div>

		</div>
	</div>
	<!-- /.container-fluid -->
	<div class="modal fade" id="modalUploadBiodata" data-backdrop="static" data-keyboard="false" tabindex="-1"
		aria-labelledby="modalUploadBiodataLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title" id="modalUploadBiodataLabel">Form Upload Biodata</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body">

					<form action="<?= base_url('Operator/uploadBiodata') ?>" method="POST"
						enctype="multipart/form-data">
						<div class="custom-file">
							<input type="file" class="custom-file-input" name="biodata" id="customFile">
							<label class="custom-file-label" for="customFile">Cari file Biodata</label>
						</div>


						<button type="submit" name="import" class="btn btn-success mt-4"><i class="fas fa-upload"></i>
							Upload Biodata</button>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
				</div>
				</form>
			</div>
		</div>
	</div>
	<!-- kumpulan modal upload nilai -->
</div>
<!-- End of Main Content -->
<!-- modal view Pendafatar -->
