diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 2c288ef..ef85c5b 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -24,6 +24,7 @@ $routes->get('/entry/daily', 'PageController::entryDaily', ['filter' => AuthFilt $routes->get('/entry/monthly', 'PageController::entryMonthly', ['filter' => AuthFilter::class]); $routes->get('/report', 'PageController::report', ['filter' => AuthFilter::class]); $routes->get('/report/merged', 'PageController::reportMerged', ['filter' => AuthFilter::class]); +$routes->get('/report/custom1', 'PageController::reportCustom1', ['filter' => AuthFilter::class]); $routes->group('api', ['filter' => AuthFilter::class], function ($routes) { $routes->get('dashboard/recent', 'Api\DashboardApiController::getRecent'); diff --git a/app/Controllers/Api/EntryApiController.php b/app/Controllers/Api/EntryApiController.php index 124e78d..1c43959 100755 --- a/app/Controllers/Api/EntryApiController.php +++ b/app/Controllers/Api/EntryApiController.php @@ -259,8 +259,8 @@ class EntryApiController extends BaseController return $this->failValidationErrors(['test_id' => 'Required', 'month' => 'Required']); } - // Get test details - $test = $this->testModel->find($testId); + // Get test details with department name + $test = $this->testModel->findWithDept($testId); if (!$test) { return $this->failNotFound('Test not found'); } @@ -318,6 +318,7 @@ class EntryApiController extends BaseController 'controlName' => $c['controlName'], 'lot' => $c['lot'], 'producer' => $c['producer'], + 'expDate' => $c['expDate'], 'mean' => $c['mean'], 'sd' => $c['sd'], 'results' => $resultsArray @@ -327,8 +328,11 @@ class EntryApiController extends BaseController $data = [ 'test' => [ 'testId' => $test['testId'], + 'testCode' => $test['testCode'] ?? null, 'testName' => $test['testName'], - 'testUnit' => $test['testUnit'] + 'testUnit' => $test['testUnit'], + 'testMethod' => $test['testMethod'] ?? null, + 'deptName' => $test['deptName'] ?? null ], 'month' => $month, 'controls' => $controlsWithData diff --git a/app/Controllers/PageController.php b/app/Controllers/PageController.php index e6a9058..4494309 100755 --- a/app/Controllers/PageController.php +++ b/app/Controllers/PageController.php @@ -47,7 +47,11 @@ class PageController extends BaseController { return view('report/view'); } - public function reportMerged() { +public function reportMerged() { return view('report/merged'); } + + public function reportCustom1() { + return view('report/custom1'); + } } diff --git a/app/Models/Master/MasterTestsModel.php b/app/Models/Master/MasterTestsModel.php index 487c54b..e8ee87d 100755 --- a/app/Models/Master/MasterTestsModel.php +++ b/app/Models/Master/MasterTestsModel.php @@ -53,4 +53,26 @@ class MasterTestsModel extends BaseModel { return $builder->get()->getResultArray(); } + + + public function findWithDept($testId) { + $builder = $this->builder(); + $builder->select(' + master_tests.test_id as testId, + master_tests.test_code as testCode, + master_tests.test_name as testName, + master_tests.test_unit as testUnit, + master_tests.test_method as testMethod, + master_tests.cva, + master_tests.ba, + master_tests.tea, + master_depts.dept_name as deptName + '); + $builder->join('master_depts', 'master_depts.dept_id = master_tests.dept_id', 'left'); + $builder->where('master_tests.test_id', $testId); + $builder->where('master_tests.deleted_at', null); + $builder->groupBy('master_tests.test_id, master_depts.dept_name'); + + return $builder->get()->getRowArray(); + } } diff --git a/app/Views/layout/main_layout.php b/app/Views/layout/main_layout.php index ffff5cb..d25faeb 100755 --- a/app/Views/layout/main_layout.php +++ b/app/Views/layout/main_layout.php @@ -159,13 +159,20 @@ Standard Report -
  • +
  • Merged Report
  • +
  • + + + Custom 1 + +
  • diff --git a/app/Views/report/custom1.php b/app/Views/report/custom1.php new file mode 100644 index 0000000..e021126 --- /dev/null +++ b/app/Views/report/custom1.php @@ -0,0 +1,1008 @@ +extend("layout/main_layout"); ?> + +section("content"); ?> +
    +
    +
    +

    Traditional QC Chart

    +

    Internal Quality Control Chart - Laboratory Report

    +
    +
    + +
    +
    + + +
    +
    +
    + +
    + + + +
    +
    + + + +
    + + +
    +
    +
    + + +
    + +

    Generating traditional report...

    +
    + + +
    +
    + +
    +

    No Test Selected

    +

    Please select a laboratory test to generate the traditional QC chart report.

    +
    + + +
    + +
    + +
    +

    Internal QC

    +

    +

    Trisensa Diagnostic Centre

    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    TEST NAMENO. LOT
    METHODEXP
    PERIODUnit
    + + + + + + + + + + + + + + + + + +
    Control- 3STARGET+ 3S
    +
    + + +
    + +
    + + + + + + + + + + + + +
    No.DATEKETERANGAN
    +
    + + +
    +
    + +
    +
    + +
    +
    +
    + + +
    +
    QC PERFORMANCE
    +
    + +
    +
    + + + + +
    + + +
    +
    + +
    +

    No Data Found

    +

    There are no records found for this test and month.

    +
    +
    + + +endSection(); ?> + +section("script"); ?> + + + +endSection(); ?> \ No newline at end of file