public function dadossupplysupplierAction()
 {
     $modelsupplysupplierModel = new SupplysupplierModel();
     $cdsupply = $this->_request->getParam("cdsupply");
     $supplyData = $modelsupplysupplierModel->fetchAll($modelsupplysupplierModel->getSupplySupplierCdSupply($cdsupply));
     //        var_dump($supplyData);
     //        die();
     $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");
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = 10;
     $responce->records = 10;
     $i = 0;
     foreach ($supplyData as $row) {
         $data = $row->dtnegotiation;
         $data = substr($data, 8, 2) . '/' . substr($data, 5, 2) . '/' . substr($data, 0, 4);
         $responce->rows[$i]['cell'] = array($row->nmsupplier, round($row->qtquantity, 2), round($row->vlunitprice, 2), $data, $row->cdsupplier);
         $i++;
     }
     $this->view->dadossupplysupplier = $responce;
 }
 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 dadoseditAction()
 {
     $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");
     $cdsupplier = $this->_request->getParam("cdsupplier");
     $filters = $this->_request->getParam("filters");
     $supply = new SupplyModel();
     $supplysuplierModel = new SupplysupplierModel();
     $supplysuplier = $supplysuplierModel->fetchAll("cdsupplier = " . $cdsupplier);
     $i = 0;
     foreach ($supplysuplier as $row) {
         $supply_nmitem = array();
         $supply_nmitem = $supply->fetchRow("cdsupply = " . $row->cdsupply);
         $responce->rows[$i]['cell'] = array($row->cdsupplysupplier, $row->cdsupply, $supply_nmitem["nmsupply"], $row->qtquantity, $row->vlunitprice);
         $i++;
     }
     $this->view->dadosedit = $responce;
 }