public function indexAction()
 {
     $form = new MedicineForm();
     $form->addElementsForm();
     $form->setDecorators(array('FormElements', 'Form'));
     $form->removeDecorator('form');
     $this->view->medicine = $form;
     $formStockControl = new MedicineForm();
     $formStockControl->addElementsStockControl();
     $formStockControl->setDecorators(array('FormElements', 'Form'));
     $formStockControl->removeDecorator('form');
     $this->view->medicinestockcontrol = $formStockControl;
     $formExistantStock = new MedicineForm();
     $formExistantStock->addElementsExistantStock();
     $formExistantStock->setDecorators(array('FormElements', 'Form'));
     $formExistantStock->removeDecorator('form');
     $this->view->medicineexistantstock = $formExistantStock;
     //options dos campos select
     $measurementunitModel = new MeasurementunitModel();
     $selectMeasurementunit = $measurementunitModel->fetchAll();
     $supplyModel = new SupplyModel();
     $selectSupply = $supplyModel->fetchAll($supplyModel->getSupplyNotInMedicine());
     $supplycentreModel = new SupplycentreModel();
     $selectSupplycentre = $supplycentreModel->fetchAll();
     $supplierModel = new SupplierModel();
     $selectSupplier = $supplierModel->fetchAll();
     $this->view->selectMeasurementunit = $selectMeasurementunit;
     $this->view->selectSupply = $selectSupply;
     $this->view->selectSupplycentre = $selectSupplycentre;
     $this->view->selectSupplier = $selectSupplier;
 }
 public function indexAction()
 {
     $measurementunitModel = new MeasurementunitModel();
     $measurementunitData = $measurementunitModel->fetchAll($measurementunitModel->getAllMeasurementUnit());
     $this->view->measurementunitData = $measurementunitData;
     $attributeModel = new AttributeModel();
     $attributeData = $attributeModel->fetchAll($attributeModel->getAllAtribute());
     $this->view->attributeData = $attributeData;
     //        $controllerName = $this->getRequest()->getControllerName();
     //        $actionName = $this->getRequest()->getActionName();
     //        $cdwindow = $this->getCdWindow($controllerName,$actionName);
     //        $_SESSION['cdwindow']=$cdwindow;
 }
 public function dadosAction()
 {
     /* Unidades de Medida */
     $MUModel = new MeasurementunitModel();
     $MU = $MUModel->fetchRow($MUModel->getDescriptionMeasurementUnit($_GET['id']));
     $selectedMU = $MU['idnotation'];
     /* //// */
     /* Valor Unitário */
     $ValueModel = new SupplysupplierModel();
     $Value = $ValueModel->fetchRow($ValueModel->getAllSupplySupplierBySupply($_GET['id']));
     $selectedValue = $Value['vlunitprice'];
     /* //// */
     /* Código do Item */
     $SupplyModel = new SupplyModel();
     $Supply = $SupplyModel->fetchRow($SupplyModel->getSupplyByCdSupply($_GET['id']));
     $selectedSupply = $Supply['idsupply'];
     $this->view->dados = $selectedMU . "|||" . $selectedSupply . "|||" . $selectedValue;
     /* //// */
 }
 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");
     $measurementunitModel = new MeasurementunitModel();
     $measurementunit = $measurementunitModel->fetchAll();
     $count = count($measurementunit);
     if ($count > 0 && $limit > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $measurementunit = $measurementunitModel->fetchAll(null, "{$sidx} {$sord}", $limit, $page * $limit - $limit);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     foreach ($measurementunit as $rows) {
         switch ($rows->fgactive) {
             case '1':
                 $fgactive = 'Ativo';
                 break;
             case '2':
                 $fgactive = 'Inativo';
                 break;
         }
         $responce->rows[$i]['cell'] = array($rows->cdmeasurementunit, $rows->idnotation, $rows->nmmeasurementunit, $fgactive);
         $i++;
     }
     //   print_r($responce); die;
     $this->view->dados = $responce;
 }
 public function alterAction()
 {
     $cdsupply = $this->_request->getParam("cdsupply");
     $modelSupplyType = new SupplytypeModel();
     $supplyTypeData = $modelSupplyType->fetchAll($modelSupplyType->getAllSupplytype());
     $this->view->supplyTypeData = $supplyTypeData;
     $modelMeasureMentunit = new MeasurementunitModel();
     $measureMentunitData = $modelMeasureMentunit->fetchAll($modelMeasureMentunit->getAllMeasurementUnit());
     $this->view->measureMentunitData = $measureMentunitData;
     $modelSupplyflowtype = new SupplyflowtypeModel();
     $SupplyflowtypeData = $modelSupplyflowtype->fetchAll($modelSupplyflowtype->getAllSupplyFlowType());
     $this->view->supplyflowtypeData = $SupplyflowtypeData;
     $modelsupplysupplyflowtype = new SupplysupplyflowtypeModel();
     $supplysupplyflowtype = $modelsupplysupplyflowtype->fetchAll($modelsupplysupplyflowtype->getSupplySupplyFlowTypeByCdSupply($cdsupply));
     $this->view->supplysupplyflowtype = $supplysupplyflowtype;
     $modelSupply = new SupplyModel();
     $supplyData = $modelSupply->fetchRow($modelSupply->getSupplyFlowTypeByCdSupply($cdsupply));
     $this->view->supply = $supplyData;
     // print_r($supplyData); die;
 }
示例#6
0
 public function __construct()
 {
     parent::__construct();
     $measurementunitModel = new MeasurementunitModel();
     $measurementunitData = $measurementunitModel->fetchAll($measurementunitModel->getAllMeasurementUnit());
     $this->_idattribute = new Zend_Form_Element_Text('idattribute');
     $this->_idattribute->setDecorators($this->_decoratorsDefault);
     $this->_idattribute->setAttrib("id", "attribute_idattribute ");
     $this->_idattribute->setRequired(true);
     $this->_nmattribute = new Zend_Form_Element_Text('nmattribute');
     $this->_nmattribute->setDecorators($this->_decoratorsDefault);
     $this->_nmattribute->setAttrib("id", "attribute_nmattribute");
     $this->_nmattribute->setAttrib("class", "numeric");
     $this->_nmattribute->setRequired(true);
     $this->_fgdatatype = new Zend_Form_Element_Select('fgdatatype');
     $this->_fgdatatype->setRegisterInArrayValidator(false);
     $this->_fgdatatype->addMultiOptions(array('1' => 'Texto', '2' => 'Decimal', '3' => 'Inteiro', '4' => 'Data'));
     $this->_fgdatatype->setDecorators($this->_decoratorsDefault);
     $this->_fgdatatype->setAttrib("id", "attribute_fgdatatype");
     $this->_fgdatatype->setRequired(false);
     $this->_nrminvalue = new Zend_Form_Element_Text('nrminvalue');
     $this->_nrminvalue->setDecorators($this->_decoratorsDefault);
     $this->_nrminvalue->setAttrib("id", "attribute_nrminvalue");
     $this->_nrminvalue->setRequired(false);
     $this->_cdattribute = new Zend_Form_Element_Text('cdattribute');
     $this->_cdattribute->setDecorators($this->_decoratorsDefault);
     $this->_cdattribute->setAttrib("id", "attribute_cdattribute");
     $this->_cdattribute->setRequired(false);
     $this->_vlminvalue = new Zend_Form_Element_Text('vlminvalue');
     $this->_vlminvalue->setDecorators($this->_decoratorsDefault);
     $this->_vlminvalue->setAttrib("id", "attribute_vlminvalue");
     $this->_vlminvalue->setRequired(false);
     $this->_vlmaxvalue = new Zend_Form_Element_Text('vlmaxvalue');
     $this->_vlmaxvalue->setDecorators($this->_decoratorsDefault);
     $this->_vlmaxvalue->setAttrib("id", "attribute_vlmaxvalue");
     $this->_vlmaxvalue->setRequired(false);
     $this->_dtminvalue = new Zend_Form_Element_Text('dtminvalue');
     $this->_dtminvalue->setDecorators($this->_decoratorsDefault);
     $this->_dtminvalue->setAttrib("id", "attribute_dtminvalue");
     $this->_dtminvalue->setRequired(false);
     $this->_dtmaxvalue = new Zend_Form_Element_Text('dtmaxvalue');
     $this->_dtmaxvalue->setDecorators($this->_decoratorsDefault);
     $this->_dtmaxvalue->setAttrib("id", "attribute_dtmaxvalue");
     $this->_dtmaxvalue->setRequired(false);
     $this->_nmstandardvalue = new Zend_Form_Element_Text('nmstandardvalue');
     $this->_nmstandardvalue->setDecorators($this->_decoratorsDefault);
     $this->_nmstandardvalue->setAttrib("id", "attribute_nmstandardvalue");
     $this->_nmstandardvalue->setRequired(false);
     $this->_nrmaxvalue = new Zend_Form_Element_Text('nrmaxvalue');
     $this->_nrmaxvalue->setDecorators($this->_decoratorsDefault);
     $this->_nrmaxvalue->setAttrib("id", "attribute_nrmaxvalue");
     $this->_nrmaxvalue->setRequired(false);
     $this->_cdmeasurementunit = new Zend_Form_Element_Select('cdmeasurementunit');
     $this->_cdmeasurementunit->setRegisterInArrayValidator(false);
     foreach ($measurementunitData as $measurementunit) {
         $this->_cdmeasurementunit->addMultiOption($measurementunit->cdmeasurementunit, $measurementunit->nmmeasurementunit);
     }
     $this->_cdmeasurementunit->setDecorators($this->_decoratorsRequired);
     $this->_cdmeasurementunit->setAttrib("id", "attribute_cdmeasurementunit");
     $this->_cdmeasurementunit->setRequired(true);
 }
示例#7
0
 public function __construct()
 {
     parent::__construct();
     $measurementunitModel = new MeasurementunitModel();
     $measurementunitDadosArray = $measurementunitModel->fetchAll();
     $supplycentreModel = new SupplycentreModel();
     $supplycentreDadosArray = $supplycentreModel->fetchAll();
     $supplierModel = new SupplierModel();
     $supplierDadosArray = $supplierModel->fetchAll();
     $supplyModel = new SupplyModel();
     $supplyDados = $supplyModel->fetchAll($supplyModel->getSupplyNotInMedicine());
     //Cód. medicamento
     $this->_idmedicine = new Zend_Form_Element_Text('idmedicine');
     $this->_idmedicine->setLabel("Cód. Medicamento");
     $this->_idmedicine->setDecorators($this->_decoratorsRequired);
     $this->_idmedicine->setAttrib("size", "11");
     $this->_idmedicine->setRequired(true);
     //Nome/Descrição do Medicamento
     $this->_nmmedicine = new Zend_Form_Element_Text('nmmedicine');
     $this->_nmmedicine->setLabel("Nome/Descrição do Medicamento");
     $this->_nmmedicine->setDecorators($this->_decoratorsRequired);
     $this->_nmmedicine->setAttrib("id", "nmcenter");
     $this->_nmmedicine->setAttrib("size", "35");
     $this->_nmmedicine->setRequired(true);
     //Princípio Ativo
     $this->_nmactive = new Zend_Form_Element_text('nmactive');
     $this->_nmactive->setLabel("Princípio Ativo");
     $this->_nmactive->setDecorators($this->_decoratorsDefault);
     $this->_nmactive->setAttrib("size", "35");
     //Unidade de Medida
     $this->_cdmeasurementunit = new Zend_Form_Element_select('cdmeasurementunit');
     $this->_cdmeasurementunit->addMultiOption("", "Selecione");
     foreach ($measurementunitDadosArray as $measurementunitDado) {
         $this->_cdmeasurementunit->addMultiOption($measurementunitDado->cdmeasurementunit, $measurementunitDado->idnotation);
     }
     $this->_cdmeasurementunit->setLabel("Unidade de Medida");
     $this->_cdmeasurementunit->setDecorators($this->_decoratorsRequired);
     $this->_cdmeasurementunit->setAttrib("class", "search_combobox");
     $this->_cdmeasurementunit->setRequired(true);
     //Item do Estoque
     $this->_cdsupplymedicine = new Zend_Form_Element_select('cdsupply');
     $this->_cdsupplymedicine->addMultiOption("", "Selecione");
     foreach ($supplyDados as $supply) {
         $this->_cdsupplymedicine->addMultiOption($supply->cdsupply, $supply->nmsupply);
     }
     $this->_cdsupplymedicine->setLabel("Item");
     $this->_cdsupplymedicine->setDecorators($this->_decoratorsDefault);
     $this->_cdsupplymedicine->setAttrib("id", "cdsupplymedicine");
     $this->_cdsupplymedicine->setAttrib("class", "search_combobox");
     //Quantidade do Item
     $this->_nrsupplyquantity = new Zend_Form_Element_text('nrsupplyquantity');
     $this->_nrsupplyquantity->setLabel("Quantidade");
     $this->_nrsupplyquantity->setDecorators($this->_decoratorsDefault);
     $this->_nrsupplyquantity->setAttrib("size", "10");
     $this->_nrsupplyquantity->setAttrib("disabled", "disabled");
     $this->_nrsupplyquantity->setAttrib("class", "numeric");
     //Valor da unidade
     $this->_vlsupplyunit = new Zend_Form_Element_text('vlsupplyunit');
     $this->_vlsupplyunit->setLabel("Valor Unit.");
     $this->_vlsupplyunit->setDecorators($this->_decoratorsDefault);
     $this->_vlsupplyunit->setAttrib("size", "10");
     $this->_vlsupplyunit->setAttrib("disabled", "disabled");
     $this->_vlsupplyunit->setAttrib("class", "mask_price");
     $this->_cdsupplycentre = new Zend_Form_Element_select('cdsupplycentre');
     $this->_cdsupplycentre->addMultiOption("", "Selecione");
     foreach ($supplycentreDadosArray as $supplycentre) {
         $this->_cdsupplycentre->addMultiOption($supplycentre->cdsupplycentre, $supplycentre->idsupplycentre);
     }
     $this->_cdsupplycentre->setLabel("Centro");
     $this->_cdsupplycentre->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplycentre->setAttrib("class", "search_combobox");
     $this->_cdsupplier = new Zend_Form_Element_select('cdsupplier');
     $this->_cdsupplier->addMultiOption("", "Selecione");
     foreach ($supplierDadosArray as $supplier) {
         $this->_cdsupplier->addMultiOption($supplier->cdsupplier, $supplier->nmsupplier);
     }
     $this->_cdsupplier->setLabel("Fornecedor");
     $this->_cdsupplier->setDecorators($this->_decoratorsRequired);
     $this->_cdsupplier->setAttrib("class", "search_combobox");
 }