prework
This commit is contained in:
parent
0ff46cc4c1
commit
c1a4c7bfbe
@ -141,7 +141,7 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/v/bs5/dt-2.3.4/r-3.0.7/datatables.min.js" integrity="sha384-O4V7rOTTcSRflQBTMk8URAYWhGGEMgmmLFrqu3e83FQtze3vmndvrH3GcRdrfXRu" crossorigin="anonymous"></script>
|
<script src="https://cdn.datatables.net/v/bs5/dt-2.3.4/r-3.0.7/datatables.min.js" integrity="sha384-O4V7rOTTcSRflQBTMk8URAYWhGGEMgmmLFrqu3e83FQtze3vmndvrH3GcRdrfXRu" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdn.datatables.net/2.0.8/js/dataTables.bootstrap5.min.js"></script>
|
<script src="https://cdn.datatables.net/2.3.4/js/dataTables.bootstrap5.js"></script>
|
||||||
<script src="https://unpkg.com/mustache@4.2.0/mustache.min.js"></script>
|
<script src="https://unpkg.com/mustache@4.2.0/mustache.min.js"></script>
|
||||||
|
|
||||||
<?= $this->renderSection('script'); ?>
|
<?= $this->renderSection('script'); ?>
|
||||||
|
|||||||
@ -24,6 +24,32 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<form method="GET" action='<?= base_url('/admin') ?>'>
|
||||||
|
<div class="row align-items-center g-3">
|
||||||
|
<div class="col-auto fw-semibold text-muted">
|
||||||
|
Date :
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-auto">
|
||||||
|
<input type="date" class="form-control form-control-sm" name="date1"
|
||||||
|
value="<?php echo $date1; ?>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-auto">-</div>
|
||||||
|
|
||||||
|
<div class="col-auto">
|
||||||
|
<input type="date" class="form-control form-control-sm" name="date2"
|
||||||
|
value="<?php echo $date2; ?>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-auto">
|
||||||
|
<button type="submit" class="btn btn-sm btn-primary">Search</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-auto"> <button type="button" class="btn btn-sm btn-outline-dark" onclick="window.location.href='<?=base_url();?>';"> RESET </button> </div>
|
||||||
|
<div class="col-auto"> <button type="button" class="btn btn-sm btn-dark" data-bs-toggle="offcanvas" data-bs-target="#offcanvasFilter" aria-controls="offcanvasFilter"> Adv.Filter </button> </div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="table table-responsive-scroll">
|
<div class="table table-responsive-scroll">
|
||||||
<table id="datatables" class="table table-sm table-hover table-bordered align-middle table-striped">
|
<table id="datatables" class="table table-sm table-hover table-bordered align-middle table-striped">
|
||||||
@ -163,39 +189,9 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('#datatables').DataTable({
|
$('#datatables').DataTable({
|
||||||
layout: {
|
layout: {
|
||||||
topStart: {
|
topStart: 'info',
|
||||||
div: {
|
topEnd: 'search',
|
||||||
id: 'myCustomDiv',
|
bottomStart: null, bottomEnd: null
|
||||||
className: 'custom-div-style',
|
|
||||||
html: `
|
|
||||||
<form method="GET" action='<?= base_url('/admin') ?>'>
|
|
||||||
<div class="row align-items-center g-3">
|
|
||||||
<div class="col-auto fw-semibold text-muted">
|
|
||||||
Date :
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<input type="date" class="form-control form-control-sm" name="date1"
|
|
||||||
value="<?php echo $date1; ?>" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">-</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<input type="date" class="form-control form-control-sm" name="date2"
|
|
||||||
value="<?php echo $date2; ?>" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<button type="submit" class="btn btn-sm btn-primary">Search</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto"> <button type="button" class="btn btn-sm btn-outline-dark" onclick="window.location.href='<?=base_url();?>';"> RESET </button> </div>
|
|
||||||
<div class="col-auto"> <button type="button" class="btn btn-sm btn-dark" data-bs-toggle="offcanvas" data-bs-target="#offcanvasFilter" aria-controls="offcanvasFilter"> Adv.Filter </button> </div>
|
|
||||||
</div>
|
|
||||||
</form>`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
order: [[0, 'asc'], [3, 'asc']],
|
order: [[0, 'asc'], [3, 'asc']],
|
||||||
paging: false,
|
paging: false,
|
||||||
@ -237,18 +233,20 @@
|
|||||||
modalContent.innerHTML =
|
modalContent.innerHTML =
|
||||||
"<p class='text-center text-muted'>Loading data...</p>";
|
"<p class='text-center text-muted'>Loading data...</p>";
|
||||||
try {
|
try {
|
||||||
// Get API
|
$.getJSON(`<?=base_url();?>api/specimen/${access}`, function(data) {
|
||||||
const res = await fetch(`<?=base_url();?>api/specimen/${access}`);
|
$.get(`<?=base_url('admin/modal_specimen');?>`, function(tpl) {
|
||||||
const data = await res.json();
|
data.samples = data.samples.map(s => ({
|
||||||
$.get(`<?=base_url('admin/modal_specimen');?>`, function(tpl) {
|
...s,
|
||||||
//console.log(tpl);
|
is_coll: s.colstatus == 1,
|
||||||
//console.log(data);
|
is_recv: s.tubestatus == 4
|
||||||
const html = Mustache.render(tpl, data);
|
}));
|
||||||
modalContent.innerHTML=html;
|
console.log(data);
|
||||||
|
const html = Mustache.render(tpl, data);
|
||||||
|
modalContent.innerHTML=html;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
modalContent.innerHTML =
|
modalContent.innerHTML = "<p class='text-danger text-center'>Gagal memuat data.</p>";
|
||||||
"<p class='text-danger text-center'>Gagal memuat data.</p>";
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -41,9 +41,10 @@
|
|||||||
<table class="table fs-6 text-start">
|
<table class="table fs-6 text-start">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class='text-center'>Status</th>
|
|
||||||
<th>Sample Code</th>
|
<th>Sample Code</th>
|
||||||
<th>Sample Name</th>
|
<th>Sample Name</th>
|
||||||
|
<th class='text-center'>Collected</th>
|
||||||
|
<th class='text-center'>Received</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -51,17 +52,24 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#samples}}
|
{{#samples}}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>{{sampcode}}</td>
|
||||||
|
<td>{{name}}</td>
|
||||||
<td class='text-center'>
|
<td class='text-center'>
|
||||||
<input type="checkbox" class="form-check-input"
|
<input type="checkbox" class="form-check-input"
|
||||||
{{#is_checked}}checked{{/is_checked}}
|
{{#is_coll}}checked{{/is_coll}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input"
|
||||||
|
{{#is_recv}}checked{{/is_recv}}
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
<td>{{sampcode}}</td>
|
|
||||||
<td>{{name}}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-success m-0 px-2 py-1" onclick=""><h6 class="p-0 m-0">Coll.</h6></button>
|
<button type="button" class="btn btn-success m-0 px-2 py-1" onclick=""><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
<button type="button" class="btn btn-warning m-0 px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
<button type="button" class="btn btn-warning m-0 px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button type="button" class="btn btn-warning m-0 px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/samples}}
|
{{/samples}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user