mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
740
apps/atlbiomed/modules/process/actions/actions.class.php
Executable file
740
apps/atlbiomed/modules/process/actions/actions.class.php
Executable file
@ -0,0 +1,740 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* process actions.
|
||||
*
|
||||
* @package atlbiomed
|
||||
* @subpackage process
|
||||
* @author Your name here
|
||||
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
|
||||
*/
|
||||
class processActions extends sfActions
|
||||
{
|
||||
/**
|
||||
* Executes index action
|
||||
*
|
||||
*/
|
||||
public function executeIndex()
|
||||
{
|
||||
$this->client_id = '';
|
||||
//populate Client Select dropdown
|
||||
$m = new Criteria();
|
||||
$m->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
|
||||
$this->clients = array();
|
||||
foreach(ClientPeer::doSelect($m) as $client)
|
||||
{
|
||||
$this->clients[$client->getId()] = $client->getClientIdentification();
|
||||
}
|
||||
}
|
||||
public function executeProcessUpload(){ //get all clients
|
||||
$c = new Criteria();
|
||||
$c->addAscendingOrderByColumn(ClientPeer::CLIENT_IDENTIFICATION);
|
||||
$clients = ClientPeer::doSelect($c);
|
||||
|
||||
|
||||
//read and parse upload file
|
||||
$processHandler = new processHandler($this->getRequest());
|
||||
|
||||
|
||||
if($processHandler->shouldForward()){//file was already uploaded
|
||||
$this->getUser()->setAttribute('fileAlreadyExist',true);
|
||||
$this->redirect('/unprocessed/index?warning=yes&fn='.$processHandler->getFilename());
|
||||
}
|
||||
|
||||
$this->partialMatch = $processHandler->getPartialMatch();
|
||||
$this->noMatch = $processHandler->getNoMatch();
|
||||
$this->match = $processHandler->getMatched();
|
||||
$this->clients = $clients;
|
||||
$this->filename = $processHandler->getFilename();
|
||||
}//public
|
||||
public function executeSavePartialMatch(){
|
||||
|
||||
|
||||
$pass_fail = $this->getRequestParameter('pass_fail');
|
||||
$device_id = $this->getRequestParameter('device_id');
|
||||
$device_name = $this->getRequestParameter('device_name');
|
||||
$serial = $this->getRequestParameter('serial');
|
||||
$model = $this->getRequestParameter("model");
|
||||
$manufacturer = $this->getRequestParameter('manufacturer');
|
||||
$date = $this->getRequestParameter('date');
|
||||
$serialize_test_data = $this->getRequestParameter('test_data');
|
||||
$serialize_extra_data = $this->getRequestParameter('extra_data');
|
||||
$test_data = unserialize($serialize_test_data);
|
||||
$extra_data = unserialize($serialize_extra_data);
|
||||
$filename = $this->getRequestParameter('filename');
|
||||
$location = $this->getRequestParameter('location');
|
||||
$comments = $this->getRequestParameter('comments');
|
||||
$assoc_client_id = $this->getRequestParameter('assoc_client');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::IDENTIFICATION, $device_id);
|
||||
$deviceResult = DevicePeer::doSelect($c);
|
||||
if($deviceResult){
|
||||
|
||||
$this->changePm2Missing($deviceResult[0]->getClientId());
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
|
||||
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
|
||||
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
|
||||
$unprocessDevice = $unprocessDevice[0];
|
||||
if($unprocessDevice)
|
||||
$unprocessDevice->delete();
|
||||
|
||||
//saving device info
|
||||
$deviceResult = $deviceResult[0];
|
||||
$deviceResult->setSerialNumber($serial);
|
||||
$deviceResult->setStatus(strtolower($pass_fail));
|
||||
$deviceResult->setLocation($location);
|
||||
$deviceResult->setComments($comments);
|
||||
$deviceResult->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
|
||||
if($assoc_client_id > 0)
|
||||
$deviceResult->setClientId($assoc_client_id);
|
||||
$specificationId = $deviceResult->getSpecificationId();
|
||||
$deviceResult->save();
|
||||
|
||||
$deviceCheckup = new DeviceCheckup();
|
||||
$deviceCheckup->setDeviceId($deviceResult->getId());
|
||||
$deviceCheckup->setClientId($deviceResult->getClientId());
|
||||
$deviceCheckup->setDeviceIdentification($device_id);
|
||||
$deviceCheckup->setDate($date);
|
||||
$deviceCheckup->setPassFail($pass_fail);
|
||||
$deviceCheckup->setTime($extra_data['time']);
|
||||
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
|
||||
$deviceCheckup->setDeviceTechId($extra_data['techId']);
|
||||
//$deviceCheckup->setLocation($extra_data['location']);
|
||||
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
|
||||
$deviceCheckup->setRecNumber($extra_data['recNumber']);
|
||||
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
|
||||
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
|
||||
$deviceCheckup->setRoom($extra_data['room']);
|
||||
$deviceCheckup->save();
|
||||
$deviceCheckup->save();
|
||||
|
||||
$device_test_data = new DeviceTestData();
|
||||
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
|
||||
$device_test_data->setName($test_data['name']);
|
||||
$device_test_data->setPassFail($test_data['passFail']);
|
||||
$device_test_data->setType($test_data['type']);
|
||||
$device_test_data->setUnit($test_data['unit']);
|
||||
$device_test_data->setValue($test_data['value']);
|
||||
$device_test_data->save();
|
||||
|
||||
$this->changePm2Missing();
|
||||
}
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(SpecificationPeer::ID, $specificationId);
|
||||
$specificationResult = SpecificationPeer::doSelect($c);
|
||||
if($specificationResult){
|
||||
$specificationResult = $specificationResult[0];
|
||||
$specificationResult->setManufacturer($manufacturer);
|
||||
$specificationResult->setModelNumber($model);
|
||||
$specificationResult->setDeviceName($device_name);
|
||||
$specificationResult->save();
|
||||
}
|
||||
|
||||
return sfView::NONE;
|
||||
}
|
||||
public function executeSaveNoMatch(){
|
||||
|
||||
$option = $this->getRequestParameter('option');
|
||||
$device_id = $this->getRequestParameter('device_id');
|
||||
$d_device_id = $this->getRequestParameter('get_devices');
|
||||
$device_name = $this->getRequestParameter('device_name');
|
||||
$serial = $this->getRequestParameter('serial');
|
||||
$model = $this->getRequestParameter("model");
|
||||
$manufacturer = $this->getRequestParameter('manufacturer');
|
||||
$pass_fail = $this->getRequestParameter('pass_fail');
|
||||
$date = $this->getRequestParameter('date');
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$serialize_test_data = $this->getRequestParameter('test_data');
|
||||
$serialize_extra_data = $this->getRequestParameter('extra_data');
|
||||
$test_data = unserialize($serialize_test_data);
|
||||
$extra_data = unserialize($serialize_extra_data);
|
||||
$filename = $this->getRequestParameter('filename');
|
||||
$location = $this->getRequestParameter('location');
|
||||
$comments = $this->getRequestParameter('comments');
|
||||
|
||||
//if this is -1 use the origanal device identification
|
||||
//otherwise use whatever value this is for the identifcation
|
||||
$existingId = $this->getRequestParameter('existingId');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(UnprocessedDevicesPeer::DEVICE_ID, $device_id);
|
||||
$c->add(UnprocessedDevicesPeer::FILENAME, $filename);
|
||||
$unprocessDevice = UnprocessedDevicesPeer::doSelect($c);
|
||||
$unprocessDevice = $unprocessDevice[0];
|
||||
|
||||
if($unprocessDevice)
|
||||
$unprocessDevice->delete();
|
||||
|
||||
|
||||
//add as new entry
|
||||
if($option == 1){
|
||||
$this->changePm2Missing($client_id);
|
||||
$specification = new Specification();
|
||||
$specification->setDeviceName($device_name);
|
||||
$specification->setManufacturer($manufacturer);
|
||||
$specification->setModelNumber($model);
|
||||
$specification->save();
|
||||
$specification_id = $specification->getId();
|
||||
|
||||
$device = new Device();
|
||||
$device->setIdentification($device_id);
|
||||
$device->setClientId($client_id);
|
||||
$device->setSpecificationId($specification_id);
|
||||
$device->setSerialNumber($serial);
|
||||
$device->setLocation($location);
|
||||
$device->setStatus(strtolower($pass_fail));
|
||||
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
|
||||
$device->setComments($comments);
|
||||
$device->save();
|
||||
|
||||
$deviceCheckup = new DeviceCheckup();
|
||||
$deviceCheckup->setDeviceId($device->getId());
|
||||
$deviceCheckup->setClientId($device->getClientId());
|
||||
$deviceCheckup->setDeviceIdentification($device_id);
|
||||
$deviceCheckup->setDate($date);
|
||||
$deviceCheckup->setPassFail($pass_fail);
|
||||
$deviceCheckup->setTime($extra_data['time']);
|
||||
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
|
||||
$deviceCheckup->setDeviceTechId($extra_data['techId']);
|
||||
//$deviceCheckup->setLocation($extra_data['location']);
|
||||
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
|
||||
$deviceCheckup->setRecNumber($extra_data['recNumber']);
|
||||
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
|
||||
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
|
||||
$deviceCheckup->setRoom($extra_data['room']);
|
||||
$deviceCheckup->save();
|
||||
|
||||
$device_test_data = new DeviceTestData();
|
||||
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
|
||||
$device_test_data->setName($test_data['name']);
|
||||
$device_test_data->setPassFail($test_data['passFail']);
|
||||
$device_test_data->setType($extra_data['physicalInspection']);
|
||||
$device_test_data->setUnit($test_data['unit']);
|
||||
$device_test_data->setValue($test_data['value']);
|
||||
$device_test_data->save();
|
||||
}else{
|
||||
//update existing
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::IDENTIFICATION, $d_device_id);
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$device = DevicePeer::doSelect($c);
|
||||
$device = $device[0];
|
||||
if($device){
|
||||
$specification_id = $device->getSpecificationId();
|
||||
if($existingId != '-1'){
|
||||
$device->setIdentification($existingId);
|
||||
}
|
||||
$device->setSerialNumber($serial);
|
||||
$device->setLocation($location);
|
||||
$device->setStatus(strtolower($pass_fail));
|
||||
$device->setComments($comments);
|
||||
$device->setLastPmDate(FinalDeviceReport::convertImportedDate($date));
|
||||
$device->save();
|
||||
|
||||
$deviceCheckup = new DeviceCheckup();
|
||||
$deviceCheckup->setDeviceId($device->getId());
|
||||
$deviceCheckup->setClientId($device->getClientId());
|
||||
$deviceCheckup->setDeviceIdentification($d_device_id);
|
||||
$deviceCheckup->setDate($date);
|
||||
$deviceCheckup->setPassFail($pass_fail);
|
||||
$deviceCheckup->setTime($extra_data['time']);
|
||||
$deviceCheckup->setRowIndicator($extra_data['rowIndicator']);
|
||||
$deviceCheckup->setDeviceTechId($extra_data['techId']);
|
||||
//$deviceCheckup->setLocation($extra_data['location']);
|
||||
$deviceCheckup->setPassFailCode($extra_data['passFailCode']);
|
||||
$deviceCheckup->setRecNumber($extra_data['recNumber']);
|
||||
$deviceCheckup->setRowPurpose($extra_data['rowPurpose']);
|
||||
$deviceCheckup->setPhysicalInspection($extra_data['physicalInspection']);
|
||||
$deviceCheckup->setRoom($extra_data['room']);
|
||||
$deviceCheckup->save();
|
||||
|
||||
$device_test_data = new DeviceTestData();
|
||||
$device_test_data->setDeviceCheckupId($deviceCheckup->getId());
|
||||
$device_test_data->setName($test_data['name']);
|
||||
$device_test_data->setPassFail($test_data['passFail']);
|
||||
$device_test_data->setType($test_data['type']);
|
||||
$device_test_data->setUnit($test_data['unit']);
|
||||
$device_test_data->setValue($test_data['value']);
|
||||
$device_test_data->save();
|
||||
}
|
||||
|
||||
|
||||
$c= new Criteria();
|
||||
$c->add(SpecificationPeer::ID,$specification_id);
|
||||
$specification = SpecificationPeer::doSelect($c);
|
||||
$specification = $specification[0];
|
||||
if($specification){
|
||||
$specification->setDeviceName($device_name);
|
||||
$specification->setManufacturer($manufacturer);
|
||||
$specification->setModelNumber($model);
|
||||
$specification->Save();
|
||||
}
|
||||
}
|
||||
return sfView::NONE;
|
||||
}
|
||||
public function executeGetDevices(){
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->addAscendingOrderByColumn(DevicePeer::IDENTIFICATION);
|
||||
$result = DevicePeer::doSelect($c);
|
||||
$this->devices = $result;
|
||||
}
|
||||
public function executeDeviceIdChanged(){
|
||||
//these info are from the uploaded file
|
||||
$device_name = $this->getRequestParameter('dn');
|
||||
$manufacturer = $this->getRequestParameter('man');
|
||||
$model = $this->getRequestParameter('mod');
|
||||
$serial = $this->getRequestParameter('ser');
|
||||
//device id we want to associate to
|
||||
$existing_device_id = $this->getRequestParameter('existing_device_id');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::IDENTIFICATION, $existing_device_id);// <---------------------------------------------------
|
||||
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, Criteria::LEFT_JOIN);
|
||||
$result = DevicePeer::doSelect($c);
|
||||
$this->oldDevice = $result[0];
|
||||
$this->newDevice = array('device_name'=>$device_name, 'manufacturer'=>$manufacturer, 'model'=>$model, 'serial'=>$serial);
|
||||
}
|
||||
public function executeListDevices(){
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$c= new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->addjoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID,Criteria::LEFT_JOIN);
|
||||
$devices = DevicePeer::doSelect($c);
|
||||
$this->devices = $devices;
|
||||
$this->client_id = $client_id;
|
||||
if($devices && $devices[0]->getClient() )
|
||||
$this->contact = $devices[0]->getClient()->getAttn();
|
||||
}
|
||||
public function executeQuotes(){
|
||||
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
|
||||
|
||||
$c= new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$devices = DevicePeer::doSelect($c);
|
||||
|
||||
if(!empty($checkedItemStr)){
|
||||
$checkedItems = explode(',',$checkedItemStr);
|
||||
for($i = 0; $i<count($devices); $i++){
|
||||
if(strtolower($devices[$i]->getStatus())=='fail' and in_array($devices[$i]->getId(),$checkedItems)){
|
||||
$devices[$i]->setStatus('quote');
|
||||
$devices[$i]->save();
|
||||
}
|
||||
}
|
||||
}//if
|
||||
|
||||
$this->devices = $devices;
|
||||
$this->client_id = $client_id;
|
||||
$this->setTemplate('listDevices');
|
||||
}
|
||||
public function executePendingRepair(){
|
||||
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$checkedItemStr = $this->getRequestParameter('checkedItems'); //ids of items that were checked for update
|
||||
|
||||
$c= new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$devices = DevicePeer::doSelect($c);
|
||||
|
||||
if(!empty($checkedItemStr)){
|
||||
$checkedItems = explode(',',$checkedItemStr);
|
||||
for($i = 0; $i<count($devices); $i++){
|
||||
if(strtolower($devices[$i]->getStatus())=='quote' and in_array($devices[$i]->getId(),$checkedItems)){
|
||||
$devices[$i]->setStatus('pending repair');
|
||||
$devices[$i]->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->devices = $devices;
|
||||
$this->client_id = $client_id;
|
||||
$this->setTemplate('listDevices');
|
||||
}
|
||||
public function executeGenerateReport(){
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$contact = trim($this->getRequestParameter('contact'),' ');
|
||||
|
||||
$client = ClientPeer::retrieveByPk($client_id);
|
||||
if($client){
|
||||
if(!empty($contact))
|
||||
$contactName = $contact ;
|
||||
else {
|
||||
$contactName = ($client->getAddressType() == 1) ? $client->getAttn() : $client->getSecondaryAttn();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, strtolower('fail'));
|
||||
$totalFail = count(DevicePeer::doSelect($c));
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, strtolower('pass'));
|
||||
$totalPass = count(DevicePeer::doSelect($c));
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, strtolower('missing'));
|
||||
$totalMissing = count(DevicePeer::doSelect($c));
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
|
||||
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
|
||||
$c->add(SpecificationPeer::DEVICE_NAME,'BAUMANOMETER');
|
||||
$totalBp = count(DevicePeer::doSelect($c));
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
|
||||
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
|
||||
$c->add(SpecificationPeer::DEVICE_NAME,'TRACE GAS N20');
|
||||
$totalTrace = count(DevicePeer::doSelect($c));
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, "missing", CRITERIA::NOT_EQUAL);
|
||||
$c->addJoin(DevicePeer::SPECIFICATION_ID, SpecificationPeer::ID, CRITERIA::LEFT_JOIN);
|
||||
$c->add(SpecificationPeer::DEVICE_NAME,'WALL OUTLET');
|
||||
$totalOutlets = count(DevicePeer::doSelect($c));
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, 'missing');
|
||||
$missingDevices = DevicePeer::doSelect($c);
|
||||
if($missingDevices){
|
||||
|
||||
$report = new FinalDeviceReport();
|
||||
$report->setClientId($client_id);
|
||||
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
|
||||
$report->setPassFail('missing');
|
||||
$report->setTotalPassed($totalPass);
|
||||
$report->setTotalFailed($totalFail);
|
||||
$report->setTotalMissed($totalMissing);
|
||||
$report->setTotalTrace($totalTrace);
|
||||
$report->setTotalBp($totalBp);
|
||||
$report->setTotalOutlets($totalOutlets);
|
||||
$report->setContact($contactName);
|
||||
$report->save();
|
||||
|
||||
foreach($missingDevices as $f_device){
|
||||
$missing = new DevicesFailed();
|
||||
$missing->setReportId($report->getId());
|
||||
$missing->setClientId($f_device->getClientId());
|
||||
$missing->setDeviceId($f_device->getId());
|
||||
$missing->setStatus($f_device->getStatus());
|
||||
$missing->save();
|
||||
}//foreach
|
||||
}
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicePeer::STATUS, 'fail');
|
||||
$failDevices = DevicePeer::doSelect($c);
|
||||
|
||||
if($failDevices){
|
||||
//report failed
|
||||
|
||||
|
||||
$report = new FinalDeviceReport();
|
||||
$report->setClientId($client_id);
|
||||
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
|
||||
$report->setPassFail('fail');
|
||||
$report->setTotalPassed($totalPass);
|
||||
$report->setTotalFailed($totalFail);
|
||||
$report->setTotalMissed($totalMissing);
|
||||
$report->setTotalTrace($totalTrace);
|
||||
$report->setTotalBp($totalBp);
|
||||
$report->setTotalOutlets($totalOutlets);
|
||||
$report->setContact($contactName);
|
||||
$report->save();
|
||||
|
||||
foreach($failDevices as $f_device){
|
||||
$fail = new DevicesFailed();
|
||||
$fail->setReportId($report->getId());
|
||||
$fail->setClientId($f_device->getClientId());
|
||||
$fail->setDeviceId($f_device->getId());
|
||||
$fail->setStatus($f_device->getStatus());
|
||||
$fail->save();
|
||||
}//foreach
|
||||
|
||||
}else{
|
||||
//report passed
|
||||
|
||||
//in order to get contact name
|
||||
|
||||
|
||||
$report = new FinalDeviceReport();
|
||||
$report->setClientId($client_id);
|
||||
$report->setDate(date('Y').'-'.date('m').'-'.date('d'));
|
||||
$report->setPassFail('pass');
|
||||
$report->setTotalPassed($totalPass);
|
||||
$report->setTotalFailed($totalFail);
|
||||
$report->setTotalMissed($totalMissing);
|
||||
$report->setTotalTrace($totalTrace);
|
||||
$report->setTotalBp($totalBp);
|
||||
$report->setTotalOutlets($totalOutlets);
|
||||
$report->setContact($contactName);
|
||||
$report->save();
|
||||
}
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
|
||||
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
|
||||
$finalReport = FinalDeviceReportPeer::doSelect($c);
|
||||
$this->finalReport = $finalReport;
|
||||
|
||||
}
|
||||
public function executeGetReports(){
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$c = new Criteria();
|
||||
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
|
||||
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
|
||||
$finalReport = FinalDeviceReportPeer::doSelect($c);
|
||||
$this->finalReport = $finalReport;
|
||||
$this->setTemplate('generateReport');
|
||||
}
|
||||
public function executeDeleteReport(){
|
||||
|
||||
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$report_id = $this->getRequestParameter('id');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(FinalDeviceReportPeer::ID, $report_id);
|
||||
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
|
||||
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
|
||||
$forDelete = FinalDeviceReportPeer::doSelect($c);
|
||||
if($forDelete){
|
||||
$forDelete[0]->delete();
|
||||
}
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(FinalDeviceReportPeer::CLIENT_ID, $client_id);
|
||||
$c->addDescendingOrderByColumn(FinalDeviceReportPeer::CREATED_AT);
|
||||
$finalReport = FinalDeviceReportPeer::doSelect($c);
|
||||
$this->finalReport = $finalReport;
|
||||
$this->setTemplate('generateReport');
|
||||
}
|
||||
public function executeSaveComments(){
|
||||
$device_id = $this->getRequestParameter('device_id');
|
||||
$comments = $this->getRequestParameter('comments');
|
||||
|
||||
$device = DevicePeer::retrieveByPK($device_id);
|
||||
if($device){
|
||||
$device->setComments($comments);
|
||||
$device->save();
|
||||
}
|
||||
return sfView::NONE;
|
||||
}
|
||||
public function executeCreatePdf(){
|
||||
|
||||
$client_id = 0; //default val
|
||||
|
||||
|
||||
$id = $this->getRequestParameter('id');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DeviceCheckupPeer::DATE, $date);
|
||||
$c->add(DeviceCheckupPeer::CLIENT_ID, $client_id);
|
||||
$c->add(DeviceCheckupPeer::PASS_FAIL, 'FAIL');
|
||||
$failedDevices = DeviceCheckupPeer::doSelect($c);
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(FinalDeviceReportPeer::ID, $id);
|
||||
$c->setLimit(1);
|
||||
$all = FinalDeviceReportPeer::doSelect($c);
|
||||
|
||||
if(empty($all))
|
||||
$passed = true;
|
||||
elseif(strtolower($all[0]->getPassFail())=='fail'){
|
||||
$passed = false;
|
||||
$missing = false;
|
||||
}elseif(strtolower($all[0]->getPassFail())=='pass'){
|
||||
$passed = true;
|
||||
$missing = false;
|
||||
}elseif(strtolower($all[0]->getPassFail())=='missing'){
|
||||
$missing = true;
|
||||
}
|
||||
|
||||
if(!empty($all))
|
||||
$client_id = $client_id = $all[0]->getClientId();
|
||||
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ClientPeer::ID, $client_id);
|
||||
$clientinfo = ClientPeer::doSelect($c);
|
||||
|
||||
|
||||
|
||||
define('FPDF_FONTPATH',SF_ROOT_DIR.'/web/font/');
|
||||
$date = date("F d, Y", time());
|
||||
|
||||
$clientName = $clientinfo[0]->getClientName();
|
||||
|
||||
if($clientinfo[0]->getAddressType() == 1){
|
||||
$address_line_1 = $clientinfo[0]->getAddress();
|
||||
$address_line_2 = $clientinfo[0]->getAddress2();
|
||||
$address_line_3 = $clientinfo[0]->getCity().', '.$clientinfo[0]->getState().' '.$clientinfo[0]->getZip();
|
||||
//$contact = $clientinfo[0]->getAttn();
|
||||
$contact = $all[0]->getContact();
|
||||
}else{
|
||||
$address_line_1 = $clientinfo[0]->getSecondaryAddress();
|
||||
$address_line_2 = $clientinfo[0]->getSecondaryAddress2();
|
||||
$address_line_3 = $clientinfo[0]->getSecondaryCity().', '.$clientinfo[0]->getSecondaryState().' '.$clientinfo[0]->getSecondaryZip();
|
||||
//$contact = $clientinfo[0]->getSecondaryAttn();
|
||||
$contact = $all[0]->getContact();
|
||||
}
|
||||
|
||||
|
||||
$subject = "Re: Preventive Maintenance Test Results ";
|
||||
|
||||
if($missing){
|
||||
$line_1 = "While our technician was doing preventive maintenance on your equipment, some devices were missed. The following is a list of the equipment that were not checked:
|
||||
";
|
||||
$line_2 = "
|
||||
We would like to schedule a time to complete the preventive maintenance on this equipment. Please call us and we will arrange for a technician to complete this work. If you have any questions, please do not hesitate to call. ";
|
||||
$signer = "Chris Endres, VP";
|
||||
}else{
|
||||
$line_1 = "While our technician was doing preventive maintenance on your equipment, some failures were found. The following is a list of the equipment and the problems that were found:
|
||||
";
|
||||
$line_2 = "
|
||||
We would like to schedule a time to repair this equipment. Please call us and we will arrange for a technician to perform the needed repair immediately. If you have any questions, please do not hesitate to call.";
|
||||
$signer = "Chris Endres, VP";
|
||||
}
|
||||
|
||||
|
||||
$passed_line = "While our technician was doing preventive maintenance on your equipment there were no problems found. Enclosed please find the reports for all equipment tested. If you need any repairs or have any questions, please do not hesitate to call.
|
||||
";
|
||||
|
||||
$pdf=new FPDF();
|
||||
$pdf->SetMargins(30,25,30);
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->SetFont('Times','',12);
|
||||
//for($i=1;$i<=40;$i++)
|
||||
$pdf->Cell(0,5,$date,0,1);
|
||||
$pdf->Cell(0,5,"",0,1);
|
||||
$pdf->Cell(0,5,$clientName,0,1);
|
||||
$pdf->Cell(0,5,$address_line_1,0,1);
|
||||
if(!empty($address_line_2))
|
||||
$pdf->Cell(0,5,$address_line_2,0,1);
|
||||
$pdf->Cell(0,5,$address_line_3,0,1);
|
||||
$pdf->Cell(0,5,"",0,1);
|
||||
$pdf->Cell(0,5,$subject,0,1);
|
||||
$pdf->Cell(0,5,"",0,1);
|
||||
$pdf->Cell(0,5,"Dear $contact,",0,1);
|
||||
$pdf->Cell(0,5,"",0,1);
|
||||
|
||||
if($passed)
|
||||
$pdf->MultiCell(0,5,$passed_line,0,1);
|
||||
else{
|
||||
|
||||
|
||||
$pdf->MultiCell(0,5,$line_1,0,1);
|
||||
|
||||
|
||||
//search for failed device for report
|
||||
if($missing){
|
||||
$c = new Criteria();
|
||||
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicesFailedPeer::REPORT_ID, $id);
|
||||
$c->add(DevicesFailedPeer::STATUS, 'missing');
|
||||
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$failedDevices = DevicesFailedPeer::doSelect($c);
|
||||
|
||||
foreach($failedDevices as $failedDevice){
|
||||
$currentDevice = $failedDevice->getDevice();
|
||||
if($currentDevice){
|
||||
$deviceName = $currentDevice->getSpecification()->getDeviceName();
|
||||
$deviceIdentification = $currentDevice->getIdentification();
|
||||
|
||||
$pdf->Cell(0,5," * $deviceIdentification - $deviceName",0,1);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$c = new Criteria();
|
||||
$c->add(DevicesFailedPeer::CLIENT_ID, $client_id);
|
||||
$c->add(DevicesFailedPeer::REPORT_ID, $id);
|
||||
$c->add(DevicesFailedPeer::STATUS, 'fail');
|
||||
$c->addjoin(DevicesFailedPeer::DEVICE_ID,DevicePeer::ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$failedDevices = DevicesFailedPeer::doSelect($c);
|
||||
|
||||
foreach($failedDevices as $failedDevice){
|
||||
$currentDevice = $failedDevice->getDevice();
|
||||
if($currentDevice){
|
||||
$comments = ($currentDevice->getComments()) ? '- ' . $currentDevice->getComments() : '';
|
||||
$comments = strtoupper($comments);
|
||||
$deviceName = $currentDevice->getSpecification()->getDeviceName();
|
||||
$deviceIdentification = $currentDevice->getIdentification();
|
||||
$pdf->Cell(0,5," * $deviceIdentification - $deviceName $comments",0,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->Cell(0,5," ",0,1);
|
||||
$pdf->MultiCell(0,5,$line_2,0,1);
|
||||
}
|
||||
|
||||
$pdf->Cell(0,5," ",0,1);
|
||||
|
||||
$pdf->Cell(0,5,"Sincerely, ",0,1);
|
||||
$pdf->Cell(0,5," ",0,1);
|
||||
$pdf->Cell(0,5," ",0,1);
|
||||
$pdf->Cell(0,5," ",0,1);
|
||||
$pdf->Cell(0,5,$signer,0,1);
|
||||
|
||||
//$pdf->Cell(0,5,$subject,0,1);
|
||||
//$pdf->Cell(0,5,$subject,0,1);
|
||||
//$pdf->Cell(0,5,$subject,0,1);
|
||||
$pdf->Output();
|
||||
return svView::NONE;
|
||||
}
|
||||
private function changePm2Missing($clientId = null){
|
||||
|
||||
if(empty($clientId)) return;
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(DevicePeer::CLIENT_ID,$clientId);
|
||||
$c->add(DevicePeer::STATUS,'pm scheduled');
|
||||
$devices = DevicePeer::doSelect($c);
|
||||
foreach($devices as $device){
|
||||
$device->setStatus('missing');
|
||||
$device->save();
|
||||
}
|
||||
}
|
||||
public function executeUpdateFullMatch(){
|
||||
$client_id = $this->getRequestParameter('client_id');
|
||||
$device_id = $this->getRequestParameter('device_id');
|
||||
if($client_id > 0){
|
||||
$device = DevicePeer::retrieveByPk($device_id);
|
||||
|
||||
if($device){
|
||||
$device->setClientId($client_id);
|
||||
$device->save();
|
||||
}
|
||||
}
|
||||
return sfView::NONE;
|
||||
}
|
||||
}
|
11
apps/atlbiomed/modules/process/config/view.yml
Executable file
11
apps/atlbiomed/modules/process/config/view.yml
Executable file
@ -0,0 +1,11 @@
|
||||
generateReportSuccess:
|
||||
layout: no
|
||||
listDevicesSuccess:
|
||||
layout: no
|
||||
deviceIdChangedSuccess:
|
||||
layout: no
|
||||
getDevicesSuccess:
|
||||
layout: no
|
||||
all:
|
||||
stylesheets: [process]
|
||||
javascripts: [scriptaculous/lib/prototype, process]
|
11
apps/atlbiomed/modules/process/templates/_device.php
Executable file
11
apps/atlbiomed/modules/process/templates/_device.php
Executable file
@ -0,0 +1,11 @@
|
||||
|
||||
<? if(empty($devices)) {?>
|
||||
<option value='-1'>No Device</option>
|
||||
<? }else{?>
|
||||
<option value='-2'>Select A Device</option>
|
||||
<?php
|
||||
}?>
|
||||
<?php foreach($devices as $device) { ?>
|
||||
<option value='<?print $device->getIdentification(); ?>'><?print $device->getIdentification(); ?></option>
|
||||
<?php } ?>
|
||||
|
57
apps/atlbiomed/modules/process/templates/_device_changed.php
Executable file
57
apps/atlbiomed/modules/process/templates/_device_changed.php
Executable file
@ -0,0 +1,57 @@
|
||||
<?
|
||||
|
||||
$oldDevice_name = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getDeviceName() : '';
|
||||
$oldDevice_manufacturer = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getManufacturer() : '';
|
||||
$oldDevice_serial = $oldDevice->getSerialNumber();
|
||||
$oldDevice_model = ($oldDevice->getSpecification()) ? $oldDevice->getSpecification()->getModelNumber() : '';
|
||||
?>
|
||||
|
||||
<?php
|
||||
//$_device_name = "<select>";
|
||||
if(!empty($newDevice)){
|
||||
$_device_name .= "<option value='".$newDevice['device_name']."'>".$newDevice['device_name']."</option>";
|
||||
if(!empty($oldDevice_name)){
|
||||
$_device_name .= "<option value='$oldDevice_name'>$oldDevice_name</option>";
|
||||
}
|
||||
}
|
||||
//$_device_name .= "</select>";
|
||||
//print $_device_name;
|
||||
|
||||
|
||||
//$_manufacturer = "<select>";
|
||||
if(!empty($newDevice)){
|
||||
$_manufacturer .= "<option value='".$newDevice['manufacturer']."'>".$newDevice['manufacturer']."</option>";
|
||||
}
|
||||
if(!empty($oldDevice_manufacturer)){
|
||||
$_manufacturer .= "<option value='$oldDevice_manufacturer'>$oldDevice_manufacturer</option>";
|
||||
}
|
||||
//$_manufacturer .= "</select>";
|
||||
//print $_manufacturer;
|
||||
|
||||
|
||||
//$_serial ="<select>";
|
||||
if(!empty($newDevice))
|
||||
$_serial.= "<option value='".$newDevice['serial']."'>".$newDevice['serial']."</option>";
|
||||
if(!empty($oldDevice_serial))
|
||||
$_serial.= "<option value='$oldDevice_serial'>$oldDevice_serial</option>";
|
||||
//$_serial.= "</select>";
|
||||
//print $_serial;
|
||||
|
||||
//$_model = "<select>";
|
||||
if(!empty($newDevice))
|
||||
$_model .= "<option value='".$newDevice['model']."'>".$newDevice['model']."</option>";
|
||||
if(!empty($oldDevice_model))
|
||||
$_model .= "<option value='$oldDevice_model'>$oldDevice_model</option>";
|
||||
//$_model .= "</select>";
|
||||
//print $_model;
|
||||
|
||||
print "
|
||||
{
|
||||
serial: \"$_serial\",
|
||||
model: \"$_model\",
|
||||
manufacturer: \"$_manufacturer\",
|
||||
device_name: \"$_device_name\"
|
||||
}";
|
||||
?>
|
||||
|
||||
|
70
apps/atlbiomed/modules/process/templates/_process_match.php
Executable file
70
apps/atlbiomed/modules/process/templates/_process_match.php
Executable file
@ -0,0 +1,70 @@
|
||||
|
||||
<div>
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>Match (<a href='javascript:void(0);' onclick='toggle_matched()' id='toggle_matched_but'>Show</a>)</div>
|
||||
<div class='innerCont' id='matched_cont' style='display:NONE'>
|
||||
<table id='noMatchTable'>
|
||||
<tr>
|
||||
<td class='partial_match_column_title'>Assoc. Client</td>
|
||||
<td class='partial_match_column_title'>Device ID</td>
|
||||
<td class='partial_match_column_title'>Device Name</td>
|
||||
<td class='partial_match_column_title'>Manufacturer</td>
|
||||
<td class='partial_match_column_title'>Model</td>
|
||||
<td class='partial_match_column_title'>Serial</td>
|
||||
<td class='partial_match_column_title'></td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($match as $partial) { ?>
|
||||
<tr>
|
||||
<td >
|
||||
<select id='new_client_match_<?php print $partial['random_id']; ?>' >
|
||||
<option value='-1' selected='selected'>Existing Client</option>
|
||||
<?php foreach($clients as $client) { ?>
|
||||
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_id_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_name_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['device_name']; ?>'><?php print print $partial['device_name']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='manufacturer_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='model_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='serial_match_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick="saveFullMatchUpdate(<?php print $partial['id']; ?>,<?php print $partial['random_id']; ?>)">
|
||||
|
||||
<input type='hidden' id='location_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
|
||||
<input type='hidden' id='date_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
|
||||
<input type='hidden' id='pass_fail_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
|
||||
<input type='hidden' id='extra_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
|
||||
<input type='hidden' id='test_data_match_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
|
||||
<input type='hidden' id='comments_match_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
86
apps/atlbiomed/modules/process/templates/_process_no_match.php
Executable file
86
apps/atlbiomed/modules/process/templates/_process_no_match.php
Executable file
@ -0,0 +1,86 @@
|
||||
|
||||
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>No Match</div>
|
||||
<div class='innerCont'>
|
||||
<table>
|
||||
<tr>
|
||||
<td class='partial_match_column_title'>Client</td>
|
||||
<td class='partial_match_column_title'>Option</td>
|
||||
<td class='partial_match_column_title'>Device ID</td>
|
||||
<td class='partial_match_column_title' style='width: 130px'>ID Options</td>
|
||||
<td class='partial_match_column_title'>Device Name</td>
|
||||
<td class='partial_match_column_title'>Manufacturer</td>
|
||||
<td class='partial_match_column_title'>Model</td>
|
||||
<td class='partial_match_column_title'>Serial</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php foreach($noMatch as $partial) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<select id='client_<?php print $partial['random_id']; ?>' onChange='updateDevices(<?php print $partial['random_id']; ?>); restoreFields(<?php print $partial['random_id']; ?>)'>
|
||||
<option value='-1' selected='selected'>Select A Client</option>
|
||||
<?php foreach($clients as $client) { ?>
|
||||
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='option_<?php print $partial['random_id']; ?>' onchange='optionChanged(<?php print $partial['random_id']; ?>)'>
|
||||
<option value='1'>Add As New Device</option>
|
||||
<option value='2'>Associate Device</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 100px'>
|
||||
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
|
||||
</select>
|
||||
<select id='get_devices_<?php print $partial['random_id']; ?>' style='width: 100px; display:none' onChange='device_id_changed(<?php print $partial['random_id']; ?>)'>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_id_option_<?php print $partial['random_id']; ?>' style='width: 130px' disabled='disabled'>
|
||||
<option value='-1'>-Use Existing Id-</option>
|
||||
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['device_name']; ?>'><?php print $partial['device_name']; ?></option>
|
||||
</select>
|
||||
<input type='hidden' id='hidden_device_name_<?php print $partial['random_id']; ?>' value='<?php print $partial['device_name']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['manufacturer']; ?>'><?php print $partial['manufacturer']; ?></option>
|
||||
</select>
|
||||
<input type='hidden' id='hidden_manufacturer_<?php print $partial['random_id']; ?>' value='<?php print $partial['manufacturer']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['model']; ?>'><?php print $partial['model']; ?></option>
|
||||
</select>
|
||||
<input type='hidden' id='hidden_model_<?php print $partial['random_id']; ?>' value='<?php print $partial['model']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['serial']; ?>'><?php print $partial['serial']; ?></option>
|
||||
</select>
|
||||
<input type='hidden' id='hidden_serial_<?php print $partial['random_id']; ?>' value='<?php print $partial['serial']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_no_match(<?php print $partial['random_id']; ?>)'>
|
||||
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
|
||||
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
|
||||
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
|
||||
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
|
||||
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
|
||||
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
77
apps/atlbiomed/modules/process/templates/_process_partial_match.php
Executable file
77
apps/atlbiomed/modules/process/templates/_process_partial_match.php
Executable file
@ -0,0 +1,77 @@
|
||||
|
||||
<div>
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>Partial Match</div>
|
||||
<div class='innerCont'>
|
||||
<table id='noMatchTable'>
|
||||
<tr>
|
||||
<td class='partial_match_column_title'>New Client</td>
|
||||
<td class='partial_match_column_title'>Device ID</td>
|
||||
<td class='partial_match_column_title'>Device Name</td>
|
||||
<td class='partial_match_column_title'>Manufacturer</td>
|
||||
<td class='partial_match_column_title'>Model</td>
|
||||
<td class='partial_match_column_title'>Serial</td>
|
||||
<td class='partial_match_column_title'></td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($partialMatch as $partial) { ?>
|
||||
<tr>
|
||||
<td >
|
||||
<select id='new_client_partial_<?php print $partial['random_id']; ?>' >
|
||||
<option value='-1' selected='selected'>Existing Client</option>
|
||||
<?php foreach($clients as $client) { ?>
|
||||
<option value='<?print $client->getId(); ?>'><?print $client->getClientIdentification(); ?></option>>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
<td >
|
||||
<select id='device_id_<?php print $partial['random_id']; ?>' style='width: 120px'>
|
||||
<option value='<?php print $partial['device_id']; ?>'><?php print $partial['device_id']; ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='device_name_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['device_name']==true){ print ";border: 1px solid red";}?>'>
|
||||
<?php foreach($partial['device_name'] as $device_name) { ?>
|
||||
<option value='<?php print $device_name; ?>'><?php print $device_name; ?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='manufacturer_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['manufacturer']==true){ print ";border: 1px solid red";}?>'>
|
||||
<?php foreach($partial['manufacturer'] as $manufacturer) { ?>
|
||||
<option value='<?php print $manufacturer; ?>'><?php print $manufacturer; ?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='model_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['model']==true){ print ";border: 1px solid red";}?>'>
|
||||
<?php foreach($partial['model'] as $model) { ?>
|
||||
<option value='<?php print $model; ?>'><?php print $model; ?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id='serial_<?php print $partial['random_id']; ?>' style='width: 120px<?php if($partial['misMatch']['serial']==true){ print ";border: 1px solid red";}?>'>
|
||||
<?php foreach($partial['serial'] as $serial) { ?>
|
||||
<option value='<?php print $serial; ?>'><?php print $serial; ?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input id='input_<?php print $partial['random_id']; ?>' type='button' value='save' onclick='save_partial_match(<?php print $partial['random_id']; ?>)'>
|
||||
<input type='hidden' id='location_<?php print $partial['random_id']; ?>' value='<?php print $partial['location']; ?>'>
|
||||
<input type='hidden' id='date_<?php print $partial['random_id']; ?>' value='<?php print $partial['date']; ?>'>
|
||||
<input type='hidden' id='pass_fail_<?php print $partial['random_id']; ?>' value='<?php print $partial['pass_fail']; ?>'>
|
||||
<input type='hidden' id='extra_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['extraData']); ?>'>
|
||||
<input type='hidden' id='test_data_<?php print $partial['random_id']; ?>' value='<?php print serialize($partial['testData']); ?>'>
|
||||
<input type='hidden' id='comments_<?php print $partial['random_id']; ?>' value='<?php print $partial['comments']; ?>'>
|
||||
</td>
|
||||
<td>
|
||||
(<?php print $partial['client_name']?>)<?php print $partial['warning'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
3
apps/atlbiomed/modules/process/templates/deviceIdChangedSuccess.php
Executable file
3
apps/atlbiomed/modules/process/templates/deviceIdChangedSuccess.php
Executable file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include_partial('device_changed',array('oldDevice'=>$oldDevice, 'newDevice'=>$newDevice))
|
||||
?>
|
78
apps/atlbiomed/modules/process/templates/generateReportSuccess.php
Executable file
78
apps/atlbiomed/modules/process/templates/generateReportSuccess.php
Executable file
@ -0,0 +1,78 @@
|
||||
<div class='regularCont'>
|
||||
<div class='innerCont'><table>
|
||||
<tr>
|
||||
<td style='width: 100px'>Report
|
||||
</td>
|
||||
<td style='width: 100px'>Status
|
||||
</td>
|
||||
<td style='width: 200px'>
|
||||
Date
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Pass
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Fail
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Missed
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Bp
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Trace
|
||||
</td>
|
||||
<td style='width: 50px'>
|
||||
Outlets
|
||||
</td>
|
||||
<td style='width: 200px'>
|
||||
Action
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach($finalReport as $report){
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a target='_blank' href='/index.php/process/createPdf/id/<?php print $report->getId(); ?>'>View Report</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php print ucwords($report->getPassFail()); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print $report->formattedDate(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalPassed(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalFailed(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalMissed(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalBp(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalTrace(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php print (int)$report->getTotalOutlets(); ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href='javascript:void(0)' onclick='deleteReport(<?php print $report->getId(); ?>,<?php print $report->getClientId(); ?>)' >Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if(empty($finalReport)){
|
||||
?>
|
||||
<tr><td colspan='4'><div style='text-align:center;font-weight:bold;'>No Reports Found</div></td></tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
2
apps/atlbiomed/modules/process/templates/getDevicesSuccess.php
Executable file
2
apps/atlbiomed/modules/process/templates/getDevicesSuccess.php
Executable file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
include_partial('device',array('devices'=>$devices)); ?>
|
44
apps/atlbiomed/modules/process/templates/indexSuccess.php
Executable file
44
apps/atlbiomed/modules/process/templates/indexSuccess.php
Executable file
@ -0,0 +1,44 @@
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>New File Upload</div>
|
||||
<div class='innerCont'>
|
||||
<form name='uploadForm' id='uploadForm' action='process/processUpload' method='post' enctype='multipart/form-data'>
|
||||
<input type='file' name='upload'>
|
||||
<input type='submit' name='submit' value='Upload'>
|
||||
<input type='button' name='unprocessed' value='View Unprocessed' onclick="document.location='/index.php/unprocessed/index'">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iframe name='iframe' id='iframe' width="0" height="0" border="0" style='visibility:hidden'>
|
||||
</iframe>
|
||||
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>Reporting</div>
|
||||
<div class='innerCont'>
|
||||
<table style='margin: 4px;float:left'>
|
||||
<tr><td>Client</td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo select_tag('client', options_for_select($clients, $client_id,'include_custom=Please Select a Client'), array('id'=>'current_client','onchange'=>'process_client_change()') );?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>Contact</td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type='text' value='' id='theContact'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style='float:left; margin-left:20px;'>
|
||||
<tr><td> <div id='listedReport'></div>
|
||||
</td></tr></table>
|
||||
<div style='clear:both'></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id='listedDevices'>
|
||||
</div>
|
||||
|
140
apps/atlbiomed/modules/process/templates/listDevicesSuccess.php
Executable file
140
apps/atlbiomed/modules/process/templates/listDevicesSuccess.php
Executable file
@ -0,0 +1,140 @@
|
||||
<br><br>
|
||||
<div class='regularCont'>
|
||||
<div class='titleBar'>Client Devices</div>
|
||||
<div class='innerCont'>
|
||||
|
||||
<div >
|
||||
<? if(!empty($devices)){?>
|
||||
<input type='button' value='Quote Failed Item' onclick='quoted()'>
|
||||
<input type='button' value='Pending Repairs' onClick='pendingRepair()'>
|
||||
<input type='button' value='Schedule Repair' onClick="scheduleRepair(<?php print $client_id;?>)">
|
||||
<input type='button' value='Reschedule Missing' onClick="rescheduleMissing(<?php print $client_id;?>)">
|
||||
<input type='button' value='Print Final Report' onClick="generateReport()">
|
||||
<? }else{
|
||||
?>
|
||||
<input type='button' value='Quote Failed Item' disabled='disabled'>
|
||||
<input type='button' value='Pending Repairs' disabled='disabled'>
|
||||
<input type='button' value='Schedule Repair' disabled='disabled'>
|
||||
<input type='button' value='Reschedule Missing' disabled='disabled'>
|
||||
<input type='button' value='Print Final Report' disabled='disabled'>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<br/>
|
||||
<table style='margin-left: 30px;'>
|
||||
|
||||
<tr>
|
||||
<td style='width: 20px; font-weight:bold'>
|
||||
|
||||
</td>
|
||||
<td style='width:150px; font-weight:bold'>
|
||||
Device Id
|
||||
</td>
|
||||
<td style='width:150px; font-weight:bold'>
|
||||
Device
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Manufacturer
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Model
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Serial
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Location
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Status
|
||||
</td>
|
||||
<td style='width:150px;font-weight:bold'>
|
||||
Comments
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$listDeviceIdAr = array();
|
||||
|
||||
foreach($devices as $device){
|
||||
if($device->getSpecification()){
|
||||
$manufacturer = $device->getSpecification()->getManufacturer();
|
||||
$model = $device->getSpecification()->getModelNumber();
|
||||
$d_name = $device->getSpecification()->getDeviceName();
|
||||
}
|
||||
|
||||
$listDeviceIdAr[] = $device->getId();
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<input type='checkbox' id='checkbox_<?php print $device->getId(); ?>' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='device_' value='<?php print $device->getIdentification(); ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='dd_name_' value='<?php print $d_name; ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='manufacturer_' value='<?php print $manufacturer; ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' value='<?php print $model; ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' value='<?php print $device->getSerialNumber(); ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' value='<?php print $device->getLocation(); ?>'/>
|
||||
</td>
|
||||
<td>
|
||||
<select style='width: 140px'>
|
||||
<option value='<?php print ucwords($device->getStatus()); ?>'/><?php print ucwords($device->getStatus()); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='device_comment_' value='<?php print $device->getComments(); ?>' onblur='save_comments(this,<?php print $device->getId(); ?>)'/>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
if(empty($devices)){
|
||||
?><td>
|
||||
<!--checkboxes would be here -->
|
||||
</td>
|
||||
<tr>
|
||||
<td>
|
||||
<input type='checkbox' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='device_' value=' '/>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='dd_name_' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='manufacturer_' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='serial_' />
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='device_comment_' />
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<input type='hidden' id='hidden_device_id' value='<?php print implode(',',$listDeviceIdAr); ?>'/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.insertContact('<?php print $contact; ?>');
|
||||
</script>
|
22
apps/atlbiomed/modules/process/templates/processUploadSuccess.php
Executable file
22
apps/atlbiomed/modules/process/templates/processUploadSuccess.php
Executable file
@ -0,0 +1,22 @@
|
||||
<div style='font-size: 13px; width: 300px; border: 1px solid black; margin-top: 30px;'>
|
||||
<div style='color: #fff; background-color:#08C46E ; font-weight: bold; text-align:center'> UPLOAD STATUS </div>
|
||||
<div style='padding: 5px;'>
|
||||
<?php
|
||||
print "<b>Filename</b>: ".$filename." <br/>";
|
||||
print "<b>Total Uploaded</b>: ".(count($match)+count($partialMatch)+count($noMatch))." <br/>";
|
||||
print "<b>Matched</b>: ".count($match)."<br/>";
|
||||
print "<b>Partial Match</b>: ".count($partialMatch)."<br/>";
|
||||
print "<b>No Match</b>: ".count($noMatch)."<br/>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' name='filename' id='filename' value='<?php echo $filename; ?>'/>
|
||||
<div id='test'></div>
|
||||
<?php
|
||||
if(!empty($match))
|
||||
include_partial('process_match', array('match' => $match, 'clients'=>$clients));
|
||||
if(!empty($partialMatch))
|
||||
include_partial('process_partial_match', array('partialMatch' => $partialMatch));
|
||||
if(!empty($noMatch))
|
||||
include_partial('process_no_match', array('noMatch' => $noMatch, 'clients'=>$clients));
|
||||
?>
|
Reference in New Issue
Block a user