コード例 #1
0
 public function ajaxDisplayLogBookResultAction()
 {
     $this->_helper->layout->disableLayout();
     $temp = $this->_request->do;
     $temp = base64_decode(substr($temp, 1, strlen($temp) - 1));
     $temp = explode("|", $temp);
     $warehouse_id = $temp[0];
     $is_new_rpt = $temp[2];
     $rpt_date = $temp[1];
     $tt = explode("-", $rpt_date);
     $yy = $tt[0];
     $mm = $tt[1];
     $dd = $tt[2];
     $item_pack_sizes = new Model_ItemPackSizes();
     $items = $item_pack_sizes->logBookItemPackSize();
     $this->view->items = $items;
     $this->view->mm = $mm;
     $this->view->yy = $yy;
     $this->view->wh_id = $warehouse_id;
     $this->view->do = $this->_request->do;
     if ($this->_request->isPost()) {
         $em = Zend_Registry::get('doctrine');
         $em->getConnection()->beginTransaction();
         try {
             if ($this->_request->getPost()) {
                 $temp = $this->_request->do;
                 $log_book = new Model_WarehousesData();
                 $log_book->form_values = $this->_request->getPost();
                 $log_book->form_values['temp'] = $temp;
                 $result = $log_book->addLogBook();
                 $em->getConnection()->commit();
             }
         } catch (Exception $e) {
             $em->getConnection()->rollback();
             $em->close();
         }
     }
     $log_book_month = new Model_WarehousesData();
     $log_book_month->form_values['month'] = $mm;
     $log_book_month->form_values['year'] = $yy;
     $log_book_month->form_values['warehouse_id'] = $warehouse_id;
     $query = $log_book_month->getLogBookByMonth();
     $this->view->query = $query;
 }