Beispiel #1
1
 protected function _postDelete()
 {
     //find related docs and delete them
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $rowsetRelatedDocs = $tblRelatedItem->fetchAll("relatedGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE','RELATED_VIDEO')");
     if (count($rowsetRelatedDocs)) {
         foreach ($rowsetRelatedDocs as $rowRelatedDoc) {
             $tblCatalog = new App_Model_Db_Table_Catalog();
             $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current();
             if ($rowCatalog) {
                 $rowCatalog->delete();
             }
         }
     }
     $registry = Zend_Registry::getInstance();
     $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT);
     $cdn = $config->getOption('cdn');
     if ($this->profileGuid == 'kutu_doc') {
         //get parentGuid
         $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
         $rowsetRelatedItem = $tblRelatedItem->fetchAll("itemGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE','RELATED_VIDEO')");
         if (count($rowsetRelatedItem)) {
             foreach ($rowsetRelatedItem as $rowRelatedItem) {
                 //must delete the physical files
                 $rowsetCatAtt = $this->findDependentRowsetCatalogAttribute();
                 $systemname = $rowsetCatAtt->findByAttributeGuid('docSystemName')->value;
                 $parentGuid = $rowRelatedItem->relatedGuid;
                 $sDir1 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $systemname;
                 $sDir2 = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $parentGuid . DIRECTORY_SEPARATOR . $systemname;
                 //$sDir1 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$systemname;
                 //$sDir2 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$parentGuid.DIRECTORY_SEPARATOR.$systemname;
                 if (file_exists($sDir1)) {
                     //delete file
                     unlink($sDir1);
                 } else {
                     if (file_exists($sDir2)) {
                         //delete file
                         unlink($sDir2);
                     }
                 }
             }
         }
     }
     //delete from table CatalogAttribute
     $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
     $tblCatalogAttribute->delete("catalogGuid='{$this->guid}'");
     //delete catalogGuid from table CatalogFolder
     $tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
     $tblCatalogFolder->delete("catalogGuid='{$this->guid}'");
     //delete guid from table AssetSetting
     $tblAssetSetting = new App_Model_Db_Table_AssetSetting();
     $tblAssetSetting->delete("guid='{$this->guid}'");
     //delete from table relatedItem
     $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
     $tblRelatedItem->delete("itemGuid='{$this->guid}'");
     $tblRelatedItem->delete("relatedGuid='{$this->guid}'");
     $indexingEngine = Pandamp_Search::manager();
     try {
         $hits = $indexingEngine->deleteCatalogFromIndex($this->guid);
     } catch (Exception $e) {
     }
     //delete physical catalog folder from uploads/files/[catalogGuid]
     $sDir = $cdn['static']['dir']['files'] . DIRECTORY_SEPARATOR . $this->guid;
     //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$this->guid;
     try {
         if (is_dir($sDir)) {
             rmdir($sDir);
         }
     } catch (Exception $e) {
     }
     $sDir = $cdn['static']['dir']['images'];
     //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'images';
     try {
         if (file_exists($sDir . "/" . $this->guid . ".gif")) {
             unlink($sDir . "/" . $this->guid . ".gif");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".gif")) {
             unlink($sDir . "/tn_" . $this->guid . ".gif");
         }
         if (file_exists($sDir . "/" . $this->guid . ".jpg")) {
             unlink($sDir . "/" . $this->guid . ".jpg");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".jpg")) {
             unlink($sDir . "/tn_" . $this->guid . ".jpg");
         }
         if (file_exists($sDir . "/" . $this->guid . ".jpeg")) {
             unlink($sDir . "/" . $this->guid . ".jpeg");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".jpeg")) {
             unlink($sDir . "/tn_" . $this->guid . ".jpeg");
         }
         if (file_exists($sDir . "/" . $this->guid . ".png")) {
             unlink($sDir . "/" . $this->guid . ".png");
         }
         if (file_exists($sDir . "/tn_" . $this->guid . ".png")) {
             unlink($sDir . "/tn_" . $this->guid . ".png");
         }
     } catch (Exception $e) {
     }
 }
 public function updatecatalogattributeAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $request = $this->getRequest();
     $catalogGuid = $request->getParam('guid');
     $title = $request->getParam('title');
     $attributeGuid = $request->getParam('attributeGuid');
     $catalogAttributeDb = new App_Model_Db_Table_CatalogAttribute();
     $catalogAttributeDb->update(array('value' => $title), array('catalogGuid = ?' => $catalogGuid, 'attributeGuid = ?' => $attributeGuid));
     //$indexingEngine = Pandamp_Search::manager();
     //$indexingEngine->indexCatalog($catalogGuid);
     try {
         $this->view->addHitsBySolr(json_encode([["id" => $catalogGuid, "title" => ["set" => $title], "shortTitle" => ["set" => Pandamp_Utility_String::removeSign($title, '-', true)], "modifiedDate" => ["set" => date("Y-m-d\\TH:i:s\\Z")], "modifiedBy" => ["set" => Zend_Auth::getInstance()->getIdentity()->username]]]));
     } catch (Zend_Exception $e) {
     }
     $this->getResponse()->setBody('RESULT_OK');
 }
 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);
 }
Beispiel #4
0
 public function save($aData)
 {
     if (empty($aData['profileGuid'])) {
         throw new Zend_Exception('Catalog Profile can not be EMPTY!');
     }
     $tblCatalog = new App_Model_Db_Table_Catalog();
     $gman = new Pandamp_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();
         $rowCatalog->shortTitle = isset($aData['shortTitle']) ? $aData['shortTitle'] : $rowCatalog->shortTitle;
         $rowCatalog->publishedDate = isset($aData['publishedDate']) ? $aData['publishedDate'] : $rowCatalog->publishedDate;
         $rowCatalog->expiredDate = isset($aData['expiredDate']) ? $aData['expiredDate'] : $rowCatalog->expiredDate;
         $rowCatalog->status = isset($aData['status']) ? $aData['status'] : $rowCatalog->status;
         $rowCatalog->price = isset($aData['price']) ? $aData['price'] : $rowCatalog->price;
     } else {
         $rowCatalog = $tblCatalog->fetchNew();
         $rowCatalog->guid = $catalogGuid;
         $rowCatalog->shortTitle = isset($aData['shortTitle']) ? $aData['shortTitle'] : '';
         $rowCatalog->profileGuid = $aData['profileGuid'];
         $rowCatalog->publishedDate = isset($aData['publishedDate']) ? $aData['publishedDate'] : '0000-00-00 00:00:00';
         $rowCatalog->expiredDate = isset($aData['expiredDate']) ? $aData['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 App_Model_Db_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);
         } else {
             $tblCatalogAttribute = new App_Model_Db_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)) {
         $tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
         $rowsetCatalogFolder = $tblCatalogFolder->find($catalogGuid, $folderGuid);
         if (count($rowsetCatalogFolder) <= 0) {
             $rowCatalogFolder = $tblCatalogFolder->createRow(array('catalogGuid' => '', 'folderGuid' => ''));
             $rowCatalogFolder->catalogGuid = $catalogGuid;
             $rowCatalogFolder->folderGuid = $folderGuid;
             $rowCatalogFolder->save();
         }
     }
     //do indexing
     $indexingEngine = Pandamp_Search::manager();
     $indexingEngine->indexCatalog($catalogGuid);
     return $catalogGuid;
 }
Beispiel #5
0
 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;
 }
Beispiel #6
0
 protected function _updateCatalogAttribute($rowsetCatalogAttribute, $catalogGuid, $attributeGuid, $value)
 {
     if ($rowsetCatalogAttribute->findByAttributeGuid($attributeGuid)) {
         $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($attributeGuid);
     } else {
         $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
         $rowCatalogAttribute = $tblCatalogAttribute->fetchNew();
         $rowCatalogAttribute->catalogGuid = $catalogGuid;
         $rowCatalogAttribute->attributeGuid = $attributeGuid;
     }
     $rowCatalogAttribute->value = $value;
     $rowCatalogAttribute->save();
 }
Beispiel #7
0
 function viewerClinic80Action()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $dateDiff = new Pandamp_Lib_DateDiff();
     $author = $this->_getParam('folderGuid') ? $this->_getParam('folderGuid') : '';
     $start = $this->_getParam('start') ? $this->_getParam('start') : 0;
     $limit = $this->_getParam('limit') ? $this->_getParam('limit') : 10;
     $a = array();
     $tblCatalog = new App_Model_Db_Table_Catalog();
     $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
     $clinic = $tblCatalogAttribute->fetchAll("value='" . $author . "'", '', $limit, $start);
     $clinic1 = $tblCatalogAttribute->fetchAll("value='" . $author . "'");
     $a['folderGuid'] = $author;
     $a['totalCount'] = count($clinic1);
     $ii = 0;
     if ($clinic) {
         $value_clinic = array();
         foreach ($clinic as $c) {
             $value_clinic[] = $c->catalogGuid;
         }
         //			$value_clinic = $tblCatalog->implode_with_keys(", ", $value_clinic, "'");
         echo '<pre>';
         print_r($value_clinic);
         echo '</pre>';
         die;
         if (isset($value_clinic)) {
             $rowset = $tblCatalog->fetchAll("guid IN({$value_clinic}) AND status=99", "publishedDate desc");
             foreach ($rowset as $row) {
                 $arraypictureformat = array("jpg", "jpeg", "gif");
                 $txt_allowedformat = implode('; ', $arraypictureformat);
                 $registry = Zend_Registry::getInstance();
                 $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT);
                 $cdn = $config->getOption('cdn');
                 $sDir = $cdn['static']['dir']['photo'];
                 $sDir2 = $cdn['static']['url']['photo'] . '/';
                 $smg = $cdn['static']['images'];
                 $modelUser = App_Model_Show_User::show()->getUserByName($row->createdBy);
                 $x = 0;
                 foreach ($arraypictureformat as $key => $val) {
                     if (is_file($sDir . "/" . $modelUser['kopel'] . "." . $val)) {
                         $myphoto = $sDir . "/" . $modelUser['kopel'] . "." . $val;
                         $myext = $val;
                         $x = 1;
                         break;
                     }
                 }
                 if ($x == 1) {
                     $myphotosize = getimagesize($myphoto);
                     $dis = "";
                     if (isset($myext) && is_file($sDir . "/" . $modelUser['kopel'] . "." . $myext)) {
                         $txt_existence = "<img src=\"" . $sDir2 . $modelUser['kopel'] . "." . $myext . "\" class=\"avatar\" width=\"38\" height=\"38\" />";
                     }
                 } else {
                     $txt_existence = "<img src=\"" . $smg . "/gravatar-140.png\" width=\"38\" height=\"38\" class=\"avatar\" border=\"0\" />";
                 }
                 $rowsetCatalogAttribute = $row->findDependentRowsetCatalogAttribute();
                 $rowCatalogTitle = $rowsetCatalogAttribute->findByAttributeGuid('fixedCommentTitle');
                 $rowCatalogQuestion = $rowsetCatalogAttribute->findByAttributeGuid('fixedCommentQuestion');
                 $rowCatalogSelectCat = $rowsetCatalogAttribute->findByAttributeGuid('fixedKategoriKlinik');
                 $author = $rowsetCatalogAttribute->findByAttributeGuid('fixedSelectNama');
                 $source = $rowsetCatalogAttribute->findByAttributeGuid('fixedSelectMitra');
                 /* Get Category from profile clinic_category */
                 $findCategory = $tblCatalog->find($rowCatalogSelectCat->value)->current();
                 $rowCategory = $findCategory->findDependentRowsetCatalogAttribute();
                 $category = $rowCategory->findByAttributeGuid('fixedTitle');
                 $a['index'][$ii]['title'] = $rowCatalogTitle->value;
                 $a['index'][$ii]['question'] = $rowCatalogQuestion->value;
                 $a['index'][$ii]['secat'] = $rowCatalogSelectCat->value;
                 $a['index'][$ii]['category'] = $category->value;
                 $a['index'][$ii]['guid'] = $row->guid;
                 $a['index'][$ii]['createdBy'] = $row->createdBy;
                 $a['index'][$ii]['author'] = isset($author->value) ? $author->value : '';
                 if (isset($source->value)) {
                     $findSource = $tblCatalog->find($source->value)->current();
                     $rowSource = $findCategory->findDependentRowsetCatalogAttribute();
                     $sc = $rowSource->findByAttributeGuid('fixedTitle');
                     $a['index'][$ii]['source'] = $sc->value;
                     $a['index'][$ii]['sid'] = $source->value;
                 } else {
                     $a['index'][$ii]['source'] = '';
                     $a['index'][$ii]['sid'] = '';
                 }
                 $a['index'][$ii]['publishedDate'] = $dateDiff->ago(strftime('%Y-%m-%d %H:%M:%S', strtotime($row->publishedDate)));
                 $a['index'][$ii]['existence'] = '<div style="float:left;padding:2px;margin: 1px 10px 10px 0px;"><a href="">' . $txt_existence . '</a></div>';
                 $ii++;
             }
         }
     }
     echo Zend_Json::encode($a);
 }
Beispiel #8
0
 protected function _traverseFolder_($folderGuid, $sGuid, $level)
 {
     $tblFolder = new App_Model_Db_Table_Folder();
     $rowSet = $tblFolder->fetchChildren($folderGuid);
     $row = $tblFolder->find($folderGuid)->current();
     $sGuid = '';
     /*
     if(count($rowSet))
     {
     	$sGuid = $row->guid;
     }
     else
     {
     	$sGuid = $row->guid;
     }
     */
     //		if(true)
     //		{
     //echo $level;
     foreach ($rowSet as $row) {
         //$sTab = '<ul>';
         //$sTab = '';
         //for($i=0;$i<$level;$i++)
         //$sTab .= '<li>';
         //$option = '<option value="'.$row->guid.'">'.$sTab.$row->title.'</option>';
         //$option = '"'.$row->guid.'" :'.'"'.$sTab.$row->title.'",';
         //$option = $sTab.$row->title;
         $sGuid .= $this->_traverseFolder_($row->guid, '', $level + 1) . "";
         //echo $row->guid.'<br>';
         echo 'Insert ' . $row->title . '<br>';
         $tblFolder = new App_Model_Db_Table_Migration_Detik_Folder();
         $rowFolder = $tblFolder->fetchNew();
         $rowFolder->guid = $row->guid;
         $rowFolder->title = $row->title;
         $rowFolder->description = $row->description;
         $rowFolder->parentGuid = $row->parentGuid;
         $rowFolder->path = $row->path;
         $rowFolder->type = $row->type;
         $rowFolder->viewOrder = $row->viewOrder;
         $rowFolder->cmsParams = $row->cmsParams;
         //$rowFolder->save();
         $rowCatalog = App_Model_Show_Catalog::show()->fetchCatalogInFolder4Mig($row->guid);
         //print_r($row->guid);die();
         if ($rowCatalog) {
             foreach ($rowCatalog as $rc) {
                 $rowsetCatalogAttributeJenis = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($rc['guid'], 'prtJenis');
                 //print_r($rowsetCatalogAttributeJenis);
                 if ($rowsetCatalogAttributeJenis == 'Undang-Undang ' || $rowsetCatalogAttributeJenis == "uu" || $rowsetCatalogAttributeJenis == "pp" || $rowsetCatalogAttributeJenis == "Peraturan Pemerintah" || $rowsetCatalogAttributeJenis == "konstitusi") {
                     $modelMigrationCatalog = new App_Model_Db_Table_Migration_Detik_Catalog();
                     $where = $modelMigrationCatalog->getAdapter()->quoteInto('guid=?', $rc['guid']);
                     if (!$modelMigrationCatalog->fetchRow($where)) {
                         $data1 = array('guid' => $rc['guid'], 'shortTitle' => $rc['shortTitle'], 'profileGuid' => $rc['profileGuid'], 'publishedDate' => $rc['publishedDate'], 'expiredDate' => $rc['expiredDate'], 'createdBy' => $rc['createdBy'], 'modifiedBy' => $rc['modifiedBy'], 'createdDate' => $rc['createdDate'], 'modifiedDate' => $rc['modifiedDate'], 'deletedDate' => $rc['deletedDate'], 'price' => isset($rc['price']) ? $rc['price'] : 0, 'status' => $rc['status']);
                         $modelMigrationCatalog->insert($data1);
                         $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
                         $rcam = $tblCatalogAttribute->fetchAll("catalogGuid='" . $rc['guid'] . "'");
                         foreach ($rcam as $rowca) {
                             $modelMigrationCatalogAttribute = new App_Model_Db_Table_Migration_Detik_CatalogAttribute();
                             $data2 = array('catalogGuid' => $rowca->catalogGuid, 'attributeGuid' => $rowca->attributeGuid, 'value' => $rowca->value);
                             $modelMigrationCatalogAttribute->insert($data2);
                         }
                         $tblCatalogFolder = new App_Model_Db_Table_CatalogFolder();
                         $rcfm = $tblCatalogFolder->fetchAll("catalogGuid='" . $rc['guid'] . "'");
                         foreach ($rcfm as $rowcf) {
                             $modelMigrationCatalogFolder = new App_Model_Db_Table_Migration_Detik_CatalogFolder();
                             $data3 = array('catalogGuid' => $rowcf->catalogGuid, 'folderGuid' => $rowcf->folderGuid);
                             $modelMigrationCatalogFolder->insert($data3);
                         }
                         $tblRelatedItem = new App_Model_Db_Table_RelatedItem();
                         $rrim = $tblRelatedItem->fetchAll("relatedGuid='" . $rc['guid'] . "'");
                         foreach ($rrim as $rowri) {
                             $modelMigrationRelatedItem = new App_Model_Db_Table_Migration_Detik_RelatedItem();
                             $rowRelated = $modelMigrationRelatedItem->createNew();
                             $rowRelated->itemGuid = $rowri->itemGuid;
                             $rowRelated->relatedGuid = $rowri->relatedGuid;
                             $rowRelated->relateAs = $rowri->relateAs;
                             $rowRelated->valueIntRelation = $rowri->valueIntRelation;
                             $rowRelated->save();
                         }
                     }
                 }
             }
         }
         //$sGuid .= $sTab.$row->title . '|<br>'. $this->_traverseFolder($row->guid, '', $level+1);
     }
     //			if(count($rowSet))
     //			{
     //				return $sGuid;
     //			}
     //			else
     //			{
     //				return $sGuid;
     //			}
     //		}
 }