<!-- Begin Page Content -->
<div class="container-fluid">
	<?php if (validation_errors()) : ?>
	<div class="alert alert-danger alert-dismissible fade show" role="alert">
		<strong>Warning!! Data gagal disimpan</strong> <?= validation_errors() ?>
		<button type="button" class="close" data-dismiss="alert" aria-label="Close">
			<span aria-hidden="true">&times;</span>
		</button>
	</div>
	<?php endif ?>
	<!-- Page Heading -->
	<h1 class="h3 mb-4 text-gray-800"><?= $title ?></h1>

	<?= $this->session->flashdata('message') ?>
	<button class="btn btn-outline-primary my-3 tombolTambahRangking" data-toggle="modal"
		data-target="#rangkingModal"><i class="fa fa-plus-circle" aria-hidden="true"></i> Tambah Skor Rangking</button>
	<div class="row">
		<div class="col-lg">
			<table class="table table-hover table-responsive-sm tablePeryaratan">
				<thead>
					<tr>
						<th scope="col">#</th>
						<th scope="col">Rangking</th>
						<th scope="col">Skor</th>
						<th scope="col">action</th>
					</tr>
				</thead>
				<tbody>

					<?php $no = 1;
          foreach ($rangking as $rank) : ?>
					<tr>
						<th scope="row"><?= $no++ ?></th>
						<td><?= $rank['rangking']; ?></td>
						<td><?= $rank['skorRanking']; ?></td>
						<td>
							<a href="#" class="badge badge-success tombolEditRangking" data-toggle="modal"
								data-target="#rangkingModal" data-id="<?= $rank['id_rangking'] ?>"><i
									class="fas fa-edit"></i> Edit </a>
							<a href="<?= base_url('ppdb/hapusRangking/') . $rank['id_rangking'] ?>"
								class="badge badge-danger tombolHapusRangking"><i class="fas fa-trash"></i> hapus </a>
						</td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
	</div>


	<!-- Tabel Jenis Afirmasi -->
	<div class="row">
		<div class="col-lg">
		<button class="btn btn-outline-primary my-3 tombolTambahAfirmasi" data-toggle="modal"
		data-target="#afirmasiModal"><i class="fa fa-plus-circle" aria-hidden="true"></i> Tambah Janis Afirmasi</button>
		</div>
	</div>
	<div class="row">
		<div class="col-lg">
			<table class="table table-hover table-responsive-sm TabelAfirmasi">
				<thead>
					<tr>
						<th scope="col">#</th>
						<th scope="col">Jenis Afirmasi</th>
						<th scope="col">action</th>
					</tr>
				</thead>
				<tbody>

					<?php $no = 1;
          foreach ($dataAfirmasiTabel as $afir) : ?>
					<tr>
						<th scope="row"><?= $no++ ?></th>
						<td><?= $afir['nama_jenis_afirmasi']; ?></td>
						<td>
							<a href="#" class="badge badge-success tombolEditAfirmasi" data-toggle="modal"
								data-target="#afirmasiModal" data-id="<?= $afir['id'] ?>"><i
									class="fas fa-edit"></i> Edit </a>
							<a href="<?= base_url('ppdb/hapusAfirmasi/') . $afir['id'] ?>"
								class="badge badge-danger tombolHapusAfirmasi"><i class="fas fa-trash"></i> hapus </a>
						</td>
					</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
	</div>
	<!-- end table informasi -->






</div>
<!-- /.container-fluid -->

</div>
<!-- End of Main Content -->





<!-- Modal tambah data ranking -->
<div class="modal fade" id="rangkingModal" tabindex="-1" role="dialog" aria-labelledby="rangkingModalModelModalLabel"
	aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="exampleModalLabel">Tambah Skor Rangking</h5>
				<input type="hidden" name="url" id="url" value="<?= base_url(); ?>">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<form action="<?= base_url('ppdb/rangking') ?>" method="POST" id="formRangking">
				<input type="hidden" name="idRangking" id="idRangking">
				<div class="modal-body">
					<div class="form-group">
						<input type="text" class="form-control " id="namaRangking" name="namaRangking"
							placeholder="Peringkat Rangking">
					</div>
					<div class="form-group">
						<input type="text" class="form-control skorRangking" name="skorRangking"
							placeholder="Skor Rangking">
					</div>


				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
					<button type="submit" class="btn btn-primary">Tambah Data</button>
				</div>
			</form>
		</div>
	</div>
</div>


<!-- modal tambah data afirmasi -->
<div class="modal fade" id="afirmasiModal" tabindex="-1" role="dialog" aria-labelledby="afirmasiModalModelModalLabel"
	aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="exampleModalLabel">Tambah Data Afirmasi</h5>
				<input type="hidden" name="url" id="url" value="<?= base_url(); ?>">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<form action="<?= base_url('ppdb/afirmasi') ?>" method="POST" id="formTabelAfirmasi">
				<input type="hidden" name="idAfirmasi" class="idAfirmasi" id="idAfirmasi">
				<div class="modal-body">
					<div class="form-group">
						<input type="text" class="form-control namaAfirmasiUntukTable" id="namaAfirmasiUntukTable" name="namaAfirmasi"
							placeholder="Nama Jenis Afirmasi">
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
					<button type="submit" class="btn btn-primary tombol-edit-tambah-afirmasi">Tambah Data</button>
				</div>
			</form>
		</div>
	</div>
</div>
<!-- end tambah modal afirmasi -->
