public function examinationmaterialAction()
 {
     $cdmaterial = $this->_request->getParam("cdmaterial");
     $cdexaminationmaterial = $this->_request->getParam("cdexaminationmaterial");
     $examinationModel = new ExaminationModel();
     $examinationmaterialModel = new ExaminationmaterialModel();
     $materialModel = new MaterialModel();
     $attributeModel = new AttributeModel();
     $attributeEMModel = new attributeexaminationmaterialModel();
     $physicallocationModel = new PhysicallocationModel();
     $timeFrameModel = new TimeframeModel();
     $equipmentModel = new EquipmentModel();
     $supplyModel = new SupplyModel();
     $supplyCentreModel = new SupplycentreModel();
     if (isset($cdmaterial) && $cdmaterial != 0) {
         $dataMaterial = $materialModel->fetchRow($materialModel->getMaterialByCd($cdmaterial));
         $nmmaterial = $dataMaterial["nmmaterial"];
         $this->view->examinationmaterialCDmaterial = $cdmaterial;
         $this->view->examinationmaterialNMmaterial = $nmmaterial;
     }
     if (isset($cdexaminationmaterial) && $cdexaminationmaterial != 0) {
         $fginterfacingvalue = $examinationmaterialModel->fetchRow($examinationmaterialModel->getFGInterfacingByExaminationMaterial($cdexaminationmaterial));
         $this->addInterfaceCheckbox($fginterfacingvalue['fginterfacing']);
         $this->view->cdexaminationmaterial = $cdexaminationmaterial;
     } else {
         $this->addInterfaceCheckbox('2');
     }
     $subexaminationData = $examinationModel->fetchAll();
     $this->view->subexaminationData = $subexaminationData;
     $materialData = $materialModel->fetchAll();
     $this->view->materialData = $materialData;
     // GET attributos relacionados ao material
     $attributeData = $attributeEMModel->fetchAll($attributeEMModel->getAttributeExaminationMaterial($cdexaminationmaterial));
     $this->view->attributeData = $attributeData;
     $physicallocationParentData = $physicallocationModel->getParentLocation();
     $this->view->parentlocationData = $physicallocationParentData;
     $physicallocationChildData = $physicallocationModel->getLocationByParentNotNull();
     $this->view->parentlocationData = $physicallocationChildData;
     $timeFrameData = $timeFrameModel->fetchAll($timeFrameModel->getAllTimeFrames());
     $this->view->timeFrameData = $timeFrameData;
     $equipmentData = $equipmentModel->fetchAll();
     $this->view->equipmentData = $equipmentData;
     $itemData = $supplyModel->fetchAll();
     $this->view->itemMaterialData = $itemData;
     $supplyCentreData = $supplyCentreModel->fetchAll();
     $this->view->supplyCentreData = $supplyCentreData;
 }
예제 #2
0
 public function alterAction()
 {
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $supplyData = $supplyModel->fetchAll('cdsupply = "1"');
     $this->view->equipmentdata = $equipmentData;
     $this->view->documentdata = $documentData;
     $this->view->supplydata = $supplyData;
     $cdmethod = $this->_request->getParam("cdmethod");
     if (isset($cdmethod)) {
         $methodModel = new MethodModel();
         $dataMethod = $methodModel->fetchRow($methodModel->getMethodByCd($cdmethod));
         $this->view->dataMethod = $dataMethod;
     }
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct();
     $equipmentModel = new EquipmentModel();
     $documentModel = new DocumentModel();
     $supplyModel = new SupplyModel();
     $equipmentData = $equipmentModel->fetchAll($equipmentModel->getShortEquipmentData());
     $arrayEquipmentData = array();
     $arrayEquipmentData[0] = "Selecione";
     foreach ($equipmentData as $equipmentdata) {
         $arrayEquipmentData[$equipmentdata->cdequipment] = $equipmentdata->nmequipment;
     }
     $documentData = $documentModel->fetchAll($documentModel->getShortDocumentData());
     $arrayDocumentData = array();
     $arrayDocumentData[0] = "Selecione";
     foreach ($documentData as $documentdata) {
         $arrayDocumentData[$documentdata->cddocument] = $documentdata->nmdocument;
     }
     $supplyData = $supplyModel->fetchAll();
     $arraysupplyData = array();
     $arraysupplyData[0] = "Selecione";
     foreach ($supplyData as $supplydata) {
         $arraysupplyData[$supplydata->cdsupply] = $supplydata->nmsupply;
     }
     $this->_cdmethod = new Zend_Form_Element_Hidden('cdmethod');
     $this->_cdmethod->setAttrib("id", "method_cdmethod");
     //        $this->_cdmethod->setDecorators($this->_decoratorsDefault);
     $this->_cdmethod->setRequired(false);
     $this->_idmethod = new Zend_Form_Element_Text('idmethod');
     $this->_idmethod->setAttrib("id", "method_idmethod");
     $this->_idmethod->setAttrib("size", "15");
     $this->_idmethod->setLabel("ID do Método");
     $this->_idmethod->setDecorators($this->_decoratorsRequired);
     $this->_idmethod->setRequired(true);
     $this->_nmmethod = new Zend_Form_Element_Text('nmmethod');
     $this->_nmmethod->setAttrib("id", "method_nmmethod");
     $this->_nmmethod->setAttrib("size", "58");
     $this->_nmmethod->setLabel("Nome/Descrição do Método");
     $this->_nmmethod->setDecorators($this->_decoratorsRequired);
     $this->_nmmethod->setRequired(true);
     $this->_selectequipment = new Zend_Form_Element_Select('cdequipment');
     $this->_selectequipment->setAttrib("id", "method_select_equipment");
     $this->_selectequipment->setMultiOptions($arrayEquipmentData);
     $this->_selectequipment->setLabel("Equipamento");
     $this->_selectequipment->setDecorators($this->_decoratorsDefault);
     $this->_selectequipment->setRegisterInArrayValidator(true);
     $this->_selectequipment->setRequired(true);
     $this->_selectdocument = new Zend_Form_Element_Select('cddocument');
     $this->_selectdocument->setAttrib("id", "method_select_document");
     $this->_selectdocument->setMultiOptions($arrayDocumentData);
     $this->_selectdocument->setLabel("Documento Relacionado");
     $this->_selectdocument->setDecorators($this->_decoratorsDefault);
     $this->_selectdocument->setRegisterInArrayValidator(true);
     $this->_selectdocument->setRequired(true);
     $this->_samplesize = new Zend_Form_Element_Text('nrsamplesize');
     $this->_samplesize->setAttrib("id", "method_nmsamplesize");
     $this->_samplesize->setAttrib("size", "15");
     $this->_samplesize->setLabel("Tamanho do Ciclo");
     $this->_samplesize->setDecorators($this->_decoratorsDefault);
     $this->_samplesize->setRequired(false);
     $this->_procediment = new Zend_Form_Element_Textarea('dsmethodprocedure');
     $this->_procediment->setAttrib("id", "method_procediment");
     $this->_procediment->setLabel("Procedimento do Método");
     $this->_procediment->setDecorators($this->_decoratorsDefault);
     $this->_procediment->setRequired(false);
     //        $this->_procediment->setValue("boo");
     // Formulário da Grid
     $this->_typecenter = new Zend_Form_Element_Select('typecenter');
     $this->_typecenter->setAttrib("id", "methodsupply_select");
     $this->_typecenter->setMultiOptions($arraysupplyData);
     $this->_typecenter->setLabel("Item (Kit de Exame) ");
     $this->_typecenter->setDecorators($this->_decoratorsDefault);
     $this->_typecenter->setRegisterInArrayValidator(true);
     $this->_typecenter->setRequired(true);
     $this->_nrpriority = new Zend_Form_Element_Text('nrpriority');
     $this->_nrpriority->setAttrib("id", "methodsupply_nrpriority");
     $this->_nrpriority->setAttrib("size", "15");
     $this->_nrpriority->setLabel("Prioridade");
     $this->_nrpriority->setDecorators($this->_decoratorsDefault);
     $this->_nrpriority->setRequired(false);
 }
 public function dadosAction()
 {
     $this->_helper->layout->disableLayout();
     $page = $this->_request->getParam("page", 1);
     $limit = $this->_request->getParam("rows");
     $sidx = $this->_request->getParam("sidx", 1);
     $sord = $this->_request->getParam("sord");
     $equipModel = new EquipmentModel();
     $supplierModel = new SupplierModel();
     $servicesModel = new ServiceModel();
     $equip = $equipModel->fetchAll();
     $count = count($equip);
     if ($count > 0 && $limit != 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     // $supplycentre = $centerModel->fetchAll(null, "$sidx $sord", $limit, ($page*$limit-$limit));
     $response = new stdClass();
     $response->page = $page;
     $response->total = $total_pages;
     $response->records = $count;
     $i = 0;
     foreach ($equip as $row) {
         /* PEGA ÚLTIMO SERVIÇO */
         $ServiceEquip = $servicesModel->getLastService($row->cdequipment);
         $CalibEquip = $servicesModel->getLastCalib($row->cdequipment);
         $ManutEquip = $servicesModel->getLastManut($row->cdequipment);
         $ServiceSupplier = $ServiceEquip['nmsupplier'];
         $ServiceCalibDate = $CalibEquip['dtservice'];
         $ServiceManutSupplier = $ManutEquip['dtservice'];
         /*$CalibDate = new Zend_Date($ServiceCalibDate, 'YYYY-MM-dd HH:mm:ss');
           $CalibDate = $CalibDate->toString('dd-MM-YYYY');
           
           $ManutDate = new Zend_Date($ServiceManutSupplier, 'YYYY-MM-dd HH:mm:ss');
           $ManutDate = $ManutDate->toString('dd-MM-YYYY');*/
         /* PEGA O FABRICANTE */
         $SupplierEquip = $supplierModel->getNameSupplierByCd($row->cdsupplier);
         $supplier = $SupplierEquip->nmsupplier;
         //$response->rows[$i]['cdsupplier'] = $row->cdsupplier;
         $response->rows[$i]['cell'] = array($row->cdequipment, $row->idequipment, $row->nmequipment, $supplier, $ServiceSupplier, $ServiceManutSupplier, $ServiceCalibDate);
         $i++;
     }
     $this->view->dados = $response;
 }