/** * getMailContent */ function getMailContent($title) { $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $where = $tblCatalog->getAdapter()->quoteInto("shortTitle=?", $title); $rowset = $tblCatalog->fetchRow($where); $rowsetCatalogAttribute = $rowset->findDependentRowsetCatalogAttribute(); $content = $rowsetCatalogAttribute->findByAttributeGuid('fixedContent')->value; return $content; }
function indexAction() { $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $sReturn = base64_encode($sReturn); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { $registry = Zend_Registry::getInstance(); $config = $registry->get('config'); $loginUrl = $config->identity->config->local->login->url; $this->_redirect(KUTU_ROOT_URL . $loginUrl . '?returnTo=' . $sReturn); } $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $rowset = $tblCatalog->fetchRow("shortTitle='halaman-depan-login' AND status=99"); if (!empty($rowset)) { $rowsetCatalogAttribute = $rowset->findDependentRowsetCatalogAttribute(); $fixedContent = $rowsetCatalogAttribute->findByAttributeGuid('fixedContent')->value; } else { $fixedContent = ''; } $this->view->content = $fixedContent; $this->view->sReturn = $sReturn; }
function signupAction() { $this->_helper->layout->setLayout('layout-newhukumonlineid-daftar'); $this->view->identity = 'Daftar'; $r = $this->getRequest(); if ($r->isPost()) { $fullName = $r->getParam('fullname'); $username = $r->getParam('username'); $password = $r->getParam('password'); $email = $r->getParam('email'); $package = $r->getParam('aro_groups'); $kopel = $this->generateKopel(); $obj = new Kutu_Crypt_Password(); $data = array('kopel' => $kopel, 'username' => $username, 'password' => $obj->encryptPassword($password), 'fullName' => $fullName, 'email' => $email, 'packageId' => $package, 'periodeId' => 1, 'createdDate' => date('Y-m-d H:i:s'), 'createdBy' => $username); $modelUser = new Kutu_Core_Orm_Table_User(); $modelUser->insert($data); $this->updateKopel(); $acl = new Kutu_Acl_Adapter_Local(); //$acl->addUser($username,"Free"); $acl->addUserToGroup($username, "Free"); $formater = new Kutu_Core_Hol_User(); $mailcontent = $formater->getMailContent('konfirmasi email gratis'); $m = $formater->_writeConfirmFreeEmail($mailcontent, $fullName, $username, $password, base64_encode($kopel), $email, 'gratis'); $this->view->message = $m; } $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $rowset = $tblCatalog->fetchRow("shortTitle='halaman-depan-login' AND status=99"); if (!empty($rowset)) { $rowsetCatalogAttribute = $rowset->findDependentRowsetCatalogAttribute(); $fixedContent = $rowsetCatalogAttribute->findByAttributeGuid('fixedContent')->value; } else { $fixedContent = ''; } $this->view->content = $fixedContent; }
public function save($aData) { //do minimal pre-requisite of aData if (empty($aData['fixedTitle'])) { throw new Zend_Exception('Catalog Title can not be EMPTY!'); } if (empty($aData['profileGuid'])) { throw new Zend_Exception('Catalog Profile can not be EMPTY!'); } $tblCatalog = new Kutu_Core_Orm_Table_Catalog(); $gman = new Kutu_Core_Guid(); $catalogGuid = isset($aData['guid']) && !empty($aData['guid']) ? $aData['guid'] : $gman->generateGuid(); $folderGuid = isset($aData['folderGuid']) && !empty($aData['folderGuid']) ? $aData['folderGuid'] : ''; //if not empty, there are 2 possibilities $where = $tblCatalog->getAdapter()->quoteInto('guid=?', $catalogGuid); if ($tblCatalog->fetchRow($where)) { $rowCatalog = $tblCatalog->find($catalogGuid)->current(); //echo "guid ditemukan:" .$rowCatalog->guid; $rowCatalog->shortTitle = isset($aData['shortTitle']) ? $aData['shortTitle'] : $rowCatalog->shortTitle; //$rowCatalog->profileGuid = $request->getParam('profileGuid'); $rowCatalog->publishedDate = isset($aData['publishedDate']) ? $aData['publishedDate'] : $rowCatalog->publishedDate; $rowCatalog->expiredDate = isset($aData['expiredDate']) ? $aData['expiredDate'] : $rowCatalog->expiredDate; //$rowCatalog->createdBy = $request->getParam('createdBy'); //$rowCatalog->modifiedBy = ($aData['username'])?$aData['username']:''; //$rowCatalog->createdDate = $request->getParam('createdDate'); //$rowCatalog->modifiedDate = $aData['modifiedDate']; //$rowCatalog->deletedDate = $request->getParam('deletedDate'); $rowCatalog->status = isset($aData['status']) ? $aData['status'] : $rowCatalog->status; $rowCatalog->price = isset($aData['price']) ? $aData['price'] : $rowCatalog->price; } else { $rowCatalog = $tblCatalog->fetchNew(); //echo "guid tidak ditemukan"; $rowCatalog->guid = $catalogGuid; $rowCatalog->shortTitle = isset($aData['shortTitle']) ? $aData['shortTitle'] : ''; $rowCatalog->profileGuid = $aData['profileGuid']; $rowCatalog->publishedDate = '0000-00-00 00:00:00'; $rowCatalog->expiredDate = '0000-00-00 00:00:00'; $rowCatalog->createdBy = isset($aData['username']) ? $aData['username'] : ''; $rowCatalog->modifiedBy = $rowCatalog->createdBy; $rowCatalog->createdDate = date("Y-m-d h:i:s"); $rowCatalog->modifiedDate = $rowCatalog->createdDate; $rowCatalog->deletedDate = '0000-00-00 00:00:00'; $rowCatalog->status = isset($aData['status']) ? $aData['status'] : 0; $rowCatalog->price = isset($aData['price']) ? $aData['price'] : 0; } try { $catalogGuid = $rowCatalog->save(); } catch (Exception $e) { die($e->getMessage()); } $tableProfileAttribute = new Kutu_Core_Orm_Table_ProfileAttribute(); $profileGuid = $rowCatalog->profileGuid; $where = $tableProfileAttribute->getAdapter()->quoteInto('profileGuid=?', $profileGuid); $rowsetProfileAttribute = $tableProfileAttribute->fetchAll($where, 'viewOrder ASC'); $rowsetCatalogAttribute = $rowCatalog->findDependentRowsetCatalogAttribute(); foreach ($rowsetProfileAttribute as $rowProfileAttribute) { if ($rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid)) { $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid); //echo "rowcatalogattribute:" . $rowCatalogAttribute->attributeGuid; } else { $tblCatalogAttribute = new Kutu_Core_Orm_Table_CatalogAttribute(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $catalogGuid; $rowCatalogAttribute->attributeGuid = $rowProfileAttribute->attributeGuid; } $rowCatalogAttribute->value = isset($aData[$rowProfileAttribute->attributeGuid]) ? $aData[$rowProfileAttribute->attributeGuid] : ''; $rowCatalogAttribute->save(); } //save to table CatalogFolder only if folderGuid is not empty if (!empty($folderGuid)) { $rowCatalog->copyToFolder($folderGuid); } //do indexing $indexingEngine = Kutu_Search::manager(); $indexingEngine->indexCatalog($catalogGuid); //after indexing, update isIndex and indexedDate in table KutuCatalog return $catalogGuid; }