function catalogorderAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $request = $this->getRequest(); $result = 'RESULT_ERROR'; if ($request->isPost()) { $viewOrder = $request->getPost('order'); $id = $request->getPost('id'); $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute(); $where2 = "catalogGuid='{$id}' AND attributeGuid='docViewOrder'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if ($rowCatalogAttribute) { $rowCatalogAttribute->value = $viewOrder; $rowCatalogAttribute->save(); } $result = 'RESULT_OK'; } $this->getResponse()->setBody($result); }
function _getNodes($node, $relateAs = 'RELATED_ITEM') { $a = array(); $tblRelatedItem = new App_Model_Db_Table_RelatedItem(); $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute(); $where = "relatedGuid='{$node}' AND relateAs='{$relateAs}'"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->itemGuid; $aTmp2['nodeLeft'] = $row->itemGuid; $aTmp2['nodeRight'] = $node; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } $where = "itemGuid='{$node}' AND relateAs='{$relateAs}'"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->relatedGuid; $aTmp2['nodeLeft'] = $node; $aTmp2['nodeRight'] = $row->relatedGuid; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } return $a; }