Update Alur Lengkap & UserRole
This commit is contained in:
parent
e8849e20d0
commit
754ac8d734
@ -32,10 +32,12 @@ $routes->group('admin', ['filter' => 'role:1'], function($routes) {
|
|||||||
|
|
||||||
$routes->group('doctor', ['filter' => 'role:2'], function($routes) {
|
$routes->group('doctor', ['filter' => 'role:2'], function($routes) {
|
||||||
$routes->get('/', 'Doctor::index');
|
$routes->get('/', 'Doctor::index');
|
||||||
|
$routes->get('modal_specimen', 'Doctor::modal_specimen');
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group('analyst', ['filter' => 'role:3'], function($routes) {
|
$routes->group('analyst', ['filter' => 'role:3'], function($routes) {
|
||||||
$routes->get('/', 'Analyst::index');
|
$routes->get('/', 'Analyst::index');
|
||||||
|
$routes->get('modal_specimen', 'Analyst::modal_specimen');
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group('cs', ['filter' => 'role:4'], function($routes) {
|
$routes->group('cs', ['filter' => 'role:4'], function($routes) {
|
||||||
|
|||||||
@ -66,11 +66,11 @@ class Admin extends BaseController {
|
|||||||
'isprinted'=> $row['ODR_ISPRINTED'] ?? 0,
|
'isprinted'=> $row['ODR_ISPRINTED'] ?? 0,
|
||||||
'ispending'=> $row['ODR_ISPENDING'] ?? 0,
|
'ispending'=> $row['ODR_ISPENDING'] ?? 0,
|
||||||
'ishardcopy'=> $row['ODR_NFLAGHARDCOPY'] ?? 0,
|
'ishardcopy'=> $row['ODR_NFLAGHARDCOPY'] ?? 0,
|
||||||
'isval' => $row['ISVAL'] ?? 0,
|
'isvaltd' => $row['ISVAL'] ?? 0,
|
||||||
'isval1' => $row['ISVAL1'] ?? 0,
|
// 'isval1' => $row['ISVAL1'] ?? 0,
|
||||||
'isval2' => $row['ISVAL2'] ?? 0,
|
// 'isval2' => $row['ISVAL2'] ?? 0,
|
||||||
'isdelete' => $isDelete,
|
'isdelete' => $isDelete,
|
||||||
'val' => $row['VAL'] ?? 0,
|
'valcounter' => $row['VAL'] ?? 0,
|
||||||
'val1user' => $row['VAL1USER'] ?? '-',
|
'val1user' => $row['VAL1USER'] ?? '-',
|
||||||
'val2user' => $row['VAL2USER'] ?? '-',
|
'val2user' => $row['VAL2USER'] ?? '-',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -3,9 +3,113 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
class Analyst extends BaseController
|
class Analyst extends BaseController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index() {
|
||||||
{
|
$today = date('Y-m-d');
|
||||||
return view('analyst/index');
|
$date1 = $this->request->getVar('date1') ?? $today;
|
||||||
|
$date2 = $this->request->getVar('date2') ?? $today;
|
||||||
|
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$sql = "SELECT * from GDC_CMOD.dbo.V_DASHBOARD_DEV
|
||||||
|
where COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' and ODR_DDATE between '$date1 00:00' and '$date2 23:59'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
|
||||||
|
// === Variabel counter ===
|
||||||
|
$CPending = 0; $CPColl = 0; $CColl = 0; $CPRecv = 0;
|
||||||
|
$CRecv = 0; $CInc = 0; $CPenV = 0; $CFin = 0; $CFinV = 0;
|
||||||
|
$CTotal = 0;
|
||||||
|
|
||||||
|
$dataList = [];
|
||||||
|
|
||||||
|
foreach ($results as $row) {
|
||||||
|
$reqdate = '';
|
||||||
|
if (!empty($row['REQDATE'])) {
|
||||||
|
$reqdate = date('Y-m-d H:i', strtotime($row['REQDATE']));
|
||||||
|
}
|
||||||
|
$patname = $row['Name'] ?? '';
|
||||||
|
$sp_accessnumber = $row['SP_ACCESSNUMBER'] ?? '';
|
||||||
|
$hostordernumber = $row['HOSTORDERNUMBER'] ?? '';
|
||||||
|
$stats = $row['STATS'] ?? '';
|
||||||
|
$tests = $row['TESTS'] ?? '';
|
||||||
|
$isDelete = $row['ISDELETE'] ?? 0;
|
||||||
|
|
||||||
|
// Bersihkan test string
|
||||||
|
$test = str_replace(['(', ')', ',', 'FA'], '', $tests);
|
||||||
|
|
||||||
|
if (!is_numeric($test) && $isDelete == 0) {
|
||||||
|
switch ($stats) {
|
||||||
|
case 'Pend': $statscode = 1; $CPending++; break;
|
||||||
|
case 'PartColl':$statscode = 2; $CPColl++; break;
|
||||||
|
case 'Coll': $statscode = 3; $CColl++; break;
|
||||||
|
case 'PartRecv':$statscode = 4; $CPRecv++; break;
|
||||||
|
case 'Recv': $statscode = 5; $CRecv++; break;
|
||||||
|
case 'Inc': $statscode = 6; $CInc++; break;
|
||||||
|
case 'PenV': $statscode = 7; $CPenV++; break;
|
||||||
|
case 'Fin': $statscode = 8; $CFin++; break;
|
||||||
|
case 'FinV': $statscode = 9; $CFinV++; break;
|
||||||
|
default: $statscode = 0; break;
|
||||||
|
}
|
||||||
|
$CTotal++;
|
||||||
|
// Simpan ke array
|
||||||
|
$dataList[] = [
|
||||||
|
'statscode' => $statscode,
|
||||||
|
'reqdate' => $reqdate,
|
||||||
|
'patname' => $patname,
|
||||||
|
'sp_accessnumber' => $sp_accessnumber,
|
||||||
|
'hostordernumber' => $hostordernumber,
|
||||||
|
'reff' => $row['REFF'] ?? '',
|
||||||
|
'doc' => $row['DOC'] ?? '',
|
||||||
|
'tests' => $row['TESTS'] ?? '',
|
||||||
|
'stats' => $stats,
|
||||||
|
'odr_cresult_to' => $row['ODR_CRESULT_TO'],
|
||||||
|
'isprinted'=> $row['ODR_ISPRINTED'] ?? 0,
|
||||||
|
'ispending'=> $row['ODR_ISPENDING'] ?? 0,
|
||||||
|
'ishardcopy'=> $row['ODR_NFLAGHARDCOPY'] ?? 0,
|
||||||
|
'isvaltd' => $row['ISVAL'] ?? 0,
|
||||||
|
// 'isval1' => $row['ISVAL1'] ?? 0,
|
||||||
|
// 'isval2' => $row['ISVAL2'] ?? 0,
|
||||||
|
'isdelete' => $isDelete,
|
||||||
|
'valcounter' => $row['VAL'] ?? 0,
|
||||||
|
'val1user' => $row['VAL1USER'] ?? '-',
|
||||||
|
'val2user' => $row['VAL2USER'] ?? '-',
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Total counter ===
|
||||||
|
$counter = [
|
||||||
|
'pending' => $CPending,
|
||||||
|
'collect' => $CPColl+$CColl,
|
||||||
|
'recv' => $CPRecv+$CRecv,
|
||||||
|
'incomplete' => $CInc+$CPenV,
|
||||||
|
'complete' => $CFin+$CFinV,
|
||||||
|
'total' => $CTotal,
|
||||||
|
/*
|
||||||
|
'partialCollected' => $CPColl,
|
||||||
|
'collected' => $CColl,
|
||||||
|
'partialReceived' => $CPRecv,
|
||||||
|
'received' => $CRecv,
|
||||||
|
'incomplete' => $CInc,
|
||||||
|
'pendingValidation' => $CPenV,
|
||||||
|
'final' => $CFin,
|
||||||
|
'finalValidation' => $CFinV,
|
||||||
|
*/
|
||||||
|
];
|
||||||
|
|
||||||
|
$data['dataList'] = $dataList;
|
||||||
|
$data['counter'] = $counter;
|
||||||
|
$data['date1'] = $date1;
|
||||||
|
$data['date2'] = $date2;
|
||||||
|
|
||||||
|
// dd($results);
|
||||||
|
|
||||||
|
|
||||||
|
return view('analyst/index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modal_specimen() {
|
||||||
|
return view('analyst/modal_specimen');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,11 +19,22 @@ class Auth extends BaseController {
|
|||||||
$user = $query->getRowArray();
|
$user = $query->getRowArray();
|
||||||
|
|
||||||
if ($user && !empty($user['PASSWORD']) && password_verify($password, $user['PASSWORD'])) {
|
if ($user && !empty($user['PASSWORD']) && password_verify($password, $user['PASSWORD'])) {
|
||||||
|
|
||||||
|
// Role untuk url
|
||||||
|
switch ((int)$user['USERLEVEL']) {
|
||||||
|
case 1: $role = 'admin'; break;
|
||||||
|
case 2: $role = 'doctor'; break;
|
||||||
|
case 3: $role = 'analyst'; break;
|
||||||
|
case 4: $role = 'cs'; break;
|
||||||
|
default: $role = ''; break;
|
||||||
|
}
|
||||||
|
|
||||||
// Simpan session
|
// Simpan session
|
||||||
$session->set([
|
$session->set([
|
||||||
'isLoggedIn' => true,
|
'isLoggedIn' => true,
|
||||||
'userid' => (string) $user['USERID'],
|
'userid' => (string) $user['USERID'],
|
||||||
'userlevel' => (int) $user['USERLEVEL'],
|
'userlevel' => (int) $user['USERLEVEL'],
|
||||||
|
'userrole' => (string) $role,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Redirect sesuai level dari data didatabase
|
// Redirect sesuai level dari data didatabase
|
||||||
|
|||||||
@ -3,9 +3,109 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
class CustomerService extends BaseController
|
class CustomerService extends BaseController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index() {
|
||||||
{
|
$today = date('Y-m-d');
|
||||||
return view('cs/index');
|
$date1 = $this->request->getVar('date1') ?? $today;
|
||||||
|
$date2 = $this->request->getVar('date2') ?? $today;
|
||||||
|
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$sql = "SELECT * from GDC_CMOD.dbo.V_DASHBOARD_DEV
|
||||||
|
where COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' and ODR_DDATE between '$date1 00:00' and '$date2 23:59'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
|
||||||
|
// === Variabel counter ===
|
||||||
|
$CPending = 0; $CPColl = 0; $CColl = 0; $CPRecv = 0;
|
||||||
|
$CRecv = 0; $CInc = 0; $CPenV = 0; $CFin = 0; $CFinV = 0;
|
||||||
|
$CTotal = 0;
|
||||||
|
|
||||||
|
$dataList = [];
|
||||||
|
|
||||||
|
foreach ($results as $row) {
|
||||||
|
$reqdate = '';
|
||||||
|
if (!empty($row['REQDATE'])) {
|
||||||
|
$reqdate = date('Y-m-d H:i', strtotime($row['REQDATE']));
|
||||||
|
}
|
||||||
|
$patname = $row['Name'] ?? '';
|
||||||
|
$sp_accessnumber = $row['SP_ACCESSNUMBER'] ?? '';
|
||||||
|
$hostordernumber = $row['HOSTORDERNUMBER'] ?? '';
|
||||||
|
$stats = $row['STATS'] ?? '';
|
||||||
|
$tests = $row['TESTS'] ?? '';
|
||||||
|
$isDelete = $row['ISDELETE'] ?? 0;
|
||||||
|
|
||||||
|
// Bersihkan test string
|
||||||
|
$test = str_replace(['(', ')', ',', 'FA'], '', $tests);
|
||||||
|
|
||||||
|
if (!is_numeric($test) && $isDelete == 0) {
|
||||||
|
switch ($stats) {
|
||||||
|
case 'Pend': $statscode = 1; $CPending++; break;
|
||||||
|
case 'PartColl':$statscode = 2; $CPColl++; break;
|
||||||
|
case 'Coll': $statscode = 3; $CColl++; break;
|
||||||
|
case 'PartRecv':$statscode = 4; $CPRecv++; break;
|
||||||
|
case 'Recv': $statscode = 5; $CRecv++; break;
|
||||||
|
case 'Inc': $statscode = 6; $CInc++; break;
|
||||||
|
case 'PenV': $statscode = 7; $CPenV++; break;
|
||||||
|
case 'Fin': $statscode = 8; $CFin++; break;
|
||||||
|
case 'FinV': $statscode = 9; $CFinV++; break;
|
||||||
|
default: $statscode = 0; break;
|
||||||
|
}
|
||||||
|
$CTotal++;
|
||||||
|
// Simpan ke array
|
||||||
|
$dataList[] = [
|
||||||
|
'statscode' => $statscode,
|
||||||
|
'reqdate' => $reqdate,
|
||||||
|
'patname' => $patname,
|
||||||
|
'sp_accessnumber' => $sp_accessnumber,
|
||||||
|
'hostordernumber' => $hostordernumber,
|
||||||
|
'reff' => $row['REFF'] ?? '',
|
||||||
|
'doc' => $row['DOC'] ?? '',
|
||||||
|
'tests' => $row['TESTS'] ?? '',
|
||||||
|
'stats' => $stats,
|
||||||
|
'odr_cresult_to' => $row['ODR_CRESULT_TO'],
|
||||||
|
'isprinted'=> $row['ODR_ISPRINTED'] ?? 0,
|
||||||
|
'ispending'=> $row['ODR_ISPENDING'] ?? 0,
|
||||||
|
'ishardcopy'=> $row['ODR_NFLAGHARDCOPY'] ?? 0,
|
||||||
|
'isvaltd' => $row['ISVAL'] ?? 0,
|
||||||
|
// 'isval1' => $row['ISVAL1'] ?? 0,
|
||||||
|
// 'isval2' => $row['ISVAL2'] ?? 0,
|
||||||
|
'isdelete' => $isDelete,
|
||||||
|
'valcounter' => $row['VAL'] ?? 0,
|
||||||
|
'val1user' => $row['VAL1USER'] ?? '-',
|
||||||
|
'val2user' => $row['VAL2USER'] ?? '-',
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Total counter ===
|
||||||
|
$counter = [
|
||||||
|
'pending' => $CPending,
|
||||||
|
'collect' => $CPColl+$CColl,
|
||||||
|
'recv' => $CPRecv+$CRecv,
|
||||||
|
'incomplete' => $CInc+$CPenV,
|
||||||
|
'complete' => $CFin+$CFinV,
|
||||||
|
'total' => $CTotal,
|
||||||
|
/*
|
||||||
|
'partialCollected' => $CPColl,
|
||||||
|
'collected' => $CColl,
|
||||||
|
'partialReceived' => $CPRecv,
|
||||||
|
'received' => $CRecv,
|
||||||
|
'incomplete' => $CInc,
|
||||||
|
'pendingValidation' => $CPenV,
|
||||||
|
'final' => $CFin,
|
||||||
|
'finalValidation' => $CFinV,
|
||||||
|
*/
|
||||||
|
];
|
||||||
|
|
||||||
|
$data['dataList'] = $dataList;
|
||||||
|
$data['counter'] = $counter;
|
||||||
|
$data['date1'] = $date1;
|
||||||
|
$data['date2'] = $date2;
|
||||||
|
|
||||||
|
// dd($results);
|
||||||
|
|
||||||
|
|
||||||
|
return view('cs/index', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,113 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
class Doctor extends BaseController
|
class Doctor extends BaseController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index() {
|
||||||
{
|
$today = date('Y-m-d');
|
||||||
return view('doctor/index');
|
$date1 = $this->request->getVar('date1') ?? $today;
|
||||||
|
$date2 = $this->request->getVar('date2') ?? $today;
|
||||||
|
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$sql = "SELECT * from GDC_CMOD.dbo.V_DASHBOARD_DEV
|
||||||
|
where COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' and ODR_DDATE between '$date1 00:00' and '$date2 23:59'";
|
||||||
|
$query = $db->query($sql);
|
||||||
|
$results = $query->getResultArray();
|
||||||
|
|
||||||
|
// === Variabel counter ===
|
||||||
|
$CPending = 0; $CPColl = 0; $CColl = 0; $CPRecv = 0;
|
||||||
|
$CRecv = 0; $CInc = 0; $CPenV = 0; $CFin = 0; $CFinV = 0;
|
||||||
|
$CTotal = 0;
|
||||||
|
|
||||||
|
$dataList = [];
|
||||||
|
|
||||||
|
foreach ($results as $row) {
|
||||||
|
$reqdate = '';
|
||||||
|
if (!empty($row['REQDATE'])) {
|
||||||
|
$reqdate = date('Y-m-d H:i', strtotime($row['REQDATE']));
|
||||||
|
}
|
||||||
|
$patname = $row['Name'] ?? '';
|
||||||
|
$sp_accessnumber = $row['SP_ACCESSNUMBER'] ?? '';
|
||||||
|
$hostordernumber = $row['HOSTORDERNUMBER'] ?? '';
|
||||||
|
$stats = $row['STATS'] ?? '';
|
||||||
|
$tests = $row['TESTS'] ?? '';
|
||||||
|
$isDelete = $row['ISDELETE'] ?? 0;
|
||||||
|
|
||||||
|
// Bersihkan test string
|
||||||
|
$test = str_replace(['(', ')', ',', 'FA'], '', $tests);
|
||||||
|
|
||||||
|
if (!is_numeric($test) && $isDelete == 0) {
|
||||||
|
switch ($stats) {
|
||||||
|
case 'Pend': $statscode = 1; $CPending++; break;
|
||||||
|
case 'PartColl':$statscode = 2; $CPColl++; break;
|
||||||
|
case 'Coll': $statscode = 3; $CColl++; break;
|
||||||
|
case 'PartRecv':$statscode = 4; $CPRecv++; break;
|
||||||
|
case 'Recv': $statscode = 5; $CRecv++; break;
|
||||||
|
case 'Inc': $statscode = 6; $CInc++; break;
|
||||||
|
case 'PenV': $statscode = 7; $CPenV++; break;
|
||||||
|
case 'Fin': $statscode = 8; $CFin++; break;
|
||||||
|
case 'FinV': $statscode = 9; $CFinV++; break;
|
||||||
|
default: $statscode = 0; break;
|
||||||
|
}
|
||||||
|
$CTotal++;
|
||||||
|
// Simpan ke array
|
||||||
|
$dataList[] = [
|
||||||
|
'statscode' => $statscode,
|
||||||
|
'reqdate' => $reqdate,
|
||||||
|
'patname' => $patname,
|
||||||
|
'sp_accessnumber' => $sp_accessnumber,
|
||||||
|
'hostordernumber' => $hostordernumber,
|
||||||
|
'reff' => $row['REFF'] ?? '',
|
||||||
|
'doc' => $row['DOC'] ?? '',
|
||||||
|
'tests' => $row['TESTS'] ?? '',
|
||||||
|
'stats' => $stats,
|
||||||
|
'odr_cresult_to' => $row['ODR_CRESULT_TO'],
|
||||||
|
'isprinted'=> $row['ODR_ISPRINTED'] ?? 0,
|
||||||
|
'ispending'=> $row['ODR_ISPENDING'] ?? 0,
|
||||||
|
'ishardcopy'=> $row['ODR_NFLAGHARDCOPY'] ?? 0,
|
||||||
|
'isvaltd' => $row['ISVAL'] ?? 0,
|
||||||
|
// 'isval1' => $row['ISVAL1'] ?? 0,
|
||||||
|
// 'isval2' => $row['ISVAL2'] ?? 0,
|
||||||
|
'isdelete' => $isDelete,
|
||||||
|
'valcounter' => $row['VAL'] ?? 0,
|
||||||
|
'val1user' => $row['VAL1USER'] ?? '-',
|
||||||
|
'val2user' => $row['VAL2USER'] ?? '-',
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Total counter ===
|
||||||
|
$counter = [
|
||||||
|
'pending' => $CPending,
|
||||||
|
'collect' => $CPColl+$CColl,
|
||||||
|
'recv' => $CPRecv+$CRecv,
|
||||||
|
'incomplete' => $CInc+$CPenV,
|
||||||
|
'complete' => $CFin+$CFinV,
|
||||||
|
'total' => $CTotal,
|
||||||
|
/*
|
||||||
|
'partialCollected' => $CPColl,
|
||||||
|
'collected' => $CColl,
|
||||||
|
'partialReceived' => $CPRecv,
|
||||||
|
'received' => $CRecv,
|
||||||
|
'incomplete' => $CInc,
|
||||||
|
'pendingValidation' => $CPenV,
|
||||||
|
'final' => $CFin,
|
||||||
|
'finalValidation' => $CFinV,
|
||||||
|
*/
|
||||||
|
];
|
||||||
|
|
||||||
|
$data['dataList'] = $dataList;
|
||||||
|
$data['counter'] = $counter;
|
||||||
|
$data['date1'] = $date1;
|
||||||
|
$data['date2'] = $date2;
|
||||||
|
|
||||||
|
// dd($results);
|
||||||
|
|
||||||
|
|
||||||
|
return view('doctor/index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modal_specimen() {
|
||||||
|
return view('doctor/modal_specimen');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="container-fluid px-3">
|
<div class="container-fluid px-3">
|
||||||
<div class='row p-1'>
|
<div class='row p-1'>
|
||||||
<div class='col fw-bold'>Dashboard</div>
|
<div class='col fw-bold'>Dashboard, <?=session('userrole');?></div>
|
||||||
<div class='col text-end'>
|
<div class='col text-end'>
|
||||||
Hi, <?=session('userid');?>
|
Hi, <?=session('userid');?>
|
||||||
<button class="btn btn-sm btn-secondary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-list"></i></button>
|
<button class="btn btn-sm btn-secondary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-list"></i></button>
|
||||||
@ -114,10 +114,15 @@
|
|||||||
<td> <?= esc($row['statscode']) ?> </td> <td> <?= esc($row['reqdate']) ?> </td> <td> <?= esc($row['patname']) ?> </td>
|
<td> <?= esc($row['statscode']) ?> </td> <td> <?= esc($row['reqdate']) ?> </td> <td> <?= esc($row['patname']) ?> </td>
|
||||||
<td> <?= esc($row['sp_accessnumber']) ?> </td> <td> <?= esc($row['hostordernumber']) ?> </td> <td> <?= esc($row['reff']) ?> </td>
|
<td> <?= esc($row['sp_accessnumber']) ?> </td> <td> <?= esc($row['hostordernumber']) ?> </td> <td> <?= esc($row['reff']) ?> </td>
|
||||||
<td> <?= esc($row['doc']) ?> </td> <td> <?= $tests; ?> </td>
|
<td> <?= esc($row['doc']) ?> </td> <td> <?= $tests; ?> </td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?= esc($row['odr_cresult_to']) ?> <br/>
|
<?= esc($row['odr_cresult_to']) ?> <br/>
|
||||||
<input type="checkbox" name="printed"> Printed
|
<?php if($row['valcounter'] == 2) { ?>
|
||||||
|
<input type="checkbox" name="printed"> Printed <br/>
|
||||||
|
<input type="checkbox" name="eng"> Eng
|
||||||
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<table class='mx-auto'>
|
<table class='mx-auto'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -126,27 +131,37 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td id='val2user-<?=$accessnumber;?>'>2 : <?=$row['val2user'];?></td>
|
<td id='val2user-<?=$accessnumber;?>'>2 : <?=$row['val2user'];?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if($row['isval'] == 1) { ?>
|
|
||||||
<tr>
|
<?php if($row['isvaltd'] != 0) { ?>
|
||||||
<td>
|
<?php
|
||||||
<button id='unvalBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unvalidateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#unvalidateModal"><i class="bi bi-arrow-counterclockwise"></i></button>
|
$user = session()->get('userid');
|
||||||
<?php if($row['val2user'] == '' || $row['val2user'] == '-' ) {?>
|
$val1 = $row['val1user'];
|
||||||
<button id='valBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="validateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#validateModal"><i class="bi bi-check-lg"></i></button>
|
$val2 = $row['val2user'];
|
||||||
<?php } ?>
|
|
||||||
</td>
|
$valButton = (($val1 === '-') || ($val2 === '-')) && ($user !== $val1 && $user !== $val2);
|
||||||
</tr>
|
$unvalButton = ($val1 !== '-') || ($val2 !== '-');
|
||||||
<?php if($row['isval2']==1) {?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
|
||||||
<a href="http://glenlis/spooler_db/main_dev.php?acc=<?=$row['sp_accessnumber'];?>" target="_blank" class="btn btn-xs btn-primary py-0 px-1">Ind</a>
|
<td id="btnContainer-<?=$accessnumber;?>">
|
||||||
<a href="http://glenlis/spooler_db/main_dev.php?acc=<?=$row['sp_accessnumber'];?>&eng=1" target="_blank" class="btn btn-xs btn-primary py-0 px-1">Eng</a>
|
<?php if ($unvalButton): ?>
|
||||||
<a href="#" class="btn btn-xs btn-secondary py-0 px-1">Pdf</a> <br />
|
<button id='unvalBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unvalidateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#unvalidateModal"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||||
</td>
|
<?php endif; ?>
|
||||||
</tr>
|
|
||||||
<?php } } ?>
|
<?php if ($valButton): ?>
|
||||||
|
<button id='valBtn-<?= $accessnumber; ?>' class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="validateShow(<?= $row['sp_accessnumber']; ?>)" data-bs-toggle="modal" data-bs-target="#validateModal"> <i class="bi bi-check-lg"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" onclick="detailShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
|
||||||
|
|
||||||
|
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" onclick="detailShow('<?=session('userrole');?>')" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div class="col">val : <?=$val1user;?> - <?=$val2user;?></div>
|
<div class="col">val : <?=$val1user;?> - <?=$val2user;?></div>
|
||||||
<div class='col text-end'>
|
<div class='col text-end'>
|
||||||
<button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button>
|
<button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button>
|
||||||
|
<!-- <button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,172 +1,285 @@
|
|||||||
<?php
|
|
||||||
$today = date('Y-m-d');
|
|
||||||
$date1 = $_GET['date1'] ?? $today;
|
|
||||||
$date2 = $_GET['date2'] ?? $today;
|
|
||||||
?>
|
|
||||||
<?= $this->extend('_layouts/main.php') ?>
|
<?= $this->extend('_layouts/main.php') ?>
|
||||||
|
|
||||||
<?= $this->section('title') ?>
|
<?= $this->section('title') ?>
|
||||||
<title>Analyst Glenlis</title>
|
<title>Analyst Glenlis</title>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
|
<div class="container-fluid px-3">
|
||||||
<div class="container-fluid px-5">
|
<div class='row p-1'>
|
||||||
<div class="row">
|
<div class='col fw-bold'>Dashboard, <?=session('userrole');?></div>
|
||||||
<div class="col mt-3">
|
<div class='col text-end'>
|
||||||
<div class="accordion" id="accordionPanelsStayOpenExample">
|
Hi, <?=session('userid');?>
|
||||||
<div class="accordion-item">
|
<button class="btn btn-sm btn-secondary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-list"></i></button>
|
||||||
<h2 class="accordion-header">
|
<div class="dropdown">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne">
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||||
🔎 Search Form
|
<li><a class="dropdown-item" href="<?=base_url('analyst/');?>">Dashboard</a></li>
|
||||||
</button>
|
<li><a class="dropdown-item" href="<?=base_url('');?>">Report</a></li>
|
||||||
</h2>
|
<li><a class="dropdown-item" href="<?=base_url('logout');?>">Log Out</a></li>
|
||||||
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show">
|
</ul>
|
||||||
<div class="accordion-body">
|
</div>
|
||||||
<form method="GET" class="p-1" action='<?= base_url('api/dashboard') ?>'>
|
|
||||||
<div class="row align-items-center g-2">
|
|
||||||
<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 px-3">LIST</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-sm btn-outline-dark px-3"
|
|
||||||
onclick="window.location.href='/';"
|
|
||||||
>
|
|
||||||
RESET
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="accordion-item">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
|
|
||||||
☰ Filter Form
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<form class="p-1">
|
|
||||||
|
|
||||||
<!-- Baris 1: Name & Reff -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Name :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col2_filter" data-column="2" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Reff :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col5_filter" data-column="5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 2: Test & Doctor -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Test :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col7_filter" data-column="7" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Doctor :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col6_filter" data-column="6" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 3: Exc & Send To -->
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Exc :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="exc" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Send to :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col8_filter" data-column="8" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 4: Stat -->
|
|
||||||
<div class="row ">
|
|
||||||
<div class="col d-flex flex-wrap align-items-center">
|
|
||||||
<label class="col-auto col-form-label-sm text-muted fw-semibold me-2">Stat :</label>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="1" id="pending" />
|
|
||||||
<label class="form-check-label small" for="pending">Pending</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="2" id="partialCollected" />
|
|
||||||
<label class="form-check-label small" for="partialCollected">Partial Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="3" id="collected" />
|
|
||||||
<label class="form-check-label small" for="collected">Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="4" id="partialReceived" />
|
|
||||||
<label class="form-check-label small" for="partialReceived">Partial Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="5" id="received" />
|
|
||||||
<label class="form-check-label small" for="received">Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="6" id="incomplete" />
|
|
||||||
<label class="form-check-label small" for="incomplete">Incomplete</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="7" id="pendingVerified" />
|
|
||||||
<label class="form-check-label small" for="pendingVerified">Pending (Verified)</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="8" id="final" />
|
|
||||||
<label class="form-check-label small" for="final">Final</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="9" id="finalVerified" />
|
|
||||||
<label class="form-check-label small" for="finalVerified">Final (Verified)</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class='col'>
|
||||||
|
<form method="GET" action='<?= base_url('/analyst') ?>'>
|
||||||
|
<div class="row align-items-center g-1">
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="filterGroup" class="col text-end">
|
||||||
|
<button class='btn btn-sm btn-outline-secondary' data-type='secondary'><?=$counter['pending'];?> <small>Pending</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-info' data-type='info'><?=$counter['collect'];?> <small>Collect</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-primary' data-type='primary'><?=$counter['recv'];?> <small>Receive</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-warning' data-type='warning'><?=$counter['incomplete'];?> <small>Incomplete</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-success' data-type='success'><?=$counter['complete'];?> <small>Complete</small></button>
|
||||||
|
<button class='btn btn-sm btn-dark' data-type='dark'><?=$counter['total'];?> <small>Total</small></button>
|
||||||
|
</div>
|
||||||
|
<div class="col-1">
|
||||||
|
<button id="filterValBtn" class='btn btn-sm btn-outline-primary' onclick="filterVal('<?=session('userid');?>')"> <small>Validate</small></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table table-responsive-scroll">
|
||||||
|
<table id="datatables" class="table table-sm table-hover table-bordered align-middle table-striped">
|
||||||
|
<thead class="table-primary">
|
||||||
|
<tr>
|
||||||
|
<th style="width:1%;">S</th>
|
||||||
|
<th style='width:7%;'>Order Datetime</th>
|
||||||
|
<th>Patient Name</th>
|
||||||
|
<th style='width:7%;'>No Lab</th>
|
||||||
|
<th style='width:7%;'>No Register</th>
|
||||||
|
<th style='width:8%;'>Reff</th>
|
||||||
|
<th style='width:8%;'>Doctor</th>
|
||||||
|
<th style='width:15%;'>Tests</th>
|
||||||
|
<th style='width:5%;'>Result To</th>
|
||||||
|
<th style='width:5%;'>Validation</th>
|
||||||
|
<th style='width:4%;'>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach($dataList as $row) : ?>
|
||||||
|
<?php
|
||||||
|
switch ($row['statscode']) {
|
||||||
|
case 1: $class = 'BackPend'; break;
|
||||||
|
case 2: $class = 'PartColl'; break;
|
||||||
|
case 3: $class = 'Collected'; break;
|
||||||
|
case 4: $class = 'PartRecv'; break;
|
||||||
|
case 5: $class = 'Received'; break;
|
||||||
|
case 6: $class = 'Incomplete'; break;
|
||||||
|
case 7: $class = 'Final'; break;
|
||||||
|
case 8: $class = 'FinVerification'; break;
|
||||||
|
case 9: $class = 'PenVerification'; break;
|
||||||
|
default: $class = ''; break;
|
||||||
|
}
|
||||||
|
$tests = esc($row['tests']);
|
||||||
|
$tests = str_replace(",", ", ", $tests);
|
||||||
|
$accessnumber = $row['sp_accessnumber'];
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<!--
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['statscode']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reqdate']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['sp_accessnumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['hostordernumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['doc']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['tests']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['odr_cresult_to']) ?> </td>
|
||||||
|
-->
|
||||||
|
<td> <?= esc($row['statscode']) ?> </td> <td> <?= esc($row['reqdate']) ?> </td> <td> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td> <?= esc($row['sp_accessnumber']) ?> </td> <td> <?= esc($row['hostordernumber']) ?> </td> <td> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td> <?= esc($row['doc']) ?> </td> <td> <?= $tests; ?> </td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?= esc($row['odr_cresult_to']) ?> <br/>
|
||||||
|
<?php if($row['valcounter'] == 2) { ?>
|
||||||
|
<input type="checkbox" name="printed"> Printed <br/>
|
||||||
|
<input type="checkbox" name="eng"> Eng
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-center">
|
||||||
|
<table class='mx-auto'>
|
||||||
|
<tr>
|
||||||
|
<td id='val1user-<?=$accessnumber;?>'>1 : <?=$row['val1user'];?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id='val2user-<?=$accessnumber;?>'>2 : <?=$row['val2user'];?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php if($row['isvaltd'] != 0) { ?>
|
||||||
|
<?php
|
||||||
|
$user = session()->get('userid');
|
||||||
|
$val1 = $row['val1user'];
|
||||||
|
$val2 = $row['val2user'];
|
||||||
|
|
||||||
|
$valButton = (($val1 === '-') || ($val2 === '-')) && ($user !== $val1 && $user !== $val2);
|
||||||
|
$unvalButton = ($val1 !== '-') || ($val2 !== '-');
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td id="btnContainer-<?=$accessnumber;?>">
|
||||||
|
<?php if ($unvalButton): ?>
|
||||||
|
<button id='unvalBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unvalidateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#unvalidateModal"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($valButton): ?>
|
||||||
|
<button id='valBtn-<?= $accessnumber; ?>' class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="validateShow(<?= $row['sp_accessnumber']; ?>)" data-bs-toggle="modal" data-bs-target="#validateModal"> <i class="bi bi-check-lg"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" onclick="detailShow('<?=session('userrole');?>')" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal Specimen Collection-->
|
||||||
|
<div class="modal fade" id="detailModal" aria-hidden="true" aria-labelledby="detailModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fw-bold fs-4" id="detailModal">Specimen Collection</h1>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="specimenModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="validateModal" aria-hidden="true" aria-labelledby="validateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="validateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="unvalidateModal" aria-hidden="true" aria-labelledby="unvalidateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="unvalidateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('script') ?>
|
<?= $this->section('script') ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
table = $('#datatables').DataTable({
|
||||||
|
layout: {
|
||||||
|
topEnd: 'search',
|
||||||
|
bottomStart: null, bottomEnd: null
|
||||||
|
},
|
||||||
|
order: [[0, 'asc'], [3, 'asc']],
|
||||||
|
paging: false,
|
||||||
|
scrollCollapse: true,
|
||||||
|
scrollY: '70vh',
|
||||||
|
columnDefs: [{
|
||||||
|
className: 'text-center',
|
||||||
|
targets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}, // semua kolom di tengah
|
||||||
|
{
|
||||||
|
className: 'text-start',
|
||||||
|
targets: [10]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
responsive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filterGroup .btn').on('click', function () {
|
||||||
|
$('#filterGroup .btn').each(function () {
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-${type}`).addClass(`btn-outline-${type}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-outline-${type}`).addClass(`btn-${type}`);
|
||||||
|
let vals;
|
||||||
|
if(type=='secondary') { vals = [0]; }
|
||||||
|
if(type=='info') { vals = ['1','2']; }
|
||||||
|
if(type=='primary') { vals = ['3','4','5']; }
|
||||||
|
if(type=='warning') { vals = [6,7]; }
|
||||||
|
if(type=='success') { vals = [8]; }
|
||||||
|
if(type=='dark') {vals=[];}
|
||||||
|
regex = vals.join('|');
|
||||||
|
table.column(0).search(regex, true, false).draw();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Select the column by index (1) and apply a search that excludes "Test"
|
||||||
|
// The regex: ^((?!Test).)*$
|
||||||
|
// - ^...$ anchors the start and end
|
||||||
|
// - (?!Test) is a negative lookahead, failing the match if "Test" is found
|
||||||
|
function filterVal(userid) {
|
||||||
|
var currentSearch = table.column(9).search();
|
||||||
|
if (currentSearch.includes(userid)) {
|
||||||
|
table.column(9).search( '' ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-primary`).addClass(`btn-outline-primary`);
|
||||||
|
} else {
|
||||||
|
table.column(9).search( `^((?!${userid}).)*$`, true, false ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-outline-primary`).addClass(`btn-primary`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unvalidate(accessnumber,userid) {
|
||||||
|
if(confirm("Are you sure?")) {
|
||||||
|
fetch(`${BASE_URL}/api/request/validate/${accessnumber}`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {"Content-Type": "application/json"},
|
||||||
|
body: JSON.stringify({ userid:`${userid}` })
|
||||||
|
}).then(response => {
|
||||||
|
console.log("Response:", response);
|
||||||
|
$(`#val1user-${accessnumber}`).text("1 : ");
|
||||||
|
$(`#val2user-${accessnumber}`).text("2 : ");
|
||||||
|
$(`#valBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
$(`#unvalBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
}).catch(error => {
|
||||||
|
console.log("Error:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const BASE_URL = "<?= base_url(); ?>";
|
||||||
|
</script>
|
||||||
|
<script src="<?=base_url('js/admin/specimen.js');?>"></script>
|
||||||
|
<script src="<?=base_url('js/admin/request.js');?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
40
app/Views/analyst/modal_request.php
Normal file
40
app/Views/analyst/modal_request.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class="col">val : <?=$val1user;?> - <?=$val2user;?></div>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button>
|
||||||
|
<!-- <button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mx-auto">
|
||||||
|
<iframe id="result-iframe" src="http://glenlis/spooler_db/main_dev.php?acc=<?=$accessnumber;?>" width="750px" height="600px"> -->
|
||||||
|
<!-- <iframe id="result-iframe" src="<?=base_url('dummypage');?>" width="750px" height="600px"> -->
|
||||||
|
|
||||||
|
<p>Your browser does not support iframes. Please contact the technical support.</p>
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
{
|
||||||
|
// verifymodal
|
||||||
|
let iframe = document.getElementById('result-iframe');
|
||||||
|
let button = document.getElementById('result-button');
|
||||||
|
|
||||||
|
iframe.addEventListener('load', () => {
|
||||||
|
//console.log('loaded');
|
||||||
|
let iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||||
|
let scrollElement = iframeDoc.scrollingElement || iframeDoc.documentElement;
|
||||||
|
|
||||||
|
iframeDoc.addEventListener('scroll', () => {
|
||||||
|
let scrollTop = scrollElement.scrollTop;
|
||||||
|
let scrollHeight = scrollElement.scrollHeight;
|
||||||
|
let clientHeight = scrollElement.clientHeight;
|
||||||
|
|
||||||
|
// Check if scrolled to bottom
|
||||||
|
if (scrollTop + clientHeight >= scrollHeight - 2) {
|
||||||
|
button.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
106
app/Views/analyst/modal_specimen.php
Normal file
106
app/Views/analyst/modal_specimen.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<div class="row mb-4 p-3">
|
||||||
|
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Patient</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.name}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Age</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.age}} years</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Gender</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.gender}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">Lab#</div>
|
||||||
|
<div class="info-value">: {{accessnumber}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">MR#</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.rm}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">KTP</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.ktp}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title fs-4 mb-2">
|
||||||
|
<i class="bi bi-flask-florence-fill"></i> Tube
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<table class="table fs-6 text-start table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Sample Code</th>
|
||||||
|
<th>Sample Name</th>
|
||||||
|
<th class='text-center'>Collected</th>
|
||||||
|
<th class='text-center'>Received</th>
|
||||||
|
<th>Action</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>Collection</td> <td></td> <td></td>
|
||||||
|
<td><button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>All</td> <td></td> <td></td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick=""><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{#samples}}
|
||||||
|
<tr id='row-{{accessnumber}}-{{sampcode}}'>
|
||||||
|
<td>{{sampcode}}</td>
|
||||||
|
<td>{{name}}</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input coll-checkbox"
|
||||||
|
{{#is_coll}}checked{{/is_coll}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input recv-checkbox"
|
||||||
|
{{#is_recv}}checked{{/is_recv}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 1)"><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 0)"><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="unreceive({{accessnumber}}, {{sampcode}})"><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/samples}}
|
||||||
|
|
||||||
|
<tr class="text-center">
|
||||||
|
<td colspan="6">
|
||||||
|
<h6 class="p-0 m-0">
|
||||||
|
<i class="bi bi-pencil-square" role="button" onclick="commentValue()"></i>
|
||||||
|
</h6>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
16
app/Views/analyst/modal_unvalidate.php
Normal file
16
app/Views/analyst/modal_unvalidate.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<form id='unValForm'>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<h4>Unvalidate <?=$accessnumber;?></h4>
|
||||||
|
</div>
|
||||||
|
<div class="row m-2">
|
||||||
|
<input type='hidden' name='accessnumber' value='<?=$accessnumber;?>'>
|
||||||
|
<input type='hidden' name='userid' value='<?=session('userid');?>'>
|
||||||
|
<textarea class='form-control' name='comment' placeholder="Note ..." rows='5'></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button class='btn btn-xs btn-warning' onclick="event.preventDefault();unvalidateRequest('unValForm', <?=$accessnumber;?>);">Un-Validate</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@ -1,172 +1,285 @@
|
|||||||
<?php
|
|
||||||
$today = date('Y-m-d');
|
|
||||||
$date1 = $_GET['date1'] ?? $today;
|
|
||||||
$date2 = $_GET['date2'] ?? $today;
|
|
||||||
?>
|
|
||||||
<?= $this->extend('_layouts/main.php') ?>
|
<?= $this->extend('_layouts/main.php') ?>
|
||||||
|
|
||||||
<?= $this->section('title') ?>
|
<?= $this->section('title') ?>
|
||||||
<title>Customer Service Glenlis</title>
|
<title>Customer Service Glenlis</title>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
|
<div class="container-fluid px-3">
|
||||||
<div class="container-fluid px-5">
|
<div class='row p-1'>
|
||||||
<div class="row">
|
<div class='col fw-bold'>Dashboard, <?=session('userrole');?></div>
|
||||||
<div class="col mt-3">
|
<div class='col text-end'>
|
||||||
<div class="accordion" id="accordionPanelsStayOpenExample">
|
Hi, <?=session('userid');?>
|
||||||
<div class="accordion-item">
|
<button class="btn btn-sm btn-secondary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-list"></i></button>
|
||||||
<h2 class="accordion-header">
|
<div class="dropdown">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne">
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||||
🔎 Search Form
|
<li><a class="dropdown-item" href="<?=base_url('cs/');?>">Dashboard</a></li>
|
||||||
</button>
|
<li><a class="dropdown-item" href="<?=base_url('');?>">Report</a></li>
|
||||||
</h2>
|
<li><a class="dropdown-item" href="<?=base_url('logout');?>">Log Out</a></li>
|
||||||
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show">
|
</ul>
|
||||||
<div class="accordion-body">
|
</div>
|
||||||
<form method="GET" class="p-1" action='<?= base_url('api/dashboard') ?>'>
|
|
||||||
<div class="row align-items-center g-2">
|
|
||||||
<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 px-3">LIST</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-sm btn-outline-dark px-3"
|
|
||||||
onclick="window.location.href='/';"
|
|
||||||
>
|
|
||||||
RESET
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="accordion-item">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
|
|
||||||
☰ Filter Form
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<form class="p-1">
|
|
||||||
|
|
||||||
<!-- Baris 1: Name & Reff -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Name :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col2_filter" data-column="2" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Reff :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col5_filter" data-column="5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 2: Test & Doctor -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Test :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col7_filter" data-column="7" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Doctor :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col6_filter" data-column="6" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 3: Exc & Send To -->
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Exc :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="exc" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Send to :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col8_filter" data-column="8" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 4: Stat -->
|
|
||||||
<div class="row ">
|
|
||||||
<div class="col d-flex flex-wrap align-items-center">
|
|
||||||
<label class="col-auto col-form-label-sm text-muted fw-semibold me-2">Stat :</label>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="1" id="pending" />
|
|
||||||
<label class="form-check-label small" for="pending">Pending</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="2" id="partialCollected" />
|
|
||||||
<label class="form-check-label small" for="partialCollected">Partial Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="3" id="collected" />
|
|
||||||
<label class="form-check-label small" for="collected">Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="4" id="partialReceived" />
|
|
||||||
<label class="form-check-label small" for="partialReceived">Partial Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="5" id="received" />
|
|
||||||
<label class="form-check-label small" for="received">Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="6" id="incomplete" />
|
|
||||||
<label class="form-check-label small" for="incomplete">Incomplete</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="7" id="pendingVerified" />
|
|
||||||
<label class="form-check-label small" for="pendingVerified">Pending (Verified)</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="8" id="final" />
|
|
||||||
<label class="form-check-label small" for="final">Final</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="9" id="finalVerified" />
|
|
||||||
<label class="form-check-label small" for="finalVerified">Final (Verified)</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class='col'>
|
||||||
|
<form method="GET" action='<?= base_url('/cs') ?>'>
|
||||||
|
<div class="row align-items-center g-1">
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="filterGroup" class="col text-end">
|
||||||
|
<button class='btn btn-sm btn-outline-secondary' data-type='secondary'><?=$counter['pending'];?> <small>Pending</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-info' data-type='info'><?=$counter['collect'];?> <small>Collect</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-primary' data-type='primary'><?=$counter['recv'];?> <small>Receive</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-warning' data-type='warning'><?=$counter['incomplete'];?> <small>Incomplete</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-success' data-type='success'><?=$counter['complete'];?> <small>Complete</small></button>
|
||||||
|
<button class='btn btn-sm btn-dark' data-type='dark'><?=$counter['total'];?> <small>Total</small></button>
|
||||||
|
</div>
|
||||||
|
<div class="col-1">
|
||||||
|
<button id="filterValBtn" class='btn btn-sm btn-outline-primary' onclick="filterVal('<?=session('userid');?>')"> <small>Validate</small></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table table-responsive-scroll">
|
||||||
|
<table id="datatables" class="table table-sm table-hover table-bordered align-middle table-striped">
|
||||||
|
<thead class="table-primary">
|
||||||
|
<tr>
|
||||||
|
<th style="width:1%;">S</th>
|
||||||
|
<th style='width:7%;'>Order Datetime</th>
|
||||||
|
<th>Patient Name</th>
|
||||||
|
<th style='width:7%;'>No Lab</th>
|
||||||
|
<th style='width:7%;'>No Register</th>
|
||||||
|
<th style='width:8%;'>Reff</th>
|
||||||
|
<th style='width:8%;'>Doctor</th>
|
||||||
|
<th style='width:15%;'>Tests</th>
|
||||||
|
<th style='width:5%;'>Result To</th>
|
||||||
|
<th style='width:5%;'>Validation</th>
|
||||||
|
<th style='width:4%;'>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach($dataList as $row) : ?>
|
||||||
|
<?php
|
||||||
|
switch ($row['statscode']) {
|
||||||
|
case 1: $class = 'BackPend'; break;
|
||||||
|
case 2: $class = 'PartColl'; break;
|
||||||
|
case 3: $class = 'Collected'; break;
|
||||||
|
case 4: $class = 'PartRecv'; break;
|
||||||
|
case 5: $class = 'Received'; break;
|
||||||
|
case 6: $class = 'Incomplete'; break;
|
||||||
|
case 7: $class = 'Final'; break;
|
||||||
|
case 8: $class = 'FinVerification'; break;
|
||||||
|
case 9: $class = 'PenVerification'; break;
|
||||||
|
default: $class = ''; break;
|
||||||
|
}
|
||||||
|
$tests = esc($row['tests']);
|
||||||
|
$tests = str_replace(",", ", ", $tests);
|
||||||
|
$accessnumber = $row['sp_accessnumber'];
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<!--
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['statscode']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reqdate']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['sp_accessnumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['hostordernumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['doc']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['tests']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['odr_cresult_to']) ?> </td>
|
||||||
|
-->
|
||||||
|
<td> <?= esc($row['statscode']) ?> </td> <td> <?= esc($row['reqdate']) ?> </td> <td> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td> <?= esc($row['sp_accessnumber']) ?> </td> <td> <?= esc($row['hostordernumber']) ?> </td> <td> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td> <?= esc($row['doc']) ?> </td> <td> <?= $tests; ?> </td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?= esc($row['odr_cresult_to']) ?> <br/>
|
||||||
|
<?php if($row['valcounter'] == 2) { ?>
|
||||||
|
<input type="checkbox" name="printed"> Printed <br/>
|
||||||
|
<input type="checkbox" name="eng"> Eng
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-center">
|
||||||
|
<table class='mx-auto'>
|
||||||
|
<tr>
|
||||||
|
<td id='val1user-<?=$accessnumber;?>'>1 : <?=$row['val1user'];?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id='val2user-<?=$accessnumber;?>'>2 : <?=$row['val2user'];?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php if($row['isvaltd'] != 0) { ?>
|
||||||
|
<?php
|
||||||
|
$user = session()->get('userid');
|
||||||
|
$val1 = $row['val1user'];
|
||||||
|
$val2 = $row['val2user'];
|
||||||
|
|
||||||
|
$valButton = (($val1 === '-') || ($val2 === '-')) && ($user !== $val1 && $user !== $val2);
|
||||||
|
$unvalButton = ($val1 !== '-') || ($val2 !== '-');
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td id="btnContainer-<?=$accessnumber;?>">
|
||||||
|
<?php if ($unvalButton): ?>
|
||||||
|
<button id='unvalBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unvalidateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#unvalidateModal"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($valButton): ?>
|
||||||
|
<button id='valBtn-<?= $accessnumber; ?>' class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="validateShow(<?= $row['sp_accessnumber']; ?>)" data-bs-toggle="modal" data-bs-target="#validateModal"> <i class="bi bi-check-lg"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" onclick="detailShow('<?=session('userrole');?>')" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal Specimen Collection-->
|
||||||
|
<div class="modal fade" id="detailModal" aria-hidden="true" aria-labelledby="detailModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fw-bold fs-4" id="detailModal">Specimen Collection</h1>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="specimenModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="validateModal" aria-hidden="true" aria-labelledby="validateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="validateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="unvalidateModal" aria-hidden="true" aria-labelledby="unvalidateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="unvalidateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('script') ?>
|
<?= $this->section('script') ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
table = $('#datatables').DataTable({
|
||||||
|
layout: {
|
||||||
|
topEnd: 'search',
|
||||||
|
bottomStart: null, bottomEnd: null
|
||||||
|
},
|
||||||
|
order: [[0, 'asc'], [3, 'asc']],
|
||||||
|
paging: false,
|
||||||
|
scrollCollapse: true,
|
||||||
|
scrollY: '70vh',
|
||||||
|
columnDefs: [{
|
||||||
|
className: 'text-center',
|
||||||
|
targets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}, // semua kolom di tengah
|
||||||
|
{
|
||||||
|
className: 'text-start',
|
||||||
|
targets: [10]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
responsive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filterGroup .btn').on('click', function () {
|
||||||
|
$('#filterGroup .btn').each(function () {
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-${type}`).addClass(`btn-outline-${type}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-outline-${type}`).addClass(`btn-${type}`);
|
||||||
|
let vals;
|
||||||
|
if(type=='secondary') { vals = [0]; }
|
||||||
|
if(type=='info') { vals = ['1','2']; }
|
||||||
|
if(type=='primary') { vals = ['3','4','5']; }
|
||||||
|
if(type=='warning') { vals = [6,7]; }
|
||||||
|
if(type=='success') { vals = [8]; }
|
||||||
|
if(type=='dark') {vals=[];}
|
||||||
|
regex = vals.join('|');
|
||||||
|
table.column(0).search(regex, true, false).draw();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Select the column by index (1) and apply a search that excludes "Test"
|
||||||
|
// The regex: ^((?!Test).)*$
|
||||||
|
// - ^...$ anchors the start and end
|
||||||
|
// - (?!Test) is a negative lookahead, failing the match if "Test" is found
|
||||||
|
function filterVal(userid) {
|
||||||
|
var currentSearch = table.column(9).search();
|
||||||
|
if (currentSearch.includes(userid)) {
|
||||||
|
table.column(9).search( '' ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-primary`).addClass(`btn-outline-primary`);
|
||||||
|
} else {
|
||||||
|
table.column(9).search( `^((?!${userid}).)*$`, true, false ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-outline-primary`).addClass(`btn-primary`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unvalidate(accessnumber,userid) {
|
||||||
|
if(confirm("Are you sure?")) {
|
||||||
|
fetch(`${BASE_URL}/api/request/validate/${accessnumber}`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {"Content-Type": "application/json"},
|
||||||
|
body: JSON.stringify({ userid:`${userid}` })
|
||||||
|
}).then(response => {
|
||||||
|
console.log("Response:", response);
|
||||||
|
$(`#val1user-${accessnumber}`).text("1 : ");
|
||||||
|
$(`#val2user-${accessnumber}`).text("2 : ");
|
||||||
|
$(`#valBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
$(`#unvalBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
}).catch(error => {
|
||||||
|
console.log("Error:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const BASE_URL = "<?= base_url(); ?>";
|
||||||
|
</script>
|
||||||
|
<script src="<?=base_url('js/admin/specimen.js');?>"></script>
|
||||||
|
<script src="<?=base_url('js/admin/request.js');?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
40
app/Views/cs/modal_request.php
Normal file
40
app/Views/cs/modal_request.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class="col">val : <?=$val1user;?> - <?=$val2user;?></div>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button>
|
||||||
|
<!-- <button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mx-auto">
|
||||||
|
<iframe id="result-iframe" src="http://glenlis/spooler_db/main_dev.php?acc=<?=$accessnumber;?>" width="750px" height="600px"> -->
|
||||||
|
<!-- <iframe id="result-iframe" src="<?=base_url('dummypage');?>" width="750px" height="600px"> -->
|
||||||
|
|
||||||
|
<p>Your browser does not support iframes. Please contact the technical support.</p>
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
{
|
||||||
|
// verifymodal
|
||||||
|
let iframe = document.getElementById('result-iframe');
|
||||||
|
let button = document.getElementById('result-button');
|
||||||
|
|
||||||
|
iframe.addEventListener('load', () => {
|
||||||
|
//console.log('loaded');
|
||||||
|
let iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||||
|
let scrollElement = iframeDoc.scrollingElement || iframeDoc.documentElement;
|
||||||
|
|
||||||
|
iframeDoc.addEventListener('scroll', () => {
|
||||||
|
let scrollTop = scrollElement.scrollTop;
|
||||||
|
let scrollHeight = scrollElement.scrollHeight;
|
||||||
|
let clientHeight = scrollElement.clientHeight;
|
||||||
|
|
||||||
|
// Check if scrolled to bottom
|
||||||
|
if (scrollTop + clientHeight >= scrollHeight - 2) {
|
||||||
|
button.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
106
app/Views/cs/modal_specimen.php
Normal file
106
app/Views/cs/modal_specimen.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<div class="row mb-4 p-3">
|
||||||
|
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Patient</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.name}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Age</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.age}} years</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Gender</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.gender}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">Lab#</div>
|
||||||
|
<div class="info-value">: {{accessnumber}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">MR#</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.rm}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">KTP</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.ktp}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title fs-4 mb-2">
|
||||||
|
<i class="bi bi-flask-florence-fill"></i> Tube
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<table class="table fs-6 text-start table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Sample Code</th>
|
||||||
|
<th>Sample Name</th>
|
||||||
|
<th class='text-center'>Collected</th>
|
||||||
|
<th class='text-center'>Received</th>
|
||||||
|
<th>Action</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>Collection</td> <td></td> <td></td>
|
||||||
|
<td><button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>All</td> <td></td> <td></td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick=""><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{#samples}}
|
||||||
|
<tr id='row-{{accessnumber}}-{{sampcode}}'>
|
||||||
|
<td>{{sampcode}}</td>
|
||||||
|
<td>{{name}}</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input coll-checkbox"
|
||||||
|
{{#is_coll}}checked{{/is_coll}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input recv-checkbox"
|
||||||
|
{{#is_recv}}checked{{/is_recv}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 1)"><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 0)"><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="unreceive({{accessnumber}}, {{sampcode}})"><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/samples}}
|
||||||
|
|
||||||
|
<tr class="text-center">
|
||||||
|
<td colspan="6">
|
||||||
|
<h6 class="p-0 m-0">
|
||||||
|
<i class="bi bi-pencil-square" role="button" onclick="commentValue()"></i>
|
||||||
|
</h6>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
16
app/Views/cs/modal_unvalidate.php
Normal file
16
app/Views/cs/modal_unvalidate.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<form id='unValForm'>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<h4>Unvalidate <?=$accessnumber;?></h4>
|
||||||
|
</div>
|
||||||
|
<div class="row m-2">
|
||||||
|
<input type='hidden' name='accessnumber' value='<?=$accessnumber;?>'>
|
||||||
|
<input type='hidden' name='userid' value='<?=session('userid');?>'>
|
||||||
|
<textarea class='form-control' name='comment' placeholder="Note ..." rows='5'></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button class='btn btn-xs btn-warning' onclick="event.preventDefault();unvalidateRequest('unValForm', <?=$accessnumber;?>);">Un-Validate</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@ -1,172 +1,285 @@
|
|||||||
<?php
|
|
||||||
$today = date('Y-m-d');
|
|
||||||
$date1 = $_GET['date1'] ?? $today;
|
|
||||||
$date2 = $_GET['date2'] ?? $today;
|
|
||||||
?>
|
|
||||||
<?= $this->extend('_layouts/main.php') ?>
|
<?= $this->extend('_layouts/main.php') ?>
|
||||||
|
|
||||||
<?= $this->section('title') ?>
|
<?= $this->section('title') ?>
|
||||||
<title>Doctor Glenlis</title>
|
<title>Doctor Glenlis</title>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
|
<div class="container-fluid px-3">
|
||||||
<div class="container-fluid px-5">
|
<div class='row p-1'>
|
||||||
<div class="row">
|
<div class='col fw-bold'>Dashboard, <?=session('userrole');?></div>
|
||||||
<div class="col mt-3">
|
<div class='col text-end'>
|
||||||
<div class="accordion" id="accordionPanelsStayOpenExample">
|
Hi, <?=session('userid');?>
|
||||||
<div class="accordion-item">
|
<button class="btn btn-sm btn-secondary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-list"></i></button>
|
||||||
<h2 class="accordion-header">
|
<div class="dropdown">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOne" aria-expanded="false" aria-controls="panelsStayOpen-collapseOne">
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||||
🔎 Search Form
|
<li><a class="dropdown-item" href="<?=base_url('doctor/');?>">Dashboard</a></li>
|
||||||
</button>
|
<li><a class="dropdown-item" href="<?=base_url('');?>">Report</a></li>
|
||||||
</h2>
|
<li><a class="dropdown-item" href="<?=base_url('logout');?>">Log Out</a></li>
|
||||||
<div id="panelsStayOpen-collapseOne" class="accordion-collapse collapse show">
|
</ul>
|
||||||
<div class="accordion-body">
|
</div>
|
||||||
<form method="GET" class="p-1" action='<?= base_url('api/dashboard') ?>'>
|
|
||||||
<div class="row align-items-center g-2">
|
|
||||||
<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 px-3">LIST</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-auto">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-sm btn-outline-dark px-3"
|
|
||||||
onclick="window.location.href='/';"
|
|
||||||
>
|
|
||||||
RESET
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="accordion-item">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseTwo" aria-expanded="false" aria-controls="panelsStayOpen-collapseTwo">
|
|
||||||
☰ Filter Form
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
<div id="panelsStayOpen-collapseTwo" class="accordion-collapse collapse">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<form class="p-1">
|
|
||||||
|
|
||||||
<!-- Baris 1: Name & Reff -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Name :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col2_filter" data-column="2" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Reff :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col5_filter" data-column="5" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 2: Test & Doctor -->
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Test :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col7_filter" data-column="7" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Doctor :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col6_filter" data-column="6" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 3: Exc & Send To -->
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-md-6 d-flex align-items-center mb-2 mb-md-0">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Exc :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="exc" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 d-flex align-items-center">
|
|
||||||
<label class="col-3 col-form-label-sm text-muted fw-semibold">Send to :</label>
|
|
||||||
<input type="text" class="form-control form-control-sm" id="col8_filter" data-column="8" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Baris 4: Stat -->
|
|
||||||
<div class="row ">
|
|
||||||
<div class="col d-flex flex-wrap align-items-center">
|
|
||||||
<label class="col-auto col-form-label-sm text-muted fw-semibold me-2">Stat :</label>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="1" id="pending" />
|
|
||||||
<label class="form-check-label small" for="pending">Pending</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="2" id="partialCollected" />
|
|
||||||
<label class="form-check-label small" for="partialCollected">Partial Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="3" id="collected" />
|
|
||||||
<label class="form-check-label small" for="collected">Collected</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="4" id="partialReceived" />
|
|
||||||
<label class="form-check-label small" for="partialReceived">Partial Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="5" id="received" />
|
|
||||||
<label class="form-check-label small" for="received">Received</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="6" id="incomplete" />
|
|
||||||
<label class="form-check-label small" for="incomplete">Incomplete</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="7" id="pendingVerified" />
|
|
||||||
<label class="form-check-label small" for="pendingVerified">Pending (Verified)</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="8" id="final" />
|
|
||||||
<label class="form-check-label small" for="final">Final</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check form-check-inline">
|
|
||||||
<input class="form-check-input" type="checkbox" name="excStat" value="9" id="finalVerified" />
|
|
||||||
<label class="form-check-label small" for="finalVerified">Final (Verified)</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class='col'>
|
||||||
|
<form method="GET" action='<?= base_url('/doctor') ?>'>
|
||||||
|
<div class="row align-items-center g-1">
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="filterGroup" class="col text-end">
|
||||||
|
<button class='btn btn-sm btn-outline-secondary' data-type='secondary'><?=$counter['pending'];?> <small>Pending</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-info' data-type='info'><?=$counter['collect'];?> <small>Collect</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-primary' data-type='primary'><?=$counter['recv'];?> <small>Receive</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-warning' data-type='warning'><?=$counter['incomplete'];?> <small>Incomplete</small></button>
|
||||||
|
<button class='btn btn-sm btn-outline-success' data-type='success'><?=$counter['complete'];?> <small>Complete</small></button>
|
||||||
|
<button class='btn btn-sm btn-dark' data-type='dark'><?=$counter['total'];?> <small>Total</small></button>
|
||||||
|
</div>
|
||||||
|
<div class="col-1">
|
||||||
|
<button id="filterValBtn" class='btn btn-sm btn-outline-primary' onclick="filterVal('<?=session('userid');?>')"> <small>Validate</small></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table table-responsive-scroll">
|
||||||
|
<table id="datatables" class="table table-sm table-hover table-bordered align-middle table-striped">
|
||||||
|
<thead class="table-primary">
|
||||||
|
<tr>
|
||||||
|
<th style="width:1%;">S</th>
|
||||||
|
<th style='width:7%;'>Order Datetime</th>
|
||||||
|
<th>Patient Name</th>
|
||||||
|
<th style='width:7%;'>No Lab</th>
|
||||||
|
<th style='width:7%;'>No Register</th>
|
||||||
|
<th style='width:8%;'>Reff</th>
|
||||||
|
<th style='width:8%;'>Doctor</th>
|
||||||
|
<th style='width:15%;'>Tests</th>
|
||||||
|
<th style='width:5%;'>Result To</th>
|
||||||
|
<th style='width:5%;'>Validation</th>
|
||||||
|
<th style='width:4%;'>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach($dataList as $row) : ?>
|
||||||
|
<?php
|
||||||
|
switch ($row['statscode']) {
|
||||||
|
case 1: $class = 'BackPend'; break;
|
||||||
|
case 2: $class = 'PartColl'; break;
|
||||||
|
case 3: $class = 'Collected'; break;
|
||||||
|
case 4: $class = 'PartRecv'; break;
|
||||||
|
case 5: $class = 'Received'; break;
|
||||||
|
case 6: $class = 'Incomplete'; break;
|
||||||
|
case 7: $class = 'Final'; break;
|
||||||
|
case 8: $class = 'FinVerification'; break;
|
||||||
|
case 9: $class = 'PenVerification'; break;
|
||||||
|
default: $class = ''; break;
|
||||||
|
}
|
||||||
|
$tests = esc($row['tests']);
|
||||||
|
$tests = str_replace(",", ", ", $tests);
|
||||||
|
$accessnumber = $row['sp_accessnumber'];
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<!--
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['statscode']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reqdate']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['sp_accessnumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['hostordernumber']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['doc']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['tests']) ?> </td>
|
||||||
|
<td class="pointercol" data-access="<?= $row['sp_accessnumber'] ?>" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['odr_cresult_to']) ?> </td>
|
||||||
|
-->
|
||||||
|
<td> <?= esc($row['statscode']) ?> </td> <td> <?= esc($row['reqdate']) ?> </td> <td> <?= esc($row['patname']) ?> </td>
|
||||||
|
<td> <?= esc($row['sp_accessnumber']) ?> </td> <td> <?= esc($row['hostordernumber']) ?> </td> <td> <?= esc($row['reff']) ?> </td>
|
||||||
|
<td> <?= esc($row['doc']) ?> </td> <td> <?= $tests; ?> </td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?= esc($row['odr_cresult_to']) ?> <br/>
|
||||||
|
<?php if($row['valcounter'] == 2) { ?>
|
||||||
|
<input type="checkbox" name="printed"> Printed <br/>
|
||||||
|
<input type="checkbox" name="eng"> Eng
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="text-center">
|
||||||
|
<table class='mx-auto'>
|
||||||
|
<tr>
|
||||||
|
<td id='val1user-<?=$accessnumber;?>'>1 : <?=$row['val1user'];?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td id='val2user-<?=$accessnumber;?>'>2 : <?=$row['val2user'];?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php if($row['isvaltd'] != 0) { ?>
|
||||||
|
<?php
|
||||||
|
$user = session()->get('userid');
|
||||||
|
$val1 = $row['val1user'];
|
||||||
|
$val2 = $row['val2user'];
|
||||||
|
|
||||||
|
$valButton = (($val1 === '-') || ($val2 === '-')) && ($user !== $val1 && $user !== $val2);
|
||||||
|
$unvalButton = ($val1 !== '-') || ($val2 !== '-');
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td id="btnContainer-<?=$accessnumber;?>">
|
||||||
|
<?php if ($unvalButton): ?>
|
||||||
|
<button id='unvalBtn-<?=$accessnumber;?>' class='btn btn-xs btn-outline-secondary px-1 py-0 mb-1' onclick="unvalidateShow(<?=$row['sp_accessnumber'];?>)" data-bs-toggle="modal" data-bs-target="#unvalidateModal"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($valButton): ?>
|
||||||
|
<button id='valBtn-<?= $accessnumber; ?>' class='btn btn-xs btn-outline-success px-1 py-0 mb-1' onclick="validateShow(<?= $row['sp_accessnumber']; ?>)" data-bs-toggle="modal" data-bs-target="#validateModal"> <i class="bi bi-check-lg"></i></button>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="pointercol <?= esc($class) ?>" data-access="<?= $row['sp_accessnumber'] ?>" onclick="detailShow('<?=session('userrole');?>')" data-bs-toggle="modal" data-bs-target="#detailModal"> <?= esc($row['stats']) ?> </td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal Specimen Collection-->
|
||||||
|
<div class="modal fade" id="detailModal" aria-hidden="true" aria-labelledby="detailModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fw-bold fs-4" id="detailModal">Specimen Collection</h1>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="specimenModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="validateModal" aria-hidden="true" aria-labelledby="validateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="validateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="unvalidateModal" aria-hidden="true" aria-labelledby="unvalidateModal" tabindex="-1">
|
||||||
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body" id="unvalidateModalContent"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('script') ?>
|
<?= $this->section('script') ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
table = $('#datatables').DataTable({
|
||||||
|
layout: {
|
||||||
|
topEnd: 'search',
|
||||||
|
bottomStart: null, bottomEnd: null
|
||||||
|
},
|
||||||
|
order: [[0, 'asc'], [3, 'asc']],
|
||||||
|
paging: false,
|
||||||
|
scrollCollapse: true,
|
||||||
|
scrollY: '70vh',
|
||||||
|
columnDefs: [{
|
||||||
|
className: 'text-center',
|
||||||
|
targets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}, // semua kolom di tengah
|
||||||
|
{
|
||||||
|
className: 'text-start',
|
||||||
|
targets: [10]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
responsive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filterGroup .btn').on('click', function () {
|
||||||
|
$('#filterGroup .btn').each(function () {
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-${type}`).addClass(`btn-outline-${type}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const type = $(this).data('type');
|
||||||
|
$(this).removeClass(`btn-outline-${type}`).addClass(`btn-${type}`);
|
||||||
|
let vals;
|
||||||
|
if(type=='secondary') { vals = [0]; }
|
||||||
|
if(type=='info') { vals = ['1','2']; }
|
||||||
|
if(type=='primary') { vals = ['3','4','5']; }
|
||||||
|
if(type=='warning') { vals = [6,7]; }
|
||||||
|
if(type=='success') { vals = [8]; }
|
||||||
|
if(type=='dark') {vals=[];}
|
||||||
|
regex = vals.join('|');
|
||||||
|
table.column(0).search(regex, true, false).draw();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Select the column by index (1) and apply a search that excludes "Test"
|
||||||
|
// The regex: ^((?!Test).)*$
|
||||||
|
// - ^...$ anchors the start and end
|
||||||
|
// - (?!Test) is a negative lookahead, failing the match if "Test" is found
|
||||||
|
function filterVal(userid) {
|
||||||
|
var currentSearch = table.column(9).search();
|
||||||
|
if (currentSearch.includes(userid)) {
|
||||||
|
table.column(9).search( '' ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-primary`).addClass(`btn-outline-primary`);
|
||||||
|
} else {
|
||||||
|
table.column(9).search( `^((?!${userid}).)*$`, true, false ).draw();
|
||||||
|
$("#filterValBtn").removeClass(`btn-outline-primary`).addClass(`btn-primary`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unvalidate(accessnumber,userid) {
|
||||||
|
if(confirm("Are you sure?")) {
|
||||||
|
fetch(`${BASE_URL}/api/request/validate/${accessnumber}`, {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {"Content-Type": "application/json"},
|
||||||
|
body: JSON.stringify({ userid:`${userid}` })
|
||||||
|
}).then(response => {
|
||||||
|
console.log("Response:", response);
|
||||||
|
$(`#val1user-${accessnumber}`).text("1 : ");
|
||||||
|
$(`#val2user-${accessnumber}`).text("2 : ");
|
||||||
|
$(`#valBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
$(`#unvalBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
}).catch(error => {
|
||||||
|
console.log("Error:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const BASE_URL = "<?= base_url(); ?>";
|
||||||
|
</script>
|
||||||
|
<script src="<?=base_url('js/admin/specimen.js');?>"></script>
|
||||||
|
<script src="<?=base_url('js/admin/request.js');?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
40
app/Views/doctor/modal_request.php
Normal file
40
app/Views/doctor/modal_request.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class="col">val : <?=$val1user;?> - <?=$val2user;?></div>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button>
|
||||||
|
<!-- <button id='result-button' class='btn btn-xs btn-success' onclick='validate(<?=$accessnumber;?>, "<?=session('userid');?>" )' disabled>Verify</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mx-auto">
|
||||||
|
<iframe id="result-iframe" src="http://glenlis/spooler_db/main_dev.php?acc=<?=$accessnumber;?>" width="750px" height="600px"> -->
|
||||||
|
<!-- <iframe id="result-iframe" src="<?=base_url('dummypage');?>" width="750px" height="600px"> -->
|
||||||
|
|
||||||
|
<p>Your browser does not support iframes. Please contact the technical support.</p>
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
{
|
||||||
|
// verifymodal
|
||||||
|
let iframe = document.getElementById('result-iframe');
|
||||||
|
let button = document.getElementById('result-button');
|
||||||
|
|
||||||
|
iframe.addEventListener('load', () => {
|
||||||
|
//console.log('loaded');
|
||||||
|
let iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
||||||
|
let scrollElement = iframeDoc.scrollingElement || iframeDoc.documentElement;
|
||||||
|
|
||||||
|
iframeDoc.addEventListener('scroll', () => {
|
||||||
|
let scrollTop = scrollElement.scrollTop;
|
||||||
|
let scrollHeight = scrollElement.scrollHeight;
|
||||||
|
let clientHeight = scrollElement.clientHeight;
|
||||||
|
|
||||||
|
// Check if scrolled to bottom
|
||||||
|
if (scrollTop + clientHeight >= scrollHeight - 2) {
|
||||||
|
button.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
106
app/Views/doctor/modal_specimen.php
Normal file
106
app/Views/doctor/modal_specimen.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<div class="row mb-4 p-3">
|
||||||
|
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Patient</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.name}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Age</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.age}} years</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-25 fw-bold">Gender</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.gender}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">Lab#</div>
|
||||||
|
<div class="info-value">: {{accessnumber}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">MR#</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.rm}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="info-pair d-flex">
|
||||||
|
<div class="info-label w-50 fw-bold">KTP</div>
|
||||||
|
<div class="info-value">: {{patientIdentity.ktp}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title fs-4 mb-2">
|
||||||
|
<i class="bi bi-flask-florence-fill"></i> Tube
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<table class="table fs-6 text-start table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Sample Code</th>
|
||||||
|
<th>Sample Name</th>
|
||||||
|
<th class='text-center'>Collected</th>
|
||||||
|
<th class='text-center'>Received</th>
|
||||||
|
<th>Action</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>Collection</td> <td></td> <td></td>
|
||||||
|
<td><button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td> <td>All</td> <td></td> <td></td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick=""><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick=""><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{#samples}}
|
||||||
|
<tr id='row-{{accessnumber}}-{{sampcode}}'>
|
||||||
|
<td>{{sampcode}}</td>
|
||||||
|
<td>{{name}}</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input coll-checkbox"
|
||||||
|
{{#is_coll}}checked{{/is_coll}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td class='text-center'>
|
||||||
|
<input type="checkbox" class="form-check-input recv-checkbox"
|
||||||
|
{{#is_recv}}checked{{/is_recv}}
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-sm btn-secondary px-2 py-1"><i class="bi bi-printer"></i></button>
|
||||||
|
<button class="btn btn-success px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 1)"><h6 class="p-0 m-0">Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="collect({{accessnumber}}, {{sampcode}}, 0)"><h6 class="p-0 m-0">Un-Coll.</h6></button>
|
||||||
|
<button class="btn btn-warning px-2 py-1" onclick="unreceive({{accessnumber}}, {{sampcode}})"><h6 class="p-0 m-0">Un-Recv.</h6></button>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{/samples}}
|
||||||
|
|
||||||
|
<tr class="text-center">
|
||||||
|
<td colspan="6">
|
||||||
|
<h6 class="p-0 m-0">
|
||||||
|
<i class="bi bi-pencil-square" role="button" onclick="commentValue()"></i>
|
||||||
|
</h6>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
16
app/Views/doctor/modal_unvalidate.php
Normal file
16
app/Views/doctor/modal_unvalidate.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<form id='unValForm'>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<h4>Unvalidate <?=$accessnumber;?></h4>
|
||||||
|
</div>
|
||||||
|
<div class="row m-2">
|
||||||
|
<input type='hidden' name='accessnumber' value='<?=$accessnumber;?>'>
|
||||||
|
<input type='hidden' name='userid' value='<?=session('userid');?>'>
|
||||||
|
<textarea class='form-control' name='comment' placeholder="Note ..." rows='5'></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='row mb-2 mx-2'>
|
||||||
|
<div class='col text-end'>
|
||||||
|
<button class='btn btn-xs btn-warning' onclick="event.preventDefault();unvalidateRequest('unValForm', <?=$accessnumber;?>);">Un-Validate</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@ -75,7 +75,22 @@
|
|||||||
console.log("Success Response:", data);
|
console.log("Success Response:", data);
|
||||||
$(`#val1user-${accessnumber}`).text("1 : ");
|
$(`#val1user-${accessnumber}`).text("1 : ");
|
||||||
$(`#val2user-${accessnumber}`).text("2 : ");
|
$(`#val2user-${accessnumber}`).text("2 : ");
|
||||||
$(`#valBtn-${accessnumber}`).prop('disabled', false);
|
|
||||||
|
// ganti tombol UNVALIDATE -> VALIDATE
|
||||||
|
$(`#btnContainer-${accessnumber}`).html(`
|
||||||
|
<button id="valBtn-${accessnumber}"
|
||||||
|
class="btn btn-xs btn-outline-success px-1 py-0 mb-1"
|
||||||
|
onclick="validateShow(${accessnumber})"
|
||||||
|
data-bs-toggle="modal"
|
||||||
|
data-bs-target="#validateModal">
|
||||||
|
<i class="bi bi-check-lg"></i>
|
||||||
|
</button>
|
||||||
|
`);
|
||||||
|
|
||||||
|
// $(`#unvalBtn-${accessnumber}`).hide();
|
||||||
|
// $(`#valBtn-${accessnumber}`).prop('disabled', false);
|
||||||
|
// $(`#valBtn-${accessnumber}`).remove();
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error("Fetch Error:", error);
|
console.error("Fetch Error:", error);
|
||||||
@ -94,7 +109,29 @@
|
|||||||
body: JSON.stringify({ userid:`${userid}` })
|
body: JSON.stringify({ userid:`${userid}` })
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
$(`#validateModal`).modal('hide');
|
$(`#validateModal`).modal('hide');
|
||||||
$(`#valBtn-${accessnumber}`).prop('disabled', true);
|
// $(`#valBtn-${accessnumber}`).prop('disabled', true);
|
||||||
|
// $(`#valBtn-${accessnumber}`).hide();
|
||||||
|
|
||||||
|
// $(`#unvalBtn-${accessnumber}`).after(`
|
||||||
|
// <button id="unvalBtn-${accessnumber}"
|
||||||
|
// class="btn btn-xs btn-outline-secondary px-1 py-0 mb-1"
|
||||||
|
// onclick="unvalidateShow(${accessnumber})"
|
||||||
|
// data-bs-toggle="modal"
|
||||||
|
// data-bs-target="#unvalidateModal">
|
||||||
|
// <i class="bi bi-arrow-counterclockwise"></i>
|
||||||
|
// </button>
|
||||||
|
// `);
|
||||||
|
// ganti tombol val → unval
|
||||||
|
$(`#btnContainer-${accessnumber}`).html(`
|
||||||
|
<button id="unvalBtn-${accessnumber}"
|
||||||
|
class="btn btn-xs btn-outline-secondary px-1 py-0 mb-1"
|
||||||
|
onclick="unvalidateShow(${accessnumber})"
|
||||||
|
data-bs-toggle="modal"
|
||||||
|
data-bs-target="#unvalidateModal">
|
||||||
|
<i class="bi bi-arrow-counterclockwise"></i>
|
||||||
|
</button>
|
||||||
|
`);
|
||||||
|
|
||||||
response.json().then(data => {
|
response.json().then(data => {
|
||||||
console.log("Success:", data);
|
console.log("Success:", data);
|
||||||
if(data.val === 1){ $(`#val1user-${accessnumber}`).text("1 : "+data.userid || '1 :'); }
|
if(data.val === 1){ $(`#val1user-${accessnumber}`).text("1 : "+data.userid || '1 :'); }
|
||||||
|
|||||||
@ -47,7 +47,7 @@ function commentValue() {
|
|||||||
const input = prompt("Masukkan Komentar :");
|
const input = prompt("Masukkan Komentar :");
|
||||||
}
|
}
|
||||||
|
|
||||||
function detailShow() {
|
function detailShow(userrole) {
|
||||||
{
|
{
|
||||||
const modal = document.getElementById('detailModal');
|
const modal = document.getElementById('detailModal');
|
||||||
const modalContent = document.getElementById('specimenModalContent');
|
const modalContent = document.getElementById('specimenModalContent');
|
||||||
@ -58,7 +58,7 @@ function detailShow() {
|
|||||||
"<p class='text-center text-muted'>Loading data...</p>";
|
"<p class='text-center text-muted'>Loading data...</p>";
|
||||||
try {
|
try {
|
||||||
$.getJSON(`${BASE_URL}/api/specimen/${access}`, function(data) {
|
$.getJSON(`${BASE_URL}/api/specimen/${access}`, function(data) {
|
||||||
$.get(`${BASE_URL}/admin/modal_specimen`, function(tpl) {
|
$.get(`${BASE_URL}/${userrole}/modal_specimen`, function(tpl) {
|
||||||
data.samples = data.samples.map(s => ({
|
data.samples = data.samples.map(s => ({
|
||||||
...s,
|
...s,
|
||||||
is_coll: s.colstatus == 1,
|
is_coll: s.colstatus == 1,
|
||||||
@ -75,4 +75,4 @@ function detailShow() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user