function syaratketentuanAction() { $this->_helper->layout->setLayout('layout-misc'); $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("guid='lt4d5e17eed8711'", 'createdDate DESC'); $content = 0; $data = array(); foreach ($rowset as $row) { $data[$content][0] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row->guid, 'fixedContent'); $data[$content][1] = $row->guid; $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
function _mitraKlinikAction() { $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("guid!='lt4b1a5aadda0f1' AND profileGuid='partner'", 'createdDate DESC'); $content = 0; $data = array(); foreach ($rowset as $row) { $data[$content][0] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row->guid, 'fixedTitle'); $data[$content][1] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row->guid, 'fixedContent'); $data[$content][2] = $row->guid; $content++; } $num_row = count($rowset); $this->view->numberOfRows = $num_row; $this->view->aData = $data; }
public function reIndexCatalog_ZendDb() { $this->emptyIndex(); $time_start = microtime(true); $solr =& $this->_solr; $tbl = new App_Model_Db_Table_Catalog(); $rowset = $tbl->fetchAll(); //("profileGuid='kutu_peraturan'"); $documents = array(); $rowCount = count($rowset); for ($iCount = 0; $iCount < $rowCount; $iCount++) { $row = $rowset->current(); // if($iCount == 100) // break; echo 'urutan: ' . $iCount . '<br>'; $documents[] = $this->_createSolrDocument($row); $rowset->next(); if ($iCount % 1000 == 0) { try { $solr->addDocuments($documents); $solr->commit(); //$solr->optimize(); $documents = array(); } catch (Exception $e) { echo "Error occured when processing record starting from number: " . ($iCount - 1000) . ' to ' . $iCount; throw new Zend_Exception($e->getMessage()); //echo $e->getMessage(); } } } try { $solr->addDocuments($documents); $solr->commit(); $solr->optimize(); } catch (Exception $e) { throw new Zend_Exception($e->getMessage()); //echo $e->getMessage(); } $time_end = microtime(true); $time = $time_end - $time_start; echo '<br>WAKTU EKSEKUSI: ' . $time; }
/** * categoryClinicPullDown * @return category clinic */ static function categoryClinicPullDown($cat = '') { $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("profileGuid='kategoriklinik'", 'createdDate DESC'); $category = "<select name=\"category\">\n"; if ($cat) { $rowCategory = $tblCatalog->find($cat)->current(); $title = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($cat, 'fixedTitle'); $category .= "<option value='{$rowCategory->guid}' selected>{$title}</option>"; $category .= "<option value=''>---Semua Kategori---</option>"; } else { $category .= "<option value='' selected>---Semua Kategori---</option>"; } foreach ($rowset as $row) { $attributeTitle = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row->guid, 'fixedTitle'); if ($cat && $row->guid == $rowCategory->guid) { continue; } else { $category .= "<option value='{$row->guid}'>{$attributeTitle}</option>"; } } $category .= "</select>\n\n"; return $category; }
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); }
public function render() { $sReturn = ''; switch ($this->type) { default: case 0: // field type = single line $view = new Zend_View(); $view->name = $this->name; $view->value = $this->value; if (isset($this->attribs)) { $view->attribs = $this->attribs; } else { $view->attribs = array('rows' => 1, 'cols' => 50); } $view->setScriptPath(dirname(__FILE__)); return $view->render('TextArea.phtml'); break; case 1: // field type = textarea paragraph $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; if (isset($this->attribs)) { $view->attribs = $this->attribs; } else { $view->attribs = array('rows' => 5, 'cols' => 50, 'class' => 'form-control'); } $view->setScriptPath(dirname(__FILE__)); return $view->render('TextArea.phtml'); break; case 2: // field type = html paragraph // require_once('FCKeditor/fckeditor.php'); // $oFCKeditor = new FCKeditor($this->name) ; // $oFCKeditor->BasePath = ROOT_URL.'/library/FCKeditor/'; // $oFCKeditor->Value = $this->value; // $oFCKeditor->Width = '100%' ; // $oFCKeditor->Height = '400' ; // $sReturn = $oFCKeditor->CreateHtml() ; // return $sReturn; $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->setScriptPath(dirname(__FILE__)); return $view->render('TextArea2.phtml'); break; // $view = new Zend_View(); // $view->name = $this->name; // $view->value = $this->value; // // $config = Pandamp_Config::getConfig(); // $view->cdn = $config->cdn->js; // if(isset($this->attribs)) // $view->attribs = $this->attribs; // else // $view->attribs = array('class' => 'tinymce', 'style' => 'width: 440px; height: 1000px;'); // $view->setScriptPath(dirname(__FILE__)); // return $view->render('TextAreaContent.phtml'); // // break; // $view = new Zend_View(); // $view->name = $this->name; // $view->value = $this->value; // // $config = Pandamp_Config::getConfig(); // $view->cdn = $config->cdn->js; // if(isset($this->attribs)) // $view->attribs = $this->attribs; // else // $view->attribs = array('class' => 'tinymce', 'style' => 'width: 440px; height: 1000px;'); // $view->setScriptPath(dirname(__FILE__)); // return $view->render('TextAreaContent.phtml'); // // break; case 79: // field type = html paragraph require_once 'FCKeditor/fckeditor.php'; $oFCKeditor = new FCKeditor($this->name); $oFCKeditor->BasePath = ROOT_URL . '/library/FCKeditor/'; $oFCKeditor->Value = $this->value; $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '400'; $sReturn = $oFCKeditor->CreateHtml(); return $sReturn; // $view = new Zend_View(); // $view->name = $this->name; // $view->value = $this->value; // if(isset($this->attribs)) // $view->attribs = $this->attribs; // else // $view->attribs = array('class' => 'tinymce', 'style' => 'width: 440px; height: 200px;'); // $view->setScriptPath(dirname(__FILE__)); // return $view->render('TextAreaDescription.phtml'); break; case 80: $view = new Zend_View(); $view->name = $this->name; $view->value = $this->value; $view->setScriptPath(dirname(__FILE__)); return $view->render('TextArea3.phtml'); break; case 3: // field type = hidden $n = "<input type='hidden' name='{$this->name}' value='{$this->value}'>"; return $n; break; case -400: //$value = $this->convertDate($fieldValue); $value = $fieldValue; echo '<script language="Javascript" src="calendar/calendar.js"></script>'; echo '<input type="text" name="' . $attributeId . '" value="' . $value . '">'; $fieldTblGuid = $attributeId . '_guid'; echo "<input type='hidden' name='{$fieldTblGuid}' value='{$tblGuid}'>"; echo ' <a href="javascript: void(0);" onclick="return getCalendar(document.forms[0].' . $attributeId . ');" onChange="AddCurrentTime(document.forms[0].' . $attributeId . ');">Pilih Tanggal</a>'; break; case 4: $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->setScriptPath(dirname(__FILE__)); $view->addHelperPath(APPLICATION_PATH . '/../library/Pandamp/Controller/Action/Helper', 'Pandamp_Controller_Action_Helper'); return $view->render('datetime.phtml'); break; //datetime field //datetime field case 5: /*echo '<link rel="stylesheet" type="text/css" media="all" href="calendar2/calendar-mos.css" title="green" /> <script type="text/javascript" src="calendar2/calendar.js"></script> <script type="text/javascript" src="calendar2/lang/calendar-en.js"></script> <script language="javascript" src="calendar2/mambojavascript.js"></script>';*/ $view = new Zend_View(); $view->name = $this->name; $view->value = $this->value; $view->setScriptPath(dirname(__FILE__)); $view->addHelperPath(APPLICATION_PATH . '/../library/Pandamp/Controller/Action/Helper', 'Pandamp_Controller_Action_Helper'); return $view->render('datetime.phtml'); /*$fieldTblGuid = $attributeId.'_guid'; echo "<input type='hidden' name='$fieldTblGuid' value='$tblGuid'>"; echo '<input class="inputbox" type="text" name="'.$attributeId.'" id="'.$attributeId.'" size="25" maxlength="25" value="'.$fieldValue.'" />'; echo '<input type="reset" class="button" value="..." onClick="return showCalendar'."('$attributeId', 'dd/mm/Y')".';">';*/ break; // updated Nov 1, 2015 // updated Nov 1, 2015 case 6: $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; if (isset($this->attribs)) { $view->attribs = $this->attribs; } else { $view->attribs = array('class' => 'form-control'); } $view->setScriptPath(dirname(__FILE__)); return $view->render('Text.phtml'); break; case -5: // field type = Image Area $frm = new FormInputImageAreaUc(); $frm->fieldName = $attributeId; $frm->fieldValue = $fieldValue; $frm->renderMe(); $fieldTblGuid = $attributeId . '_guid'; echo "<input type='hidden' name='{$fieldTblGuid}' value='{$tblGuid}'>"; break; case -6: // field type = LABEL echo $fieldValue; echo "<input type='hidden' name='{$attributeId}' value='{$fieldValue}'>"; $fieldTblGuid = $attributeId . '_guid'; echo "<input type='hidden' name='{$fieldTblGuid}' value='{$tblGuid}'>"; break; case 7: // field type = MULTI VALUE (SELECT:OPTIONS) /*$oAttGenerator = new UiFormInputAttributeGenerator(); $s = $oAttGenerator->generateFormInputAttributeByDmsProfileGuidAndAttributeGuid($this->dmsProfileGuid,$attributeId,$attributeId,$fieldValue); echo $s; //echo "<textarea name='$attributeId' rows='0' cols='50'>$fieldValue</textarea>"; $fieldTblGuid = $attributeId.'_guid'; echo "<input type='hidden' name='$fieldTblGuid' value='$tblGuid'>"; break;*/ $tblProAtt = new App_Model_Db_Table_ProfileAttribute(); $rowset = $tblProAtt->fetchAll("profileGuid='{$this->profileGuid}' AND attributeGuid='{$this->name}'"); $defaultValues = array(); if (count($rowset) == 1) { $row = $rowset->current(); $defaultValues = Zend_Json::decode($row->defaultValues); if (is_array($defaultValues)) { //var_dump($defaultValues); } else { $defaultValues = array(); } } $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->defaultValues = $defaultValues; /*if(isset($this->attribs)) $view->attribs = $this->attribs; else $view->attribs = array('rows' => 5, 'cols' =>50);*/ $view->setScriptPath(dirname(__FILE__)); return $view->render('select.phtml'); break; case 8: $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("profileGuid='{$this->other}'", 'shortTitle asc'); $i = 0; $a = array(); $data = array(); foreach ($rowset as $row) { $rowsetCatalogAttribute = $row->findDependentRowsetCatalogAttribute(); $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid('fixedTitle'); $a[$i]['label'] = is_object($rowCatalogAttribute) ? $rowCatalogAttribute->value : ''; $a[$i]['value'] = "{$row->guid}"; $a[$i]['selected'] = $i == 0 ? "true" : "false"; $i++; } $data = Zend_Json::decode(Zend_Json::encode($a)); $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->defaultValues = $data; $view->setScriptPath(dirname(__FILE__)); return $view->render('select.phtml'); break; case 9: $n = "<input type='text' class='txt' name='{$this->name}' value='{$this->value}' size='5'>"; return $n; break; case 10: $n = '<textarea id="html" name="jTagEditor" class="jTagEditor">' . $this->value . '</textarea>'; return $n; break; case 11: if ($this->value == 1) { $check = 'checked'; } else { $check = ''; } $n = "<input type='checkbox' name='{$this->name}' value='1' {$check}>"; return $n; break; case 12: $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("profileGuid='{$this->profileGuid}'", 'shortTitle asc'); $i = 0; $a = array(); $data = array(); foreach ($rowset as $row) { $rowsetCatalogAttribute = $row->findDependentRowsetCatalogAttribute(); $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid('fixedTitle'); $a[$i]['label'] = is_object($rowCatalogAttribute) ? trim($rowCatalogAttribute->value) : ''; $a[$i]['value'] = "{$row->guid}"; $a[$i]['selected'] = $i == 0 ? "true" : "false"; $i++; } $data = Zend_Json::decode(Zend_Json::encode($a)); $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->defaultValues = $data; $view->setScriptPath(dirname(__FILE__)); return $view->render('select.phtml'); break; /* * @TODO category clinic */ /* * @TODO category clinic */ case 13: $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("profileGuid='kategoriklinik'", 'shortTitle asc'); $i = 0; $a = array(); $data = array(); foreach ($rowset as $row) { $rowsetCatalogAttribute = $row->findDependentRowsetCatalogAttribute(); $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid('fixedTitle'); $a[$i]['label'] = is_object($rowCatalogAttribute) ? $rowCatalogAttribute->value : ''; $a[$i]['value'] = "{$row->guid}"; $a[$i]['selected'] = $i == 0 ? "true" : "false"; $i++; } $data = Zend_Json::decode(Zend_Json::encode($a)); $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; $view->defaultValues = $data; $view->setScriptPath(dirname(__FILE__)); return $view->render('select.phtml'); break; case 14: // tags $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name; $view->value = $this->value; if (isset($this->attribs)) { $view->attribs = $this->attribs; } else { $view->attribs = array('rows' => 3, 'class' => 'form-control'); } $view->setScriptPath(dirname(__FILE__)); return $view->render('tags.phtml'); break; case 15: $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("profileGuid='narsum'", 'shortTitle asc'); $i = 0; $a = array(); $data = array(); foreach ($rowset as $row) { $rowsetCatalogAttribute = $row->findDependentRowsetCatalogAttribute(); $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid('fixedTitle'); $a[$i]['label'] = is_object($rowCatalogAttribute) ? trim($rowCatalogAttribute->value) : ''; $a[$i]['value'] = "{$row->guid}"; $a[$i]['selected'] = $i == 0 ? "true" : "false"; $i++; } $data = Zend_Json::decode(Zend_Json::encode($a)); $view = new Zend_View(); $view->label = $this->label; $view->name = $this->name . '[]'; $view->id = $this->name; $r = explode(",", $this->value); $view->value = "'" . implode("','", $r) . "'"; $view->profile = 'narsum'; $view->defaultValues = $data; $view->setScriptPath(dirname(__FILE__)); return $view->render('select3.phtml'); break; case 101: //publishing status require_once CONFIG_PATH . '/master-status.php'; $aStatus = MasterStatus::getPublishingStatus(); $view = new Zend_View(); $view->name = $this->name; $view->value = $this->value; $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $username = $identity->username; // get group information $acl = Pandamp_Acl::manager(); $aReturn = $acl->getUserGroupIds($username); if (isset($aReturn[1])) { if ($aReturn[1] == "klinik_editor") { unset($aStatus[99]); } } $view->defaultValues = $aStatus; $view->setScriptPath(dirname(__FILE__)); return $view->render('select2.phtml'); } }
function recyclebinAction() { $tblCatalog = new App_Model_Db_Table_Catalog(); $rowset = $tblCatalog->fetchAll("status=-2"); $this->view->rowset = $rowset; }