Exemplo n.º 1
0
 public function locationStatusAction()
 {
     $form = new Form_LocationStatus();
     $params = array();
     $non_ccm_location = new Model_NonCcmLocations();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $area = $form->getValue('area');
             $level = $form->getValue('level');
             if (!empty($area)) {
                 $params['area'] = $area;
             }
             if (!empty($level)) {
                 $params['level'] = $level;
                 $levl = $this->_em->getRepository("ListDetail")->find($level);
                 $level_val = $levl->getListValue();
                 $this->view->level = $level_val;
             }
             $non_ccm_location->form_values = $params;
             $result = $non_ccm_location->locationStatus($area, $level);
             //$this->view->max_value_row = $non_ccm_location->getMaxRow($area, $level);
             $this->view->max_value_shelf = $non_ccm_location->getMaxShelf($area, $level);
             $this->view->max_value_rack = $non_ccm_location->getMaxRack($area, $level);
             $this->view->max_value_pallet = $non_ccm_location->getMaxPallet();
         }
     } else {
         $level = $this->getParam('level');
         $area = $this->getParam('area');
         $id = $this->getParam('id');
         if (!empty($level) && !empty($area)) {
             $levl = $this->_em->getRepository("ListDetail")->find($level);
             $level_val = $levl->getListValue();
             $this->view->level = $level_val;
             $params['level'] = $level;
             $params['area'] = $area;
             $non_ccm_location->form_values = $params;
             $result = $non_ccm_location->locationStatus($area, $level);
             $this->view->getarea = $area;
             $this->view->getlevel = $level;
             //$this->view->max_value_row = $non_ccm_location->getMaxRow($area, $level);
             $this->view->max_value_shelf = $non_ccm_location->getMaxShelf($area, $level);
             $this->view->max_value_rack = $non_ccm_location->getMaxRack($area, $level);
             $this->view->max_value_pallet = $non_ccm_location->getMaxPallet();
             $form->area->setValue($area);
             $form->level->setValue($level);
         }
     }
     $this->view->getarea = $area;
     $this->view->getlevel = $level;
     $this->view->form = $form;
     $this->view->result = $result;
 }