diff --git a/module/Application/src/Application/Controller/QualityCheckController.php b/module/Application/src/Application/Controller/QualityCheckController.php index 3ec4dd35c..d5b922f2d 100755 --- a/module/Application/src/Application/Controller/QualityCheckController.php +++ b/module/Application/src/Application/Controller/QualityCheckController.php @@ -32,14 +32,18 @@ public function addAction() if ($request->isPost()) { $params = $request->getPost(); $qcService = $this->getServiceLocator()->get('QualityCheckService'); - $result = $qcService->addQcTestDetails($params); + $qcService->addQcTestDetails($params); return $this->_redirect()->toRoute('quality-check'); } else { $facilityService = $this->getServiceLocator()->get('FacilitiesService'); + $settingService = $this->getServiceLocator()->get('SettingsService'); $facilityResult = $facilityService->getFacilitiesAllDetails(); - + $kitInfo = $settingService->getKitLotDetails(); + $sampleInfo = $settingService->getSamplesDetails(); return new ViewModel(array( 'facilityResult' => $facilityResult, + 'kitInfo' => $kitInfo, + 'sampleInfo' => $sampleInfo )); } } @@ -56,10 +60,15 @@ public function editAction() $qualityCheckId = base64_decode($this->params()->fromRoute('id')); $result = $qcService->getQualityCheckDetailsById($qualityCheckId); $facilityService = $this->getServiceLocator()->get('FacilitiesService'); + $settingService = $this->getServiceLocator()->get('SettingsService'); $facilityResult = $facilityService->getFacilitiesAllDetails(); + $kitInfo = $settingService->getKitLotDetails(); + $sampleInfo = $settingService->getSamplesDetails(); return new ViewModel(array( 'result' => $result, 'facilityResult' => $facilityResult, + 'kitInfo' => $kitInfo, + 'sampleInfo' => $sampleInfo )); } } diff --git a/module/Application/src/Application/Controller/RecencyController.php b/module/Application/src/Application/Controller/RecencyController.php index c08b47e8a..3ec8ff0f5 100755 --- a/module/Application/src/Application/Controller/RecencyController.php +++ b/module/Application/src/Application/Controller/RecencyController.php @@ -53,13 +53,17 @@ public function addAction() $facilityResult = $facilityService->getFacilitiesAllDetails(); $testFacilityTypeResult = $facilityService->getTestingFacilitiesTypeDetails(); $globalConfigService = $this->getServiceLocator()->get('GlobalConfigService'); + $settingService = $this->getServiceLocator()->get('SettingsService'); + $globalConfigResult = $globalConfigService->getGlobalConfigAllDetails(); - $kitInfo = $recencyService->getKitInfo(); + $kitInfo = $settingService->getKitLotDetails(); + $sampleInfo = $settingService->getSamplesDetails(); return new ViewModel(array( 'globalConfigResult' => $globalConfigResult, 'facilityResult' => $facilityResult, 'testFacilityTypeResult' => $testFacilityTypeResult, - 'kitInfo' => $kitInfo + 'kitInfo' => $kitInfo, + 'sampleInfo' => $sampleInfo )); } } @@ -74,19 +78,21 @@ public function editAction() } else { $recencyId = base64_decode($this->params()->fromRoute('id')); $facilityService = $this->getServiceLocator()->get('FacilitiesService'); - + $settingService = $this->getServiceLocator()->get('SettingsService'); + $globalConfigService = $this->getServiceLocator()->get('GlobalConfigService'); + $facilityResult = $facilityService->getFacilitiesAllDetails(); - $result = $recencyService->getRecencyDetailsById($recencyId); - $globalConfigService = $this->getServiceLocator()->get('GlobalConfigService'); $globalConfigResult = $globalConfigService->getGlobalConfigAllDetails(); $testFacilityTypeResult = $facilityService->getTestingFacilitiesTypeDetails(); - $kitInfo = $recencyService->getKitInfo(); + $kitInfo = $settingService->getKitLotDetails(); + $sampleInfo = $settingService->getSamplesDetails(); return new ViewModel(array( 'globalConfigResult' => $globalConfigResult, 'facilityResult' => $facilityResult, 'testFacilityTypeResult' => $testFacilityTypeResult, 'kitInfo' => $kitInfo, + 'sampleInfo' => $sampleInfo, 'result' => $result )); } diff --git a/module/Application/src/Application/Model/SettingsQcSampleTable.php b/module/Application/src/Application/Model/SettingsQcSampleTable.php index 873b3ba52..e8257aa48 100755 --- a/module/Application/src/Application/Model/SettingsQcSampleTable.php +++ b/module/Application/src/Application/Model/SettingsQcSampleTable.php @@ -219,5 +219,8 @@ public function fetchAllSampleListApi() } return $response; } - + + public function fetchSamples(){ + return $this->select(array('qc_sample_status'=>'active'))->toArray(); + } } diff --git a/module/Application/src/Application/Model/SettingsTable.php b/module/Application/src/Application/Model/SettingsTable.php index 666711173..c4089f649 100755 --- a/module/Application/src/Application/Model/SettingsTable.php +++ b/module/Application/src/Application/Model/SettingsTable.php @@ -203,5 +203,7 @@ public function updateSettingsDetails($params) return $params['testId']; } - + public function fetchKitLotDetails(){ + return $this->select(array('status'=>'active'))->toArray(); + } } diff --git a/module/Application/src/Application/Service/SettingsService.php b/module/Application/src/Application/Service/SettingsService.php index 942bfc319..04bc335f1 100755 --- a/module/Application/src/Application/Service/SettingsService.php +++ b/module/Application/src/Application/Service/SettingsService.php @@ -54,6 +54,12 @@ public function getSettingsDetailsById($testId) $settingsDb = $this->sm->get('SettingsTable'); return $settingsDb->fetchSettingsDetailsById($testId); } + + public function getKitLotDetails() + { + $settingsDb = $this->sm->get('SettingsTable'); + return $settingsDb->fetchKitLotDetails(); + } public function updateSettingsDetails($params){ $adapter = $this->sm->get('Zend\Db\Adapter\Adapter')->getDriver()->getConnection(); @@ -89,6 +95,12 @@ public function getSettingsSampleDetailsById($sampleId) $settingsQcSampleDb = $this->sm->get('SettingsQcSampleTable'); return $settingsQcSampleDb->fetchSettingsSampleDetailsById($sampleId); } + + public function getSamplesDetails() + { + $settingsQcSampleDb = $this->sm->get('SettingsQcSampleTable'); + return $settingsQcSampleDb->fetchSamples(); + } public function addSampleSettingsDetails($params) { @@ -137,5 +149,3 @@ public function getAllSampleListApi($params) return $settingsQcSampleDb->fetchAllSampleListApi($params); } } - -?> diff --git a/module/Application/view/application/quality-check/add.phtml b/module/Application/view/application/quality-check/add.phtml index fc69b1e1f..741d465d5 100755 --- a/module/Application/view/application/quality-check/add.phtml +++ b/module/Application/view/application/quality-check/add.phtml @@ -45,7 +45,12 @@ $lineOutComeColor2 = "#000000";