Skip to content

Commit

Permalink
Merged with remote repo
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdugar committed Aug 26, 2019
2 parents 1812e0e + 36792bc commit c002d8a
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
}
}
Expand All @@ -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
));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
}
}
Expand All @@ -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
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,8 @@ public function fetchAllSampleListApi()
}
return $response;
}


public function fetchSamples(){
return $this->select(array('qc_sample_status'=>'active'))->toArray();
}
}
4 changes: 3 additions & 1 deletion module/Application/src/Application/Model/SettingsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,7 @@ public function updateSettingsDetails($params)
return $params['testId'];
}


public function fetchKitLotDetails(){
return $this->select(array('status'=>'active'))->toArray();
}
}
14 changes: 12 additions & 2 deletions module/Application/src/Application/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -137,5 +149,3 @@ public function getAllSampleListApi($params)
return $settingsQcSampleDb->fetchAllSampleListApi($params);
}
}

?>
14 changes: 12 additions & 2 deletions module/Application/view/application/quality-check/add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ $lineOutComeColor2 = "#000000";
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="">QC Sample ID <span class="mandatory">*</span></label>
<div class="col-sm-4">
<input type="text" class="form-control isRequired" id="qcSampleId" name="qcSampleId" placeholder="Enter the QC Sample ID" title="Please enter the QC Sample ID">
<select class="form-control isRequired" id="qcSampleId" name="qcSampleId" title="Please select the QC Sample ID">
<option value="">--Select--</option>
<?php foreach($sampleInfo as $sample){?>
<option value="<?php echo $sample['qc_sample_no'];?>"><?php echo $sample['qc_sample_no'];?></option>
<?php }?>
</select>
</div>

<label class="col-sm-2 col-form-label" for="">QC Test Date <span class="mandatory">*</span></label>
Expand All @@ -67,7 +72,12 @@ $lineOutComeColor2 = "#000000";

<label class="col-sm-2 col-form-label" for="">Test Kit Lot No <span class="mandatory">*</span></label>
<div class="col-sm-4">
<input type="text" class="form-control isRequired" id="testKitLotNo" name="testKitLotNo" placeholder="Enter the test Kit Lot No" title="Please enter the test Kit Lot No">
<select class="form-control isRequired" id="testKitLotNo" name="testKitLotNo" title="Please select the test Kit Lot No">
<option value="">--Select--</option>
<?php foreach ($kitInfo as $info) {
echo '<option value="' . $info['kit_lot_no'] . '">' . $info['kit_lot_no'] . '</option>';
} ?>
</select>
</div>
</div>

Expand Down
29 changes: 20 additions & 9 deletions module/Application/view/application/quality-check/edit.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Zend\Session\Container;
use Application\Service\CommonService;

Expand Down Expand Up @@ -27,10 +28,10 @@ $lineOutComeColor2 = "#000000";
<style>
<?php if ($result['term_outcome'] == '') {
?>.outcome {
display: none;
}
display: none;
}

<?php
<?php
}

?>.btnHide {
Expand Down Expand Up @@ -68,9 +69,14 @@ $lineOutComeColor2 = "#000000";
<form name="qcEditInformation" id="qcEditInformation" class="mb-5" action="<?php echo $this->url('quality-check', array('action' => 'edit')); ?>" method="post">

<div class="form-group row">
<label class="col-sm-2 col-form-label" for="">QC Sample ID <span class="mandatory">*</span></label>
<label class="col-sm-2 col-form-label" for="qcSampleId">QC Sample ID <span class="mandatory">*</span></label>
<div class="col-sm-4">
<input type="text" value="<?php echo $result['qc_sample_id']; ?>" class="form-control isRequired" id="qcSampleId" name="qcSampleId" placeholder="Enter the QC Sample ID" title="Please enter the QC Sample ID">
<select class="form-control isRequired" id="qcSampleId" name="qcSampleId" title="Please select the QC Sample ID">
<option value="">--Select--</option>
<?php foreach ($sampleInfo as $sample) { ?>
<option value="<?php echo $sample['qc_sample_no']; ?>" <?php echo ($sample['qc_sample_no'] == $result['qc_sample_id']) ? 'selected="selected"' : ''; ?>><?php echo $sample['qc_sample_no']; ?></option>
<?php } ?>
</select>
</div>
<label class="col-sm-2 col-form-label" for="">QC Test Date<span class="mandatory">*</span></label>
<div class="col-sm-4">
Expand All @@ -88,9 +94,14 @@ $lineOutComeColor2 = "#000000";
<option value="hiv_negative_sample" <?php echo ($result['reference_result'] == 'hiv_negative_sample') ? 'selected="selected"' : ''; ?>>HIV Negative Sample</option>
</select>
</div>
<label class="col-sm-2 col-form-label" for="">Test Kit Lot No.<span class="mandatory">*</span></label>
<label class="col-sm-2 col-form-label" for="testKitLotNo">Test Kit Lot No.<span class="mandatory">*</span></label>
<div class="col-sm-4">
<input type="text" value="<?php echo $result['kit_lot_no']; ?>" class="form-control isRequired" id="testKitLotNo" name="testKitLotNo" placeholder="Enter the test Kit Lot No" title="Please enter the test Kit Lot No">
<select class="form-control isRequired" id="testKitLotNo" name="testKitLotNo" title="Please select the test Kit Lot No">
<option value="">--Select--</option>
<?php foreach ($kitInfo as $info) { ?>
<option value="<?php echo $info['kit_lot_no']; ?>" <?php echo ($info['kit_lot_no'] == $result['kit_lot_no']) ? 'selected="selected"' : ''; ?>><?php echo $info['kit_lot_no']; ?></option>
<?php } ?>
</select>
</div>

</div>
Expand Down Expand Up @@ -150,11 +161,11 @@ $lineOutComeColor2 = "#000000";
<input type="text" value="<?php echo $result['tester_name']; ?>" class="form-control isRequired" id="testerName" name="testerName" placeholder="Enter the tester name" title="Please enter the tester name">
</div>
<label class="col-sm-2 col-form-label " for="">Testing Facility<span class="mandatory">*</span></label>
<div class="col-sm-4 <?php echo in_array("Testing Facility", $resultArr2) ? "showFields" : "hideFields"; ?>">
<div class="col-sm-4">
<select class="form-control isRequired" id="testingFacilityId" name="testingFacilityId" title="Please select the testing facility name">
<option value="">--Select--</option>
<?php foreach ($facilityResult['facilityTest'] as $testingFacility) { ?>
<option value="<?php echo $testingFacility['facility_id']; ?>" <?php echo ($testingFacility['facility_id'] == $result['testing_facility_id']) ? 'selected="selected"' : ''; ?>><?php echo ucwords($testingFacility['facility_name']); ?></option>
<option value="<?php echo $testingFacility['facility_id']; ?>" <?php echo ($testingFacility['facility_id'] == $result['testing_facility_id']) ? 'selected="selected"' : ''; ?>><?php echo ucwords($testingFacility['facility_name']); ?></option>
<?php } ?>
<!-- <option value="other">Other</option> -->
</select>
Expand Down
Loading

0 comments on commit c002d8a

Please sign in to comment.