update mayor agar user analis bisa membuat order dan print sby - bali berbeda

This commit is contained in:
mikael-zakaria 2025-01-09 22:14:52 +07:00
parent 60c6356e5a
commit 4ca00844ff
13 changed files with 241 additions and 174 deletions

View File

@ -103,6 +103,11 @@ $routes->group('admin', ['filter' => 'role:admin'], static function ($routes) {
$routes->group('user', ['filter' => 'role:user'], static function ($routes) { $routes->group('user', ['filter' => 'role:user'], static function ($routes) {
$routes->get('', 'UserController::index'); $routes->get('', 'UserController::index');
$routes->get('dashboard/viewAccess/(:any)', 'UserController::viewAccess/$1'); $routes->get('dashboard/viewAccess/(:any)', 'UserController::viewAccess/$1');
$routes->get('orders/', 'UserController::orders_index');
$routes->get('orders/create/', 'UserController::orders_edit/0');
$routes->get('orders/edit/(:any)', 'UserController::orders_edit/$1');
$routes->get('patients/', 'UserController::patients_index');
}); });
// sampling // sampling

View File

@ -9,6 +9,10 @@ class AdminController extends BaseController {
} }
public function viewAccess($accessnumber): string { public function viewAccess($accessnumber): string {
// Mengetahui Apakah User Bali atau Surabaya
$data['usercityid'] = session()->get('usercityid');
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu $sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu
left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER

View File

@ -9,6 +9,10 @@ class FoController extends BaseController {
} }
public function viewAccess($accessnumber): string { public function viewAccess($accessnumber): string {
// Mengetahui Apakah User Bali atau Surabaya
$data['usercityid'] = session()->get('usercityid');
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu $sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu
left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
@ -43,7 +47,7 @@ class FoController extends BaseController {
$data['accessnumber'] = $accessnumber; $data['accessnumber'] = $accessnumber;
return view('admin/dashboard_viewAccess', $data); return view('fo/dashboard_viewAccess', $data);
} }
public function changePass() { public function changePass() {

View File

@ -77,24 +77,7 @@ class PrintLabelSby extends BaseController {
$jarak = '53'; $jarak = '53';
} }
// $label = "N $label = "^XA
// OD
// q400
// Q200,10+0
// I8,A,001
// D10
// A4,3,0,2,1,1,N,\"$title.$name1\"
// A$jarak,20,0,2,1,1,N,\"$name2\"
// A325,25,0,2,1,1,N,\"$sex {$age}Y\"
// B15,50,0,1,4,8,70,N,\"$access\"
// A120,125,0,2,1,1,N,\"REQ# $access\"
// A4,164,0,2,1,1,N,\"RM:$uhid\"
// A4,147,0,2,1,1,N,\"VN:$bv\"
// A195,164,0,2,1,1,N,\"$collectiondate\"
// P1
// ";
$label = "^XA
^LH0,0 ^LH0,0
^LL400 ^LL400
^PW400 ^PW400
@ -149,26 +132,6 @@ $label = "^XA
$jarak = '53'; $jarak = '53';
} }
// Printer Posteck
// $sampleLabel ="N
// OD
// q400
// Q200,10+0
// I8,A,001
// D10
// A4,3,0,2,1,1,N,\"$title.$name1\"
// A$jarak,20,0,2,1,1,N,\"$name2\"
// A325,25,0,2,1,1,N,\"$sex {$age}Y\"
// A4,47,0,2,1,1,N,\"$sample\"
// A265,47,0,2,1,1,N,\"Chapter\"
// B37,68,0,1,4,8,70,N,\"$barcode\"
// A115,143,0,2,1,1,N,\"SAM# $barcode\"
// A4,165,0,2,1,1,N,\"RM:$uhid\"
// A195,165,0,2,1,1,N,\"$collection_date\"
// P1
// ";
$sampleLabel = "^XA $sampleLabel = "^XA
^LH0,0 ^LH0,0
^LL400 ^LL400
@ -184,7 +147,6 @@ $label = "^XA
^FO195,182^ADN,18,10^FD$collection_date^FS ^FO195,182^ADN,18,10^FD$collection_date^FS
^XZ ^XZ
"; ";
return $sampleLabel; return $sampleLabel;
} }

View File

@ -9,6 +9,10 @@ class SamplingController extends BaseController {
} }
public function viewAccess($accessnumber): string { public function viewAccess($accessnumber): string {
// Mengetahui Apakah User Bali atau Surabaya
$data['usercityid'] = session()->get('usercityid');
$db = \Config\Database::connect(); $db = \Config\Database::connect();
$sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu $sql = "select sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS, ct.TUBECOMMENT from SP_TUBES tu
left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER
@ -43,7 +47,7 @@ class SamplingController extends BaseController {
$data['accessnumber'] = $accessnumber; $data['accessnumber'] = $accessnumber;
return view('admin/dashboard_viewAccess', $data); return view('sampling/dashboard_viewAccess', $data);
} }
public function changePass() { public function changePass() {

View File

@ -49,6 +49,24 @@ class UserController extends BaseController {
return view('user/dashboard_viewAccess', $data); return view('user/dashboard_viewAccess', $data);
} }
public function orders_index() {
return view('orders_index');
}
public function orders_edit($orderid) {
$db = \Config\Database::connect();
$sql = "select * from cmod.dbo.CM_DICT_MAPPINGS";
$query = $db->query($sql);
$results = $query->getResultArray();
$data['tests'] = $results;
$data['orderid'] = $orderid;
return view('orders_edit', $data);
}
public function patients_index() {
return view('patients_index');
}
public function changePass() { public function changePass() {
if ($this->request->getMethod() === 'POST') { if ($this->request->getMethod() === 'POST') {

View File

@ -1,4 +1,5 @@
<?php <?php
if(isset($data[0])) { if(isset($data[0])) {
$row = $data[0]; $row = $data[0];
@ -59,7 +60,7 @@ if(isset($data[0])) {
<tr> <tr>
<td></td> <td></td> <td>All</td> <td></td> <td></td> <td>All</td>
<td> <td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button> <button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button>
<!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> --> <!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> -->
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -67,7 +68,7 @@ if(isset($data[0])) {
</tr> </tr>
<tr> <tr>
<td></td> <td></td> <td>Collection</td> <td></td> <td></td> <td>Collection</td>
<td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td> <td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td>
</tr> </tr>
<?php <?php
@ -95,7 +96,7 @@ if(isset($data[0])) {
} }
echo "<td>$sampletext ($sampletype)</td>"; echo "<td>$sampletext ($sampletype)</td>";
echo "<td> echo "<td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button> <button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype, $usercityid)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button>
<button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button> <button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button>
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -112,8 +113,44 @@ if(isset($data[0])) {
</div> </div>
</div> </div>
<script> <script>
function printCollectionLabel(access){ function printCollectionLabel(access, usercityid){
const url = '<?=base_url();?>printLabel/collection/'+access.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/collection/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/collection/'+access.toString();
}
console.log(url);
fetch(url)
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printSingleLabel(access, sample, usercityid) {
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/single/'+access.toString()+'/'+sample.toString();
} else {
url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
}
console.log(url);
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
@ -132,28 +169,16 @@ function printCollectionLabel(access){
console.error('Error:', error); console.error('Error:', error);
}); });
} }
function printSingleLabel(access, sample) { function printAllLabel(access, usercityid) {
const url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/all/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/all/'+access.toString();
}
fetch(url) console.log(url);
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printAllLabel(access) {
const url = '<?=base_url();?>printLabel/all/'+access.toString();
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())

View File

@ -1,4 +1,5 @@
<?php <?php
if(isset($data[0])) { if(isset($data[0])) {
$row = $data[0]; $row = $data[0];
@ -59,7 +60,7 @@ if(isset($data[0])) {
<tr> <tr>
<td></td> <td></td> <td>All</td> <td></td> <td></td> <td>All</td>
<td> <td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button> <button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button>
<!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> --> <!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> -->
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -67,7 +68,7 @@ if(isset($data[0])) {
</tr> </tr>
<tr> <tr>
<td></td> <td></td> <td>Collection</td> <td></td> <td></td> <td>Collection</td>
<td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td> <td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td>
</tr> </tr>
<?php <?php
@ -95,7 +96,7 @@ if(isset($data[0])) {
} }
echo "<td>$sampletext ($sampletype)</td>"; echo "<td>$sampletext ($sampletype)</td>";
echo "<td> echo "<td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button> <button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype, $usercityid)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button>
<button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button> <button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button>
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -112,8 +113,44 @@ if(isset($data[0])) {
</div> </div>
</div> </div>
<script> <script>
function printCollectionLabel(access){ function printCollectionLabel(access, usercityid){
const url = '<?=base_url();?>printLabel/collection/'+access.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/collection/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/collection/'+access.toString();
}
console.log(url);
fetch(url)
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printSingleLabel(access, sample, usercityid) {
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/single/'+access.toString()+'/'+sample.toString();
} else {
url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
}
console.log(url);
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
@ -132,28 +169,16 @@ function printCollectionLabel(access){
console.error('Error:', error); console.error('Error:', error);
}); });
} }
function printSingleLabel(access, sample) { function printAllLabel(access, usercityid) {
const url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/all/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/all/'+access.toString();
}
fetch(url) console.log(url);
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printAllLabel(access) {
const url = '<?=base_url();?>printLabel/all/'+access.toString();
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())

View File

@ -1,4 +1,4 @@
<?= $this->extend('admin/layout/main.php') ?> <?= $this->extend($_SESSION['userrole'].'/layout/main.php') ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<div class="card border-0 m-1"> <div class="card border-0 m-1">

View File

@ -1,4 +1,5 @@
<?php <?php
if(isset($data[0])) { if(isset($data[0])) {
$row = $data[0]; $row = $data[0];
@ -59,7 +60,7 @@ if(isset($data[0])) {
<tr> <tr>
<td></td> <td></td> <td>All</td> <td></td> <td></td> <td>All</td>
<td> <td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button> <button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printAllLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"> <h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6> </button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collectAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Coll.</h6></button>
<!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> --> <!-- <button class='badge bg-black text-white m-0 px-2 py-1' onclick='uncollectAll(<?=$accessnumber;?>)'>un-collect</button> -->
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceiveAll(<?=$accessnumber;?>)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -67,7 +68,7 @@ if(isset($data[0])) {
</tr> </tr>
<tr> <tr>
<td></td> <td></td> <td>Collection</td> <td></td> <td></td> <td>Collection</td>
<td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td> <td><button type='button' class='btn btn-dark m-0 px-2 py-1' onclick="printCollectionLabel(<?=$accessnumber;?>, <?=$usercityid;?>)"><h6 class='p-0 m-0'> <i class='bi bi-printer'></i></h6></button></td>
</tr> </tr>
<?php <?php
@ -95,7 +96,7 @@ if(isset($data[0])) {
} }
echo "<td>$sampletext ($sampletype)</td>"; echo "<td>$sampletext ($sampletype)</td>";
echo "<td> echo "<td>
<button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button> <button type='button' class='btn btn-dark m-0 px-2 py-1' " . "onclick='printSingleLabel($accessnumber, $sampletype, $usercityid)'" . "><h6 class='p-0 m-0'><i class='bi bi-printer'></i></h6></button>
<button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button> <button type='button' class='btn btn-success m-0 px-2 py-1' onclick='collect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Coll.</h6></button>
<button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button> <button type='button' class='btn btn-warning m-0 px-2 py-1' onclick='uncollect($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Coll.</h6></button>
<button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button> <button type='button' class='btn btn-primary m-0 px-2 py-1' onclick='unreceive($sampletype, $accessnumber)'><h6 class='p-0 m-0'>Un-Rec.</h6></button>
@ -112,8 +113,44 @@ if(isset($data[0])) {
</div> </div>
</div> </div>
<script> <script>
function printCollectionLabel(access){ function printCollectionLabel(access, usercityid){
const url = '<?=base_url();?>printLabel/collection/'+access.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/collection/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/collection/'+access.toString();
}
console.log(url);
fetch(url)
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printSingleLabel(access, sample, usercityid) {
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/single/'+access.toString()+'/'+sample.toString();
} else {
url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
}
console.log(url);
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
@ -132,28 +169,16 @@ function printCollectionLabel(access){
console.error('Error:', error); console.error('Error:', error);
}); });
} }
function printSingleLabel(access, sample) { function printAllLabel(access, usercityid) {
const url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
let url;
if (usercityid == 2) {
url = '<?=base_url();?>printLabelSby/all/'+access.toString();
} else {
url = '<?=base_url();?>printLabel/all/'+access.toString();
}
fetch(url) console.log(url);
.then(response => response.json())
.then(data => {
if (data['status']) {
console.log(data['message']);
} else {
console.log(data['message']+"\n"+data['error']);
message = data['message']+"\n"+data['error'];
alert(message);
}
})
.catch(error => {
console.error('Error:', error);
});
}
function printAllLabel(access) {
const url = '<?=base_url();?>printLabel/all/'+access.toString();
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())

View File

@ -150,6 +150,8 @@ function printSingleLabel(access, sample, usercityid) {
url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString(); url = '<?=base_url();?>printLabel/single/'+access.toString()+'/'+sample.toString();
} }
console.log(url);
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
@ -176,6 +178,8 @@ function printAllLabel(access, usercityid) {
url = '<?=base_url();?>printLabel/all/'+access.toString(); url = '<?=base_url();?>printLabel/all/'+access.toString();
} }
console.log(url);
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {

View File

@ -1,56 +1,36 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content=""> <meta name="description" content="" />
<meta name="author" content=""> <meta name="author" content="" />
<link rel="icon" type="image/png" sizes="16x16" href="<?=base_url();?>/assets/favicon.png"> <title>Analis Dashboard</title>
<title>Summit CRM</title> <link rel="stylesheet" href="<?=base_url();?>assets/css/icons/font/bootstrap-icons.min.css">
<link href="<?=base_url();?>/assets/style.css" rel="stylesheet"> <link href="<?=base_url();?>assets/css/styles.css" rel="stylesheet" />
<link href="<?=base_url();?>/assets/select2/select2.min.css" rel="stylesheet"> <link href="<?=base_url();?>assets/select2/select2.min.css" rel="stylesheet" />
<link href="<?=base_url();?>/assets/select2/select2-bootstrap-5-theme.min.css" rel="stylesheet"> <link href="<?=base_url();?>assets/flatpickr/flatpickr.min.css" rel="stylesheet" />
<style> <style>
.select2-results__option { font-size: 0.75rem !important; margin: 5px !important; padding: 5px !important; } .sb-form {
li.select2-selection__choice { background-color : #000 !important; padding:5px !improtant; } min-height:calc(100vh);
.select2 {width:100%!important;} }
</style> </style>
<script src="<?=base_url();?>/assets/jquery/jquery.min.js"></script> </head>
<script src="<?=base_url();?>/assets/select2/select2.min.js"></script>
<?= $this->renderSection('head'); ?> <!-- <body class="sb-nav-fixed sb-sidenav-toggled"> -->
</head> <body class='sb-form'>
<main>
<body class="skin-megna-dark fixed-layout"> <div class="container-fluid px-2 py-2">
<div class="preloader"> <?= $this->renderSection('content'); ?>
<div class="loader">
<div class="loader__figure"></div>
<p class="loader__label">Summit-CRM</p>
</div>
</div>
<div id="main-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card mt-2">
<div class="card-body">
<?= $this->renderSection('content'); ?>
</div>
</div>
</div>
</div> </div>
</div> </main>
</div> <script src="<?=base_url();?>assets/jquery-3.7.1.min.js"></script>
<script src="<?=base_url();?>assets/js/bootstrap.bundle.min.js"></script>
<script src="<?=base_url();?>/assets/bootstrap.bundle.min.js"></script> <script src="<?=base_url();?>assets/datatables/datatables.min.js"></script>
<script src="<?=base_url();?>/assets/perfect-scrollbar.jquery.min.js"></script> <script src="<?=base_url();?>assets/select2/select2.min.js"></script>
<script src="<?=base_url();?>/assets/app.js"></script> <script src="<?=base_url();?>assets/flatpickr/flatpickr.min.js"></script>
<?= $this->renderSection('script'); ?> <script src="<?=base_url();?>assets/js/scripts.js"></script>
<script> <?= $this->renderSection('script'); ?>
$('.select2').select2(); </body>
</script> </html>
</body>
</html>

View File

@ -5,10 +5,21 @@
<div class="sb-sidenav-menu-heading">Main</div> <div class="sb-sidenav-menu-heading">Main</div>
<a class="nav-link" href="<?=base_url();?>user/"><div class="sb-nav-link-icon"><i class="bi bi-speedometer"></i></div>Dashboard</a> <a class="nav-link" href="<?=base_url();?>user/"><div class="sb-nav-link-icon"><i class="bi bi-speedometer"></i></div>Dashboard</a>
<a class="nav-link" href="<?=base_url();?>changePass/"><div class="sb-nav-link-icon"><i class="bi bi-key"></i></div>Change Password</a> <a class="nav-link" href="<?=base_url();?>changePass/"><div class="sb-nav-link-icon"><i class="bi bi-key"></i></div>Change Password</a>
<div class="sb-sidenav-menu-heading">HIS</div>
<a class="nav-link" href="<?=base_url();?>user/patients/"><div class="sb-nav-link-icon"><i class="bi bi-person-fill"></i></div>Patient List</a>
<a class="nav-link" href="<?=base_url();?>user/orders/"><div class="sb-nav-link-icon"><i class="bi bi-clipboard-pulse"></i></div>Order List</a>
<a class="nav-link" href="#" onclick='createOrder()'><div class="sb-nav-link-icon"><i class="bi bi-clipboard-plus"></i></div>Create Order</a>
</div> </div>
</div> </div>
<div class="sb-sidenav-footer"> <div class="sb-sidenav-footer">
<div class="small">Logged in as: <b>Analyst User</b></div> <div class="small">Logged in as: <b>Analyst User</b></div>
</div> </div>
</nav> </nav>
</div> </div>
<script>
function createOrder() {
window.open("<?php echo base_url();echo $_SESSION['userrole']?>/orders/create",
'_blank', "width=1200,height=700,location=no,toolbar=no,menubar=no"
);
}
</script>