91 lines
2.9 KiB
PHP
91 lines
2.9 KiB
PHP
<?= $this->extend('layouts/main.php') ?>
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
<main id="main" class="main">
|
|
<div class="pagetitle">
|
|
<h1>Flags List</h1>
|
|
</div>
|
|
|
|
<?php
|
|
if(isset($validation)) {
|
|
?>
|
|
<div class='alert alert-danger alert-dismissible'>
|
|
<?= $validation->listErrors(); ?>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"> <span aria-hidden="true"></span> </button>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<!-- Button trigger modal -->
|
|
<!-- <button type="button" class="btn btn-primary openViewFlagsDef" data-FlagDefID='1' data-bs-toggle="modal" data-bs-target="#exampleModal">
|
|
Launch demo modal
|
|
</button> -->
|
|
|
|
<div class="card" style="height:700px;">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class='card-title d-flex'>
|
|
<h6><b>Berisi Flag dari Tiap Alat/Instrumen</b></h6>
|
|
<a href='<?=base_url();?>flagdef/create/0' class='btn btn-sm btn-info ms-auto'> <i class='bi bi-file-earmark-plus'></i> New Flag</a>
|
|
</div>
|
|
|
|
<table class="table table-sm table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th scope='col'>ID</th> <th scope='col'>Instrumen</th> <th scope='col'>Flag</th> <th scope='col'>Flag Text</th> <th scope="col">Flag Desc.</th> <th scope='col'>Create Date</th><th scope='col'> Action </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($flagdef as $data) { ?>
|
|
<tr>
|
|
<td><?= $data["FlagDefID"] ?></td>
|
|
<td><?= $data["InstrumentID"] ?></td>
|
|
<td><?= $data["Flag"] ?></td>
|
|
<td><?= $data["FlagText"] ?></td>
|
|
<td><?= $data["FlagDesc"] ?></td>
|
|
<td><?= $data["CreateDate"] ?></td>
|
|
<td class=''>
|
|
<button type="button" class="btn btn-sm btn-primary openViewFlagsDef" data-flagdefid='<?= $data["FlagDefID"]; ?>' data-bs-toggle="modal">
|
|
<i class="bi bi-eye"></i>
|
|
</button>
|
|
<a href='<?=base_url();?>flagdef/edit/<?= $data["FlagDefID"] ?>' class='btn btn-sm btn-warning ms-auto'> <i class='bi bi-pencil-square'></i> </a>
|
|
<form action="<?= base_url(); ?>flagdef/delete/<?= $data['FlagDefID'] ?>" method="post" style="display:inline;">
|
|
<button type="submit" class="btn btn-sm btn-danger ms-auto" onclick="return confirm('Are you sure you want to delete this item?');">
|
|
<i class="bi bi-trash"></i>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div id="modal" class="modal" tabindex="-1" role="dialog" >
|
|
<div class="modal-dialog modal-dialog-centered modal-lg">
|
|
<div class="modal-content">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</main>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('script') ?>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('.openViewFlagsDef').on('click',function(){
|
|
const FlagDefID = $(this).data('flagdefid');
|
|
$('.modal-content').load('<?=base_url();?>flagdef/'+FlagDefID, function(){
|
|
$('#modal').modal('show');
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
<?= $this->endSection() ?>
|