Update Tamplian, User, FO, Admin, Sampling
This commit is contained in:
parent
55762ca7fb
commit
0a687cf760
@ -79,6 +79,12 @@ $routes->group('user', ['filter' => 'role:user'], static function ($routes) {
|
||||
$routes->get('dashboard/viewAccess/(:any)', 'UserController::viewAccess/$1');
|
||||
});
|
||||
|
||||
// sampling
|
||||
$routes->group('sampling', ['filter' => 'role:sampling'], static function ($routes) {
|
||||
$routes->get('', 'samplingController::index');
|
||||
$routes->get('dashboard/viewAccess/(:any)', 'SamplingController::viewAccess/$1');
|
||||
});
|
||||
|
||||
// fo
|
||||
$routes->group('fo', ['filter' => 'role:fo'], static function ($routes) {
|
||||
$routes->get('', 'FoController::index');
|
||||
|
||||
44
app/Controllers/SamplingController.php
Normal file
44
app/Controllers/SamplingController.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
class SamplingController extends BaseController {
|
||||
|
||||
public function index() {
|
||||
return view('sampling/dashboard');
|
||||
}
|
||||
|
||||
public function viewAccess($accessnumber): string {
|
||||
$db = \Config\Database::connect();
|
||||
$sql = "select p.PATNUMBER, p.NAME, sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu
|
||||
left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
|
||||
left join PATIENTS p on p.PATID=sr.PATID
|
||||
left join DICT_SAMPLES_TYPES ds on ds.SAMPCODE= tu.SAMPLETYPE
|
||||
left join cmod.dbo.CM_TUBES ct on ct.SAMPLETYPE=tu.SAMPLETYPE and ct.ACCESSNUMBER=tu.SP_ACCESSNUMBER
|
||||
where tu.SP_ACCESSNUMBER='$accessnumber'";
|
||||
$query = $db->query($sql);
|
||||
$results = $query->getResultArray();
|
||||
$data['data'] = $results;
|
||||
$data['accessnumber'] = $accessnumber;
|
||||
return view('sampling/dashboard_viewAccess', $data);
|
||||
}
|
||||
|
||||
public function changePass() {
|
||||
if ($this->request->getMethod() === 'POST') {
|
||||
$password1 = $this->request->getVar('password1');
|
||||
$password2 = $this->request->getVar('password2');
|
||||
$data['password1'] = $password1;
|
||||
$data['password2'] = $password2;
|
||||
if($password1 == $password2) {
|
||||
$password = password_hash($password1,PASSWORD_DEFAULT);
|
||||
$db = \Config\Database::connect();
|
||||
$sql = "update cmod.dbo.CM_USERS set PASSWORD='$password' where USERID='$userid'";
|
||||
$db->query($sql);
|
||||
return redirect()->to("/");
|
||||
} else {
|
||||
return redirect()->to("/auth/setpass/$userid")->with('flash_error', 'password is not the same.');
|
||||
}
|
||||
}
|
||||
return view('changePass');
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="card border-0 m-1">
|
||||
<div class="card-header bg-success text-white">
|
||||
<div class='card-title m-0'><b>Dictionary Chapter</b></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class='card-title'>Dictionary Chapters</div>
|
||||
<div class="table-responsive">
|
||||
<table id="myTable" class="table">
|
||||
<thead>
|
||||
|
||||
@ -11,11 +11,15 @@ foreach($tests as $data) {
|
||||
?>
|
||||
</datalist>
|
||||
<div class="card border-0 m-1">
|
||||
<div class="card-header bg-success text-white">
|
||||
<div class='card-title m-0'><b>Dictionary Mapping Order</b></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class='card-title'>Dictionary Mapping Order</div>
|
||||
<button class='btn btn-sm btn-primary' onclick="createSingle()"><i class="bi bi-plus-circle"></i> Create Single</button>
|
||||
<button class='btn btn-sm btn-primary' onclick="createProfile()"><i class="bi bi-plus-circle"></i> Create Profile</button>
|
||||
<div class="table-responsive">
|
||||
<!-- <div class='card-title'>Dictionary Mapping Order</div> -->
|
||||
<button class='btn btn-sm btn-success-2' onclick="createSingle()"><i class="bi bi-plus-circle"></i> Create Single</button>
|
||||
<button class='btn btn-sm btn-success-2' onclick="createProfile()"><i class="bi bi-journal-plus"></i> Create Profile</button>
|
||||
|
||||
<div class="table-responsive mt-3">
|
||||
<table id="myTable" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -116,9 +120,9 @@ function index() {
|
||||
editBtn = '';
|
||||
if(data[i].LISCODE == null) { liscode = '-'; }
|
||||
if(maptype == 'S') {
|
||||
editBtn = '<button class="btn btn-sm btn-success" ' + ' onclick="editSingle(' + mapid+ ')">Edit' + '</button> ';
|
||||
editBtn = '<button class="btn btn-sm btn-success-2" ' + ' onclick="editSingle(' + mapid+ ')">Edit' + '</button> ';
|
||||
} else {
|
||||
editBtn = '<button class="btn btn-sm btn-success" ' + ' onclick="editProfile(' + mapid+ ')">Edit' + '</button> ';
|
||||
editBtn = '<button class="btn btn-sm btn-success-2" ' + ' onclick="editProfile(' + mapid+ ')">Edit' + '</button> ';
|
||||
}
|
||||
let datarow = '<tr class="align-middle">' +
|
||||
'<td>' + maptype + '</td>' + '<td>' + hiscode+ '</td> <td>' + liscode + '</td>' + '<td>' + descs + '</td>' + '<td>' + editBtn + '</td>' +
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="card border-0 m-1">
|
||||
<div class="card-body">
|
||||
<div class='card-title'>Dictionary Test</div>
|
||||
<div class="card-header bg-success text-white">
|
||||
<div class='card-title m-0'><b>Dictionary Test</b></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class='row mb-2'>
|
||||
<div class='col-2'>Testcode</div>
|
||||
<div class='col-2'><input type='text' class='form-control form-control-sm' id='search_testcode' oninput='this.value = this.value.toUpperCase();' /></div>
|
||||
@ -12,7 +14,7 @@
|
||||
<div class='col-2'>Shorttext</div>
|
||||
<div class='col-3'><input type='text' class='form-control form-control-sm' id='search_shorttext' oninput='this.value = this.value.toLowerCase();' /></div>
|
||||
</div>
|
||||
<button class='btn btn-sm btn-primary' onclick='search()'>Search</button>
|
||||
<button class='btn btn-sm btn-success-2' onclick='search()'>Search</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Logged in as:</div>
|
||||
<div class="small">Logged in as: <b>Administrator</b></div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@ -2,9 +2,12 @@
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-success text-white">
|
||||
<div class='card-title m-0'><b>Users Role Manager</b></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<button class='btn btn-sm btn-success mx-3 my-2' onclick='create()'><i class='bi bi-plus-circle'></i> Create</button>
|
||||
<div class="table-responsive">
|
||||
<button class='btn btn-sm btn-success-2 mx-3 my-2' onclick='create()'><i class='bi bi-plus-circle'></i> Create</button>
|
||||
<div class="mt-2 table-responsive">
|
||||
<table id="table_dashboard" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -56,7 +59,7 @@ function index() {
|
||||
$("#table-body").html("");
|
||||
var data = response['userroles'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let editBtn = '<button class="btn btn-sm btn-success" ' + ' onclick="edit(' + data[i].USERROLEID + ')">Edit' + '</button> ';
|
||||
let editBtn = '<button class="btn btn-sm btn-success-2" ' + ' onclick="edit(' + data[i].USERROLEID + ')">Edit' + '</button> ';
|
||||
//let deleteBtn = '<button class="btn btn-sm btn-danger" ' + ' onclick="delete(' + data[i].USERROLEID + ')">Delete' + '</button>';
|
||||
let datarow = '<tr class="align-middle">' +
|
||||
'<td>' + data[i].USERROLEID + '</td>' + '<td>' + data[i].USERROLENAME+ '</td>' + '<td>' + editBtn + '</td>' +
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-success text-white">
|
||||
<div class='card-title m-0'><b>Users Manager</b></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="myTable" class="table">
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?= $this->extend('admin/layout/main.php') ?>
|
||||
<?= $this->extend('fo/layout/main.php') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
@ -193,7 +193,7 @@ function index() {
|
||||
}
|
||||
|
||||
function viewAccess(access) {
|
||||
let url = '<?=base_url();?>admin/dashboard/viewAccess/'+access;
|
||||
let url = '<?=base_url();?>fo/dashboard/viewAccess/'+access;
|
||||
$('.modal-content').load(url, function(){
|
||||
$('#modal').modal('show');
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Logged in as: User</div>
|
||||
<div class="small">Logged in as: <b>Front CS</b></div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
206
app/Views/sampling/dashboard.php
Normal file
206
app/Views/sampling/dashboard.php
Normal file
@ -0,0 +1,206 @@
|
||||
<?= $this->extend('sampling/layout/main.php') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<style>
|
||||
#myTable {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id='stats' class="d-flex justify-content-between p-0">
|
||||
</div>
|
||||
|
||||
<div class="card border-0">
|
||||
|
||||
<!-- div.card-head -->
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col col-auto">
|
||||
<b>Date</b> : <input class='date1' type='date' value=''> - <input class='date2' type='date'>
|
||||
</div>
|
||||
<div class="col col-auto">
|
||||
<button class='btn btn-sm btn-primary py-1 px-2 d-flex align-items-center' onclick='index()'><i class="bi bi-calendar2-event"></i> Search</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive mt-3">
|
||||
<table id="myTable" class="table table-hover">
|
||||
<thead>
|
||||
<th>Order</th>
|
||||
<th>MR</th>
|
||||
<th>Patient</th>
|
||||
<th>Request</th>
|
||||
<th>Hosp</th>
|
||||
<th>Test</th>
|
||||
<th>Status</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody id="table-body">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('script') ?>
|
||||
<script>
|
||||
let curDate = new Date().toJSON().slice(0, 10);
|
||||
$('.date1').val(curDate);
|
||||
$('.date2').val(curDate);
|
||||
|
||||
index();
|
||||
function index() {
|
||||
let url = '<?=base_url('');?>api/dashboard/index';
|
||||
date1 = $('.date1').val();
|
||||
date2 = $('.date2').val();
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
data : {date1:date1, date2:date2},
|
||||
success: function(response) {
|
||||
/*
|
||||
// counter
|
||||
*/
|
||||
$("#stats").html("");
|
||||
var stats = ['Pend', 'PartColl', 'Coll', 'PartRecv', 'Recv', 'Inc', 'PartVal', 'Comp'];
|
||||
var statcolor = ['text-orange', 'text-peach', 'text-pink', 'text-soft-blue', 'text-blue', 'text-grey', 'text-soft-green', 'text-green'];
|
||||
var staticon = ['bi-clock-history','bi-tv', 'bi-collection', 'bi-file-medical', 'bi-journal-medical', 'bi-calendar3-week', 'bi-check2', 'bi-clipboard-check'];
|
||||
var stattext = ['Pending', 'Part Collected', 'Collected', 'Part Received', 'Received', 'Incomplete', 'Part Validated', 'Validated'];
|
||||
var count = response['count'];
|
||||
var statcontent = '';
|
||||
stats.forEach ( (item, index) => {
|
||||
//console.log(item + ' ' + index);
|
||||
if(!count[item]) { count[item] = 0; }
|
||||
statcontent += '<div class="custom-card" data-filtertype="'+index+'">' +
|
||||
'<div class="custom-card-content">' +
|
||||
'<div class="row p-0 d-flex justify-content-between">' +
|
||||
'<div class="col-3 text-start '+statcolor[index]+'"> <h5 class="m-0"><i class="bi '+staticon[index]+'"></i></h5> </div>' +
|
||||
'<div class="col-9 text-end pe-3"> <h2 class="m-0 custom-card-title">'+count[item]+'</h2> </div>' +
|
||||
'</div>' +
|
||||
"<hr class='"+statcolor[index]+"'>" +
|
||||
'<h3 class="custom-card-text m-0 p-0 '+statcolor[index]+'">'+ stattext[index] +'</h3>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
});
|
||||
$("#stats").html(statcontent);
|
||||
|
||||
/*
|
||||
// table
|
||||
*/
|
||||
$("#myTable").DataTable().destroy();
|
||||
$("#table-body").html("");
|
||||
var data = response['data'];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
colldate = data[i].COLLECTIONDATE.substr(0,10);
|
||||
patnumber = data[i].PATNUMBER.substr(-16,16);
|
||||
accessnumber = data[i].SP_ACCESSNUMBER;
|
||||
patname = data[i].NAME;
|
||||
hon = data[i].HOSTORDERNUMBER;
|
||||
tests = data[i].TESTS;
|
||||
stat = data[i].STATS;
|
||||
if(stat == 'Pend') {
|
||||
bgcolor = 'bg-orange';
|
||||
datafilter = "data-filterrow='0'";
|
||||
stattext = 'Pending';
|
||||
} else if(stat == 'PartColl') {
|
||||
bgcolor = 'bg-peach';
|
||||
datafilter = "data-filterrow='1'";
|
||||
stattext = 'Part Collected';
|
||||
} else if(stat == 'Coll') {
|
||||
bgcolor = 'bg-pink';
|
||||
datafilter = "data-filterrow='2'";
|
||||
stattext = 'Collected';
|
||||
} else if(stat == 'PartRecv') {
|
||||
bgcolor = 'bg-soft-blue';
|
||||
datafilter = "data-filterrow='2'";
|
||||
stattext = 'Part Received';
|
||||
} else if(stat == 'Recv') {
|
||||
bgcolor = 'bg-blue';
|
||||
datafilter = "data-filterrow='4'";
|
||||
stattext = 'Received';
|
||||
} else if(stat == 'Inc') {
|
||||
bgcolor = 'bg-grey';
|
||||
datafilter = "data-filterrow='5'";
|
||||
stattext = 'Incomplete';
|
||||
} else if(stat == 'PartVal') {
|
||||
bgcolor = 'bg-soft-green';
|
||||
datafilter = "data-filterrow='6'";
|
||||
stattext = 'Part Validated';
|
||||
} else if(stat == 'Comp') {
|
||||
bgcolor = 'bg-green';
|
||||
datafilter = "data-filterrow='7'";
|
||||
stattext = 'Validated';
|
||||
}
|
||||
let datarow = "<tr onclick='viewAccess("+accessnumber+")' class='align-middle main_table" + datafilter +" ' >" +
|
||||
'<td>' + colldate + '</td> <td>' + patnumber + '</td> <td>' + accessnumber + '</td> <td>' + patname + '</td> <td>' + hon + '</td> <td>' + tests + '</td>' +
|
||||
"<td role='button' class='"+bgcolor+" text-center align-middle'>"+stattext+"</td>" +
|
||||
"<td role='button' class='text-center align-middle' onclick='resultPdfAccess("+accessnumber+")'> <h4 class='p-0 m-0'><i class='bi bi-filetype-pdf'></i></h4> </td>" +'</tr>';
|
||||
$("#table-body").append(datarow);
|
||||
}
|
||||
$('#myTable').DataTable();
|
||||
|
||||
// datatable filter
|
||||
const filterButton = document.querySelectorAll("[data-filtertype]");
|
||||
const table = document.querySelector("#myTable");
|
||||
const tr = table.getElementsByTagName("tr");
|
||||
|
||||
let activeButton = null;
|
||||
|
||||
filterButton.forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const selectedButton = button.getAttribute("data-filtertype");
|
||||
console.log(selectedButton);
|
||||
|
||||
if (activeButton === button) {
|
||||
button.classList.remove("active", "border", "border-primary", "border-5");
|
||||
activeButton = null;
|
||||
for (let i = 1; i < tr.length; i++) {
|
||||
tr[i].style.display = "";
|
||||
}
|
||||
} else {
|
||||
filterButton.forEach((btn) => btn.classList.remove("active", "border", "border-info", "border-3"));
|
||||
button.classList.add("active", "border", "border-info", "border-3");
|
||||
activeButton = button;
|
||||
|
||||
for (let i = 1; i < tr.length; i++) {
|
||||
const filterValue = tr[i].getAttribute("data-filterrow");
|
||||
|
||||
if (filterValue === selectedButton) {
|
||||
tr[i].style.display = "";
|
||||
} else {
|
||||
tr[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function(response) { console.log(response.responseJSON); }
|
||||
});
|
||||
}
|
||||
|
||||
function viewAccess(access) {
|
||||
let url = '<?=base_url();?>sampling/dashboard/viewAccess/'+access;
|
||||
$('.modal-content').load(url, function(){
|
||||
$('#modal').modal('show');
|
||||
});
|
||||
}
|
||||
function resultPdfAccess(access) {
|
||||
let url = '<?=base_url();?>prints/result_test/'+access;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
226
app/Views/sampling/dashboard_viewAccess.php
Normal file
226
app/Views/sampling/dashboard_viewAccess.php
Normal file
@ -0,0 +1,226 @@
|
||||
<?php
|
||||
if(isset($data[0])) {
|
||||
$row = $data[0];
|
||||
$patnumber = $row['PATNUMBER'];
|
||||
$host = $row['HOSTORDERNUMBER'];
|
||||
$name = $row['NAME'];
|
||||
?>
|
||||
<div class="modal-header bg-soft-green text-white">
|
||||
<h1 class="modal-title fs-5" id="exampleModalToggleLabel">Detail Request </h1>
|
||||
<button type="button" class="btn-close text-white" data-bs-dismiss="modal" ></button>
|
||||
</div>
|
||||
<div class="modal-body" style='background-color:#F4F6FF'>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table class="table table-sm table-borderless">
|
||||
<tr> <th>Access#</th> <th>:</th> <td><?=$accessnumber;?></td> </tr>
|
||||
<tr> <th>Patient</th> <th>:</th> <td><?=$patnumber;?> - <?=$name;?></td> </tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="col-12">
|
||||
<div class="card bg-white">
|
||||
<div class="card-body">
|
||||
<div class="card-title"><h3>Sample List</h3></div>
|
||||
<table class='table'>
|
||||
<tr> <th class='text-center'>Coll.</th> <th class='text-center'>Recv.</th> <th>Sample Name</th> <th>Action</th> <th>Comment</th> </tr>
|
||||
<tr>
|
||||
<td></td> <td></td> <td>All</td>
|
||||
<td>
|
||||
<button type='button' class='btn btn-dark m-0 px-2 py-1' onclick='printAllLabel()'> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button>
|
||||
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button>
|
||||
<!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> -->
|
||||
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td> <td></td> <td>Collection</td>
|
||||
<td><button type='button' class='btn btn-dark m-0 px-2 py-1'><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($data as $row) {
|
||||
$sampletype = $row['SAMPLETYPE'];
|
||||
$sampletext = $row['SHORTTEXT'];
|
||||
$tubestatus = $row['TUBESTATUS'];
|
||||
$collstatus = $row['COLLSTATUS'];
|
||||
$comment = $row['TUBECOMMENT'];
|
||||
echo "\r\n <tr>";
|
||||
if($collstatus==1) {
|
||||
echo " <td class='text-center'><input type='checkbox' class='form-check-input' id='coll$sampletype' checked disabled></td>";
|
||||
} else {
|
||||
echo " <td class='text-center'><input type='checkbox' class='form-check-input' id='coll$sampletype' disabled></td>";
|
||||
}
|
||||
if($tubestatus==4) {
|
||||
echo "<td class='text-center'><input type='checkbox' class='form-check-input' id='recv$sampletype' checked disabled></td>";
|
||||
} else {
|
||||
echo "<td class='text-center'><input type='checkbox' class='form-check-input' id='recv$sampletype' disabled></td>";
|
||||
}
|
||||
echo "<td>$sampletext</td>";
|
||||
echo "<td>
|
||||
<button type='button' class='btn btn-dark m-0 px-2 py-1' onclick='printSingleLabel($sampletype, $accessnumber)'><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button>
|
||||
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button>
|
||||
<button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button>
|
||||
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
|
||||
</td> ";
|
||||
echo "<td id='comment$sampletype'>$comment <h6 class='p-0 m-0'><i class='bi bi-pencil-square' role='button' onclick='comment($sampletype, $accessnumber, \"$sampletext\", \"$comment\")'></i></h6></td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function printSingleLabel(sample, access) {
|
||||
|
||||
const url = '<?=base_url();?>prints/single_sample/'+access.toString()+'/'+sample.toString();
|
||||
|
||||
fetch(url)
|
||||
.then(response => response.json()) // Mengonversi response menjadi JSON (atau gunakan .text() jika formatnya teks)
|
||||
.then(data => {
|
||||
|
||||
if (data['status']) {
|
||||
console.log(data['message']);
|
||||
} else {
|
||||
console.log(data['message']+"\n"+data['error']);
|
||||
message = data['message']+"\n"+data['error'];
|
||||
alert(message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
function printAllLabel() {
|
||||
|
||||
const url = '<?=base_url();?>prints/all_sample';
|
||||
|
||||
fetch(url)
|
||||
.then(response => response.json()) // Mengonversi response menjadi JSON (atau gunakan .text() jika formatnya teks)
|
||||
.then(data => {
|
||||
|
||||
if (data['status']) {
|
||||
console.log(data['message']);
|
||||
} else {
|
||||
console.log(data['message']+"\n"+data['error']);
|
||||
message = data['message']+"\n"+data['error'];
|
||||
alert(message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function collect(sample, access) {
|
||||
sample = sample.toString().padStart(3,'0');
|
||||
const url = '<?=base_url();?>tubes/collect/'+access+'/'+sample;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$("#coll"+sample).prop("checked", true);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
}
|
||||
|
||||
function collectAll(access) {
|
||||
const url = '<?=base_url();?>tubes/collectAll/'+access;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$('input[id^="coll"]').prop('checked', true);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
|
||||
}
|
||||
|
||||
function uncollect(sample, access) {
|
||||
sample = sample.toString().padStart(3,'0');
|
||||
const url = '<?=base_url();?>tubes/uncollect/'+access+'/'+sample;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$("#coll"+sample).prop("checked", false);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
|
||||
}
|
||||
|
||||
function uncollectAll(access) {
|
||||
const url = '<?=base_url();?>tubes/uncollectAll/'+access;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$('input[id^="coll"]').prop('checked', false);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
}
|
||||
|
||||
function unreceive(sample, access) {
|
||||
sample = sample.toString().padStart(3,'0');
|
||||
const url = '<?=base_url();?>tubes/unreceive/'+access+'/'+sample;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$("#recv"+sample).prop("checked", false);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
|
||||
}
|
||||
|
||||
function unreceiveAll(access) {
|
||||
const url = '<?=base_url();?>tubes/unreceiveAll/'+access;
|
||||
fetch(url)
|
||||
.then(data => {
|
||||
//console.log(data);
|
||||
//$('input[id^="recv"]').prop('checked', false);
|
||||
viewAccess(access);
|
||||
index();
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
}
|
||||
|
||||
function comment(sample, access, sampletext, comments) {
|
||||
const url = '<?=base_url();?>tubes/comment/'+access+'/'+sample;
|
||||
let comment = prompt('Comment for sample '+sampletext, comments);
|
||||
//$('#comment'+sample).html(comment +"<i class='bi bi-pencil-square' onclick='comment("+ sample +", "+ access +', "'+sampletext+'", "'+comment+'")\'></i>');
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ comment : comment }),
|
||||
headers: { "Content-type": "application/json; charset=UTF-8" }
|
||||
}).then(data => {
|
||||
//console.log(data);
|
||||
viewAccess(access);
|
||||
})
|
||||
.catch(error => { console.error('Error:',error); });
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="modal-header bg-black text-white">
|
||||
<h1 class="modal-title fs-5" id="exampleModalToggleLabel">Detail Request </h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" ></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h3>Data not found</h3>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
56
app/Views/sampling/layout/form.php
Normal file
56
app/Views/sampling/layout/form.php
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<?=base_url();?>/assets/favicon.png">
|
||||
<title>Summit CRM</title>
|
||||
<link href="<?=base_url();?>/assets/style.css" rel="stylesheet">
|
||||
<link href="<?=base_url();?>/assets/select2/select2.min.css" rel="stylesheet">
|
||||
<link href="<?=base_url();?>/assets/select2/select2-bootstrap-5-theme.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.select2-results__option { font-size: 0.75rem !important; margin: 5px !important; padding: 5px !important; }
|
||||
li.select2-selection__choice { background-color : #000 !important; padding:5px !improtant; }
|
||||
.select2 {width:100%!important;}
|
||||
</style>
|
||||
<script src="<?=base_url();?>/assets/jquery/jquery.min.js"></script>
|
||||
<script src="<?=base_url();?>/assets/select2/select2.min.js"></script>
|
||||
<?= $this->renderSection('head'); ?>
|
||||
</head>
|
||||
|
||||
<body class="skin-megna-dark fixed-layout">
|
||||
<div class="preloader">
|
||||
<div class="loader">
|
||||
<div class="loader__figure"></div>
|
||||
<p class="loader__label">Summit-CRM</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-body">
|
||||
<?= $this->renderSection('content'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="<?=base_url();?>/assets/bootstrap.bundle.min.js"></script>
|
||||
<script src="<?=base_url();?>/assets/perfect-scrollbar.jquery.min.js"></script>
|
||||
<script src="<?=base_url();?>/assets/app.js"></script>
|
||||
<?= $this->renderSection('script'); ?>
|
||||
<script>
|
||||
$('.select2').select2();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
58
app/Views/sampling/layout/main.php
Normal file
58
app/Views/sampling/layout/main.php
Normal file
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<title>Analis Dashboard</title>
|
||||
<link rel="stylesheet" href="<?=base_url();?>assets/css/icons/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="<?=base_url();?>assets/datatables/datatables.min.css">
|
||||
<link href="<?=base_url();?>assets/css/styles.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<!-- <body class="sb-nav-fixed sb-sidenav-toggled"> -->
|
||||
<body class="sb-nav-fixed">
|
||||
<?= $this->include('sampling/layout/topbar'); ?>
|
||||
|
||||
<div id="layoutSidenav">
|
||||
|
||||
<?= $this->include('sampling/layout/sidebar'); ?>
|
||||
|
||||
<div id="layoutSidenav_content">
|
||||
<main>
|
||||
<div class="container-fluid px-2 py-2">
|
||||
|
||||
<?php
|
||||
if(isset($_SESSION['alertmsg'])) {
|
||||
?>
|
||||
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||
<?=$_SESSION['alertmsg'];?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?= $this->renderSection('content'); ?>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="py-3 bg-light mt-auto">
|
||||
<div class="container-fluid px-4">
|
||||
<div class="d-flex align-items-center justify-content-between small">
|
||||
<div class="text-muted ms-auto ">Copyright © 4SKAI 2024</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<?=base_url();?>assets/jquery-3.6.0.min.js"></script>
|
||||
<script src="<?=base_url();?>assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="<?=base_url();?>assets/datatables/datatables.min.js"></script>
|
||||
<script src="<?=base_url();?>assets/js/scripts.js"></script>
|
||||
<?= $this->renderSection('script'); ?>
|
||||
</body>
|
||||
</html>
|
||||
14
app/Views/sampling/layout/sidebar.php
Normal file
14
app/Views/sampling/layout/sidebar.php
Normal file
@ -0,0 +1,14 @@
|
||||
<div id="layoutSidenav_nav">
|
||||
<nav class="sb-sidenav accordion sb-sidenav-light" id="sidenavAccordion">
|
||||
<div class="sb-sidenav-menu">
|
||||
<div class="nav">
|
||||
<div class="sb-sidenav-menu-heading">Main</div>
|
||||
<a class="nav-link" href="<?=base_url();?>user/"><div class="sb-nav-link-icon"><i class="bi bi-speedometer"></i></div>Dashboard</a>
|
||||
<a class="nav-link" href="<?=base_url();?>changePass/"><div class="sb-nav-link-icon"><i class="bi bi-key"></i></div>Change Password</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Logged in as: <b>Sampling User</b></div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
23
app/Views/sampling/layout/topbar.php
Normal file
23
app/Views/sampling/layout/topbar.php
Normal file
@ -0,0 +1,23 @@
|
||||
<nav class="sb-topnav navbar navbar-expand navbar-light bg-light shadow-sm text-luxury">
|
||||
|
||||
<a class="navbar-brand ps-3 d-none d-md-block" href="#"><img src='<?=base_url();?>assets/img/logo.png' width='30' /> CMOD</a>
|
||||
|
||||
<button class="btn btn-link me-2" id="sidebarToggle"><i class="bi bi-list "></i></button>
|
||||
|
||||
<div class="ms-auto">
|
||||
<ul class="navbar-nav ms-md-0 me-3 me-lg-4">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-person-circle"></i>
|
||||
<?=$_SESSION['username'];?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="#!">Profile</a></li>
|
||||
<li><a class="dropdown-item" href="#!">Change Password</a></li>
|
||||
<li><hr class="dropdown-divider" /></li>
|
||||
<li><a class="dropdown-item" href="<?=base_url();?>auth/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
40
app/Views/sampling/layout/window.php
Normal file
40
app/Views/sampling/layout/window.php
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<?=base_url();?>/assets/favicon.png">
|
||||
<title>Summit CRM</title>
|
||||
|
||||
<link href="<?=base_url();?>/assets/style.css" rel="stylesheet">
|
||||
<link href="<?=base_url();?>/assets/font-awesome-640/css/all.min.css" rel="stylesheet">
|
||||
<?= $this->renderSection('head'); ?>
|
||||
</head>
|
||||
|
||||
<body class="skin-megna-dark fixed-layout">
|
||||
<div class="preloader">
|
||||
<div class="loader">
|
||||
<div class="loader__figure"></div>
|
||||
<p class="loader__label">Summit-CRM</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->renderSection('content'); ?>
|
||||
</div>
|
||||
<script src="<?=base_url();?>/assets/jquery/jquery.min.js"></script>
|
||||
<script src="<?=base_url();?>/assets/bootstrap.bundle.min.js"></script>
|
||||
<script src="<?=base_url();?>/assets/app.js"></script>
|
||||
<?= $this->renderSection('script'); ?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({
|
||||
dropdownAutoWidth : true,
|
||||
width: '100%',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,4 +1,4 @@
|
||||
<?= $this->extend('admin/layout/main.php') ?>
|
||||
<?= $this->extend('user/layout/main.php') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
@ -193,7 +193,7 @@ function index() {
|
||||
}
|
||||
|
||||
function viewAccess(access) {
|
||||
let url = '<?=base_url();?>admin/dashboard/viewAccess/'+access;
|
||||
let url = '<?=base_url();?>user/dashboard/viewAccess/'+access;
|
||||
$('.modal-content').load(url, function(){
|
||||
$('#modal').modal('show');
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Logged in as: User</div>
|
||||
<div class="small">Logged in as: <b>Analyst User</b></div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
@ -8345,6 +8345,32 @@ textarea.form-control-lg {
|
||||
background-color: rgba(127, 181, 110, var(--bs-bg-opacity)) !important;
|
||||
color: white;
|
||||
}
|
||||
.bg-custom-green {
|
||||
--bs-bg-opacity: 1;
|
||||
background-color: rgba(76, 178, 105, var(--bs-bg-opacity)) !important;
|
||||
color: white;
|
||||
}
|
||||
.bg-custom-2-green {
|
||||
--bs-bg-opacity: 1;
|
||||
background-color: rgba(39, 92, 54, var(--bs-bg-opacity)) !important;
|
||||
color: white;
|
||||
}
|
||||
.btn-success-2 {
|
||||
--bs-btn-color: #fff;
|
||||
--bs-btn-bg: #4cb269;
|
||||
--bs-btn-border-color: #4cb269;
|
||||
--bs-btn-hover-color: #fff;
|
||||
--bs-btn-hover-bg: #157347;
|
||||
--bs-btn-hover-border-color: #146c43;
|
||||
--bs-btn-focus-shadow-rgb: 60, 153, 110;
|
||||
--bs-btn-active-color: #fff;
|
||||
--bs-btn-active-bg: #146c43;
|
||||
--bs-btn-active-border-color: #13653f;
|
||||
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
||||
--bs-btn-disabled-color: #fff;
|
||||
--bs-btn-disabled-bg: #198754;
|
||||
--bs-btn-disabled-border-color: #198754;
|
||||
}
|
||||
.bg-green {
|
||||
--bs-bg-opacity: 1;
|
||||
background-color: rgba(52, 102, 36, var(--bs-bg-opacity)) !important;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user