public function productDetailAction() { if ($this->getRequest()->getParam('id')) { $id = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '0'; //if user type wrong url $user = $this->GetuserInfoAction(); $gb = new Application_Model_DbTable_DbGlobal(); if ($user["level"] != 1 and $user["level"] != 2) { $exist = $gb->productLocation($id, $user["location_id"]); if ($exist == "") { $this->_redirect("product/index/index"); } } else { $pro_exist = $gb->myProductExist($id); if (!$pro_exist) { $this->_redirect("product/index/index"); } } $session_stock = new Zend_Session_Namespace('stock'); $productinfo = new Product_Model_DbTable_DbProduct(); //get product info detail $getpro_info_rows = $productinfo->getProductInfoDetail($id); if ($getpro_info_rows['photo'] == "") { $getpro_info_rows['photo'] = "no-img.gif"; } $this->view->photo = $getpro_info_rows['photo']; $this->view->form = $getpro_info_rows; //for view product loaction 22/8/13 $orderDetail = $productinfo->getOrderItemVeiw($id); $this->view->lostItemDetail = $orderDetail; //for product in stock 22/8/13 if ($user["level"] == 1 or $user["level"] == 2) { $rowproduct = $productinfo->getProductStock($id); $this->view->pro_qty = $rowproduct; } //get product move history 23/8/13 $rows = $productinfo->moveproduct($id); $list = new Application_Form_Frmlist(); $glClass = new Application_Model_GlobalClass(); $rows = $glClass->getTransactionType($rows, BASE_URL, true); $columns = array("TRANSACTION_TYPE_CAP", "DATE_CAP", "LOCATION_NAME_CAP", "QTY_CAP", "QTY_BEFORE_CAP", "QTY_AFTER_CAP", "REMARK_CAP", "BY_USER_CAP"); $link = array('module' => 'product', 'controller' => 'index', 'action' => 'update'); $this->view->list_history = $list->getCheckList(1, $columns, $rows); //view sale order history $row_sale_history = $productinfo->getSaleHistory($id); $glClass = new Application_Model_GlobalClass(); $row_sale_history = $glClass->getTypeHistory($row_sale_history, BASE_URL, true); $row_sale_history = $glClass->getStatusType($row_sale_history, BASE_URL, true); $columns1 = array("TYPE_CAP", "ORDER_ADD_CAP", "CUSTOMER_CAP", "ORDER_DATE_CAP", "ORDER_STATUS_CAP", "TOTAL_PRICE_CAP", "QTY_CAP", "UNIT_PRICE_CAP", "SUB_TOTAL_CAP"); $link1 = array('module' => 'product', 'controller' => 'index', 'action' => 'update'); $list = new Application_Form_Frmlist(); $this->view->list_order_history = $list->getCheckList(1, $columns1, $row_sale_history, array('item_name' => $link1, 'Name' => $link1), "", "items", "left", false, "move_history"); //for purchase history $row_purchase_history = $productinfo->getPurchaseHistory($id); $glClass = new Application_Model_GlobalClass(); $row_purchase_history = $glClass->getTypeHistory($row_purchase_history, BASE_URL, true); $row_purchase_history = $glClass->getStatusType($row_purchase_history, BASE_URL, true); $columns1 = array("TYPE_CAP", "ORDER_ADD_CAP", "VENDOR_CAP", "ORDER_DATE_CAP", "ORDER_STATUS_CAP", "TOTAL_PRICE_CAP", "QTY_CAP", "UNIT_PRICE_CAP", "SUB_TOTAL_CAP"); $link_pur = array('module' => 'product', 'controller' => 'index', 'action' => 'update'); $list = new Application_Form_Frmlist(); $this->view->list_purchase_history = $list->getCheckList(1, $columns1, $row_purchase_history, array('item_name' => $link_pur, 'Name' => $link_pur), "", "items", "left", false, "purchase_history"); } }