public function viewdataexaminationmaterialAction() { $cdmaterial = $this->_request->getParam("cdmaterial"); $cdexaminationmaterial = $this->_request->getParam("cdexaminationmaterial"); $examinationModel = new ExaminationModel(); $materialModel = new MaterialModel(); $attributeModel = new attributeModel(); $attributeEMModel = new attributeexaminationmaterialModel(); $physicallocationModel = new PhysicallocationModel(); $timeFrameModel = new TimeframeModel(); $dataMaterial = $materialModel->fetchRow($materialModel->getMaterialByCd($cdmaterial)); $nmmaterial = $dataMaterial["nmmaterial"]; $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; $examinationData = $examinationModel->fetchAll($examinationModel->getByAttributeExaminationMaterial()); $this->view->timeFrameData = $examinationData; $this->view->examinationmaterialCDmaterial = $cdmaterial; $this->view->examinationmaterialNMmaterial = $nmmaterial; }
public function __construct() { parent::__construct(); $physicallocationModel = new PhysicallocationModel(); $physicallocationData = $physicallocationModel->fetchAll(); $physicallocationArray = $physicallocationData; $centerModel = new CompanyModel(); $centerDadosArray = $centerModel->fetchAll(); $this->_cdsupplycentre = new Zend_Form_Element_Text('cdsupplycentre'); $this->_cdsupplycentre->setLabel("Código"); $this->_cdsupplycentre->setDecorators($this->_decoratorsDefault); $this->_cdsupplycentre->setAttrib("id", "center_cdsupplycentre"); $this->_cdsupplycentre->setRequired(false); $this->_idsupplycentre = new Zend_Form_Element_Text('idsupplycentre'); $this->_idsupplycentre->setLabel("Nome"); $this->_idsupplycentre->setDecorators($this->_decoratorsDefault); $this->_idsupplycentre->setAttrib("id", "center_idsupplycentre"); $this->_idsupplycentre->setRequired(false); $this->_fgsupplycentretype = new Zend_Form_Element_Select('fgsupplycentretype'); $this->_fgsupplycentretype->setLabel("Tipo"); $this->_fgsupplycentretype->addMultiOptions(array("" => "Selecione", "1" => "Consumo", "2" => "Empréstimo", "3" => "Devolução", "4" => "Estocagem", "5" => "Descarte")); $this->_fgsupplycentretype->setDecorators($this->_decoratorsDefault); $this->_fgsupplycentretype->setRequired(false); $this->_fgsupplycentretype->setAttrib("id", "center_fgsupplycentretype"); $this->_cdcompany = new Zend_Form_Element_Select('cdcompany'); $this->_cdcompany->setLabel("Unidade"); $this->_cdcompany->addMultiOption("", "Selecione"); foreach ($centerDadosArray as $centerDado) { $this->_cdcompany->addMultiOption($centerDado->cdcompany, $centerDado->nmcompany); } $this->_cdcompany->setAttrib("id", "center_cdcompany"); $this->_cdcompany->setDecorators($this->_decoratorsDefault); $this->_cdcompany->setRequired(false); $this->_cdphysicallocation = new Zend_Form_Element_Select('cdphysicallocation'); $this->_cdphysicallocation->setLabel("Localização Física"); $this->_cdphysicallocation->addMultiOption("", "Selecione"); foreach ($physicallocationArray as $arrayphysicallocation) { $this->_cdphysicallocation->addMultiOption($arrayphysicallocation->cdphysicallocation, $arrayphysicallocation->nmphysicallocation); } $this->_cdphysicallocation->setDecorators($this->_decoratorsRequired); $this->_cdphysicallocation->setAttrib("id", "center_cdphysicallocation"); $this->_cdphysicallocation->setAttrib("class", "alpha"); $this->_cdphysicallocation->setRequired(false); }
public function locationlistAction() { $cdcompany = $this->_request->getParam('cdcompany'); $PhysicallocationModel = new PhysicallocationModel(); $location = array(); if (isset($cdcompany)) { foreach ($PhysicallocationModel->getLocationById($cdcompany) as $row) { $location[] = array($row->cdphysicallocation, $row->nmphysicallocation); } } $this->view->PhysicallocationList = $location; }
public function dataafilliatesphysycallocationAction() { $cdphysicallocation = $this->_request->getParam('cdphysicallocation'); $physicallocationModel = new PhysicallocationModel(); $physicallocationData = $physicallocationModel->getLocationByIdPhysical($cdphysicallocation); $i = 0; foreach ($physicallocationData as $row) { $responce->rows[$i]['cell'] = array($row->nmphysicallocation, $row->nmcolor, $row->cdphysicallocation, $row->nmphysicallocation); $i++; } $this->view->dataafilliatesphysycallocation = $responce; }
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"); $centerModel = new CenterModel(); $supplycentre = $centerModel->fetchAll(); $count = count($supplycentre); 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); $responce = new stdClass(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; $i = 0; $companyModel = new CompanyModel(); $physicallocationModel = new PhysicallocationModel(); foreach ($supplycentre as $row) { $fgtype = ''; switch ($row->fgsupplycentretype) { case 1: $fgtype = 'Estocagem'; break; case 2: $fgtype = 'Consumo'; break; } $fgactive = ''; switch ($row->fgactive) { case 1: $fgactive = 'Ativo'; break; case 2: $fgactive = 'Inativo'; break; } $company = ''; $physicallocation = ''; $responce->rows[$i]['cdsupplycentre'] = $row->cdsupplycentre; if ($row->cdcompany != '' && $row->cdcompany != null) { $nmcompany = $companyModel->getNmCopanyByCdCompany($row->cdcompany); $company = $nmcompany->nmcompany; } if ($row->cdphysicallocation != null && $row->cdphysicallocation != '') { $nmphysicallocation = $physicallocationModel->getColorParentPhysicallocation($row->cdphysicallocation); $physicallocation = $nmphysicallocation->nmphysicallocation; } $responce->rows[$i]['cell'] = array($row->cdsupplycentre, $row->idsupplycentre, $fgtype, $company, $physicallocation, $fgactive, $row->cdcompany, $row->cdphysicallocation, $row->fgsupplycentretype); $i++; } $this->view->dados = $responce; }