예제 #1
0
 public function payconfirmyesAction()
 {
     $this->_helper->viewRenderer->setNoRender(TRUE);
     //print_r($this->_request->getParams());
     $id = $this->_request->getParam('orderId');
     $tblOrder = new App_Model_Db_Table_Order();
     $tblHistory = new App_Model_Db_Table_OrderHistory();
     $tblConfirm = new App_Model_Db_Table_PaymentConfirmation();
     $rowOrder = $tblOrder->find($id)->current();
     if ($rowOrder->paymentMethodNote == 'membership') {
         $oldUser = App_Model_Show_User::show()->getUserById($rowOrder->userId);
         $oldpackage = App_Model_Show_AroGroup::show()->getUserGroup($oldUser['packageId']);
         $newGroup = App_Model_Show_AroGroup::show()->getUserGroup($rowOrder->note);
         $notes = date("Y-m-d h:i:s") . " - Changed package " . $oldpackage['name'] . " TO " . $newGroup['name'];
         $notes = $oldUser['notes'] ? $oldUser['notes'] . "\n" . $notes : $notes;
         $dataUser = array('packageId' => $rowOrder->note, 'notes' => $notes, 'modifiedDate' => date("Y-m-d h:i:s"), 'modifiedBy' => Zend_Auth::getInstance()->getIdentity()->username);
         $modelUser = new App_Model_Db_Table_User();
         $dataUserDetail = array('userId' => $oldUser['kopel'], 'packageId' => $oldUser['packageId'], 'promotionId' => $oldUser['promotionId'], 'educationId' => $oldUser['educationId'], 'expenseId' => $oldUser['expenseId'], 'paymentId' => $oldUser['paymentId'], 'businessTypeId' => $oldUser['businessTypeId'], 'periodeId' => $oldUser['periodeId'], 'activationDate' => $oldUser['activationDate'], 'createdDate' => $oldUser['createdDate'], 'createdBy' => $oldUser['createdBy'], 'modifiedDate' => $oldUser['modifiedDate'], 'modifiedBy' => $oldUser['modifiedBy'], 'isActive' => $oldUser['isActive'], 'isContact' => $oldUser['isContact']);
         $modelUserDetail = new App_Model_Db_Table_UserDetail();
         $modelUserDetail->insert($dataUserDetail);
         $acl = Pandamp_Acl::manager();
         $acl->deleteUser($oldUser['username']);
         $acl->addUser($oldUser['username'], $newGroup['name']);
         $tblInvoice = new App_Model_Db_Table_Invoice();
         $where = $tblInvoice->getAdapter()->quoteInto("uid=?", $rowOrder->userId);
         $rowInvoice = $tblInvoice->fetchRow($where);
         if ($rowInvoice) {
             $rowInvoice->invoiceConfirmDate = date("Y-m-d");
             $rowInvoice->isPaid = 'Y';
             // get expiration date
             $temptime = time();
             $temptime = Pandamp_Lib_Formater::DateAdd('m', $oldUser['paymentId'], $temptime);
             $rowInvoice->expirationDate = strftime('%Y-%m-%d', $temptime);
             $rowInvoice->save();
             $dataUser['periodeId'] = 3;
         }
         $modelUser->update($dataUser, "kopel='" . $rowOrder->userId . "'");
     }
     //select payment date from paymentconfirmation
     $date = $tblConfirm->fetchAll("orderId = " . $id . " AND confirmed = 0");
     $data['paymentDate'] = $date[0]->paymentDate;
     //update order
     $data['orderStatus'] = 3;
     $tblOrder->update($data, "orderId = " . $id);
     //update paymentconfirmation
     $dataConfirm['confirmed'] = 1;
     $tblConfirm->update($dataConfirm, "orderId = " . $id);
     //add history
     $dataHistory = $tblHistory->fetchNew();
     //history data
     $dataHistory['orderId'] = $id;
     $dataHistory['orderStatusId'] = 3;
     $dataHistory['dateCreated'] = date('Y-m-d');
     $dataHistory['userNotified'] = 1;
     $dataHistory['note'] = 'confirmed';
     $dataHistory->save();
     //mailer
     //$this->Mailer($id, 'user-confirm', 'user');
     $mod = new App_Model_Store_Mailer();
     $mod->sendReceiptToUser($id, ucwords($date[0]->paymentMethod));
     //redirect to confirmation page
     $this->_redirect($this->view->serverUrl() . '/' . $this->view->getLanguage() . '/store/confirm');
 }
예제 #2
0
 function detailIndexKlinikAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $dateDiff = new Pandamp_Lib_DateDiff();
     $folderGuid = $this->_getParam('folderGuid') ? $this->_getParam('folderGuid') : '';
     $start = $this->_getParam('start') ? $this->_getParam('start') : 0;
     $limit = $this->_getParam('limit') ? $this->_getParam('limit') : 0;
     $a = array();
     $rowset = App_Model_Show_Catalog::show()->fetchFromFolder($folderGuid, $start, $limit);
     $a['folderGuid'] = $folderGuid;
     $a['totalCount'] = App_Model_Show_Catalog::show()->getWartaCount($folderGuid);
     $ii = 0;
     if ($a['totalCount'] != 0) {
         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\" />";
             }
             $rowCatalogTitle = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedCommentTitle');
             $rowCatalogQuestion = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedCommentQuestion');
             $rowCatalogSelectCat = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedKategoriKlinik');
             $author = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedSelectNama');
             $source = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedSelectMitra');
             $a['index'][$ii]['title'] = $rowCatalogTitle;
             $a['index'][$ii]['question'] = $rowCatalogQuestion;
             $a['index'][$ii]['secat'] = $rowCatalogSelectCat;
             $a['index'][$ii]['category'] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($rowCatalogSelectCat, 'fixedTitle');
             $a['index'][$ii]['guid'] = $row['guid'];
             $a['index'][$ii]['createdBy'] = $row['createdBy'];
             $a['index'][$ii]['author'] = isset($author) ? $author : '';
             if (isset($source)) {
                 $a['index'][$ii]['source'] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($source, 'fixedTitle');
                 $a['index'][$ii]['sid'] = $source;
             } 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++;
         }
     }
     if ($a['totalCount'] == 0) {
         $a['index'][0]['title'] = "-";
         $a['index'][0]['question'] = "-";
         $a['index'][0]['category'] = "-";
         $a['index'][0]['guid'] = "-";
         $a['index'][0]['createdBy'] = "-";
         $a['index'][0]['author'] = "-";
         $a['index'][0]['source'] = "-";
         $a['index'][0]['publishedDate'] = "-";
     }
     echo Zend_Json::encode($a);
 }
예제 #3
0
 function fetchClinicByCategoryAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $r = $this->getRequest();
     $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : '';
     $start = $r->getParam('start') ? $r->getParam('start') : 0;
     $limit = $r->getParam('limit') ? $r->getParam('limit') : 20;
     $orderBy = $r->getParam('orderBy') ? $r->getParam('sortBy') : 'publishedDate';
     $sortOrder = $r->getParam('sortOrder') ? $r->getParam('sortOrder') : ' DESC';
     $query = "profile:klinik status:99 kategoriklinik:{$catalogGuid};publishedDate desc";
     $a = array();
     $a['query'] = $query;
     $vTitle = new Pandamp_Controller_Action_Helper_GetCatalogTitle();
     $indexingEngine = Pandamp_Search::manager();
     $hits = $indexingEngine->find($query, $start, $limit);
     $num = $hits->response->numFound;
     $solrNumFound = count($hits->response->docs);
     $ii = 0;
     if ($solrNumFound == 0) {
         $a['klinikkategori'][0]['guid'] = 'XXX';
         $a['klinikkategori'][0]['title'] = 'Kategori klinik kosong';
         $a['klinikkategori'][0]['pertanyaan'] = "";
         $a['klinikkategori'][0]['createdBy'] = "";
         $a['klinikkategori'][0]['author'] = '';
         $a['klinikkategori'][0]['sid'] = '';
         $a['klinikkategori'][0]['source'] = '';
         $a['klinikkategori'][0]['publishedDate'] = '';
         $a['klinikkategori'][0]['existence'] = '';
     } else {
         if ($solrNumFound > $limit) {
             $numRowset = $limit;
         } else {
             $numRowset = $solrNumFound;
         }
         for ($ii = 0; $ii < $numRowset; $ii++) {
             if (isset($hits->response->docs[$ii])) {
                 $row = $hits->response->docs[$ii];
                 $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\" />";
                 }
                 $a['klinikkategori'][$ii]['guid'] = $row->id;
                 $a['klinikkategori'][$ii]['title'] = $row->title;
                 $a['klinikkategori'][$ii]['pertanyaan'] = $row->commentQuestion;
                 $a['klinikkategori'][$ii]['createdBy'] = $row->createdBy;
                 $a['klinikkategori'][$ii]['author'] = $row->kontributor;
                 $a['klinikkategori'][$ii]['sid'] = $row->sumber;
                 $a['klinikkategori'][$ii]['source'] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row->kontributor, 'fixedTitle');
                 $a['klinikkategori'][$ii]['publishedDate'] = date("d/m/Y", strtotime($row->publishedDate));
                 $a['klinikkategori'][$ii]['existence'] = '<div style="float:left;padding:2px;margin: 1px 10px 10px 0px;"><a href="">' . $txt_existence . '</a></div>';
             }
         }
     }
     echo Zend_Json::encode($a);
 }
예제 #4
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);
 }
예제 #5
0
 function rightdownmenuAction()
 {
     $modelUser = App_Model_Show_User::show()->getUserById($this->_getParam('id'));
     $this->view->user = $modelUser;
 }
예제 #6
0
 /**
  * @modifiedDate: 2012-11-20 15:25
  * @todo Changed $temptime = strtotime($rowset->expirationDate)
  *
  */
 function renewAction()
 {
     if (!Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('membership', 'all')) {
         $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/error/restricted');
     }
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $aResult = array();
     $id = $this->_request->getParam('id') ? $this->_request->getParam('id') : '';
     $tblInvoice = new App_Model_Db_Table_Invoice();
     $rowset = $tblInvoice->fetchRow("invoiceId=" . $id . " AND isPaid='Y'");
     if ($rowset) {
         $rowInvoice = $tblInvoice->fetchNew();
         $rowInvoice->uid = $rowset->uid;
         $rowUser = App_Model_Show_User::show()->getUserById($rowset->uid);
         if (isset($rowUser['paymentId']) && $rowUser['paymentId'] != 0) {
             $todays_date = date("Y-m-d");
             $tblPackage = new App_Model_Db_Table_Package();
             $rowPackage = $tblPackage->fetchRow("packageId=" . $rowUser['packageId'] . "");
             if ($rowUser['paymentId'] == 12) {
                 $price = $rowPackage->charge * 11;
                 $price = $price + 0.1 * $price;
             } else {
                 $price = $rowPackage->charge * $rowUser['paymentId'];
                 $price = $price + 0.1 * $price;
             }
             //$rowInvoice->price				= $rowset->price;
             $rowInvoice->price = $price;
             $rowInvoice->discount = $rowset->discount;
             $rowInvoice->invoiceOutDate = $rowset->expirationDate;
             $rowInvoice->invoiceConfirmDate = $todays_date;
             $rowInvoice->clientBankAccount = $rowset->clientBankAccount;
             $rowInvoice->isPaid = 'Y';
             // get expiration date
             //$temptime = time();
             $temptime = strtotime($rowset->expirationDate);
             //$temptime = strtotime($todays_date); // Expire dihitung setelah pelanggan membayarar
             $temptime = Pandamp_Lib_Formater::DateAdd('m', $rowUser['paymentId'], $temptime);
             $expiredDate = strftime('%Y-%m-%d', $temptime);
             $today = strtotime($todays_date);
             $expiration_date = strtotime($expiredDate);
             if ($expiration_date < $today) {
                 $rowset->isPaid = 'E';
                 // status expire
                 $rowset->save();
                 $notes = date("Y-m-d h:i:s") . " - Invoice expired:" . $id;
                 $data = array('notes' => new Zend_Db_Expr("CONCAT(ifnull(notes,''),' \n{$notes}')"));
                 $modelUser = new App_Model_Db_Table_User();
                 $modelUser->update($data, "kopel='" . $rowset->uid . "'");
                 $aResult['isError'] = true;
                 $aResult['msg'] = 'Invoice sudah tidak bisa di renew karena tanggal expire < dari tanggal sekarang, <br>silahkan anda buat baru';
             } else {
                 $rowInvoice->expirationDate = $expiredDate;
                 $rowInvoice->save();
                 $rowset->isPaid = 'R';
                 // status renew
                 $rowset->save();
                 $notes = date("Y-m-d h:i:s") . " - Renew invoice:" . $id;
                 $data = array('notes' => new Zend_Db_Expr("CONCAT(ifnull(notes,''),' \n{$notes}')"));
                 $modelUser = new App_Model_Db_Table_User();
                 $modelUser->update($data, "kopel='" . $rowset->uid . "'");
                 $aResult['isError'] = true;
                 $aResult['msg'] = 'Invoice has been updated';
             }
         } else {
             $aResult['isError'] = true;
             $aResult['msg'] = 'Lamanya berlangganan kosong';
         }
     } else {
         $aResult['isError'] = true;
         $aResult['msg'] = 'Invalid Invoice ID';
     }
     echo Zend_Json::encode($aResult);
 }
예제 #7
0
 function indexAction()
 {
     $request = $this->getRequest();
     $printmode = $request->getParam('printmode');
     if ($printmode == 1) {
         $this->_helper->layout->setLayout('layout-report-print');
     }
     $now = getdate();
     $y = $request->getParam('year') ? $request->getParam('year') : $now['year'];
     $show = $request->getParam('show') ? $request->getParam('show') : 0;
     $prof = $request->getParam('prof') ? $request->getParam('prof') : 0;
     $uri = $request->getRequestUri();
     if (strpos($uri, '?')) {
         $sAddition = '&';
     } else {
         $sAddition = '?';
     }
     if ($show == 0) {
         $showname = "Table";
     } else {
         $showname = "Graph";
     }
     $yearper = 0;
     $yearput = 0;
     $yearart = 0;
     $yearkli = 0;
     $year_enews = 0;
     $year_eilb = 0;
     $year_eild = 0;
     $year_user = 0;
     $year_user_individual = 0;
     $year_user_corporate = 0;
     $year_user_ilb = 0;
     $year_user_ild = 0;
     $year_user_complete = 0;
     $year_user_professional = 0;
     $year_user_premium = 0;
     $year_user_executive = 0;
     $sumrep = 0;
     $sum = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     $url = "";
     $mon = array("{$y}-01", "{$y}-02", "{$y}-03", "{$y}-04", "{$y}-05", "{$y}-06", "{$y}-07", "{$y}-08", "{$y}-09", "{$y}-10", "{$y}-11", "{$y}-12");
     for ($i = 0; $i < count($mon); $i++) {
         $peraturan[] = App_Model_Show_Catalog::show()->getCatalogByMonth('peraturan', $mon[$i]);
         $yearper += $peraturan[$i];
         $putusan[] = App_Model_Show_Catalog::show()->getCatalogByMonth('kutu_putusan', $mon[$i]);
         $yearput += $putusan[$i];
         $article[] = App_Model_Show_Catalog::show()->getCatalogByMonth('article', $mon[$i]);
         $yearart += $article[$i];
         $clinic[] = App_Model_Show_Catalog::show()->getCatalogByMonth('klinik', $mon[$i]);
         $yearkli += $clinic[$i];
         $enews[] = App_Model_Show_Catalog::show()->getEnglishCatalogByMonth('news', $mon[$i]);
         $year_enews += $enews[$i];
         $eilb[] = App_Model_Show_Catalog::show()->getEnglishCatalogByMonth('ilb', $mon[$i]);
         $year_eilb += $eilb[$i];
         $eild[] = App_Model_Show_Catalog::show()->getEnglishCatalogByMonth('ild', $mon[$i]);
         $year_eild += $eild[$i];
         $user[] = App_Model_Show_User::show()->getUserByMonth(13, $mon[$i]);
         $year_user += $user[$i];
         $user_individual[] = App_Model_Show_User::show()->getUserByMonth(14, $mon[$i]);
         $year_user_individual += $user_individual[$i];
         $user_corporate[] = App_Model_Show_User::show()->getUserByMonth(15, $mon[$i]);
         $year_user_corporate += $user_corporate[$i];
         $user_ilb[] = App_Model_Show_User::show()->getUserByMonth(16, $mon[$i]);
         $year_user_ilb += $user_ilb[$i];
         $user_ild[] = App_Model_Show_User::show()->getUserByMonth(17, $mon[$i]);
         $year_user_ild += $user_ild[$i];
         $user_complete[] = App_Model_Show_User::show()->getUserByMonth(18, $mon[$i]);
         $year_user_complete += $user_complete[$i];
         $user_professional[] = App_Model_Show_User::show()->getUserByMonth(36, $mon[$i]);
         $year_user_professional += $user_professional[$i];
         $user_premium[] = App_Model_Show_User::show()->getUserByMonth(37, $mon[$i]);
         $year_user_premium += $user_premium[$i];
         $user_exec[] = App_Model_Show_User::show()->getUserByMonth(38, $mon[$i]);
         $year_user_executive += $user_exec[$i];
         if ($prof == 0) {
             // all
             $sum[$i] = $peraturan[$i] + $putusan[$i] + $article[$i] + $clinic[$i] + $enews[$i] + $eilb[$i] + $eild[$i] + $user[$i] + $user_individual[$i] + $user_corporate[$i] + $user_ilb[$i] + $user_ild[$i] + $user_complete[$i] + $user_professional[$i] + $user_premium[$i] + $user_exec[$i];
         } else {
             if ($prof == 1) {
                 // Data Center
                 $sum[$i] = $peraturan[$i] + $putusan[$i];
             } else {
                 if ($prof == 2) {
                     // Redaksi
                     $sum[$i] = $article[$i];
                 } else {
                     if ($prof == 3) {
                         // Klinik
                         $sum[$i] = $clinic[$i];
                     } else {
                         if ($prof == 4) {
                             // E-News
                             $sum[$i] = $enews[$i] + $eilb[$i] + $eild[$i];
                         } else {
                             if ($prof == 5) {
                                 // User
                                 $sum[$i] = $user[$i] + $user_individual[$i] + $user_corporate[$i] + $user_ilb[$i] + $user_ild[$i] + $user_complete[$i] + $user_professional[$i] + $user_premium[$i] + $user_exec[$i];
                             }
                         }
                     }
                 }
             }
         }
         $sumrep += $sum[$i];
         $url .= "&x[{$i}]=" . Pandamp_Lib_Calendar::get_month_name($i + 1, "%b") . "&y1[{$i}]=" . $sum[$i];
     }
     if ($prof == 0) {
         $profname = "All Profile";
     } else {
         if ($prof == 1) {
             $profname = "Data Center";
         } else {
             if ($prof == 2) {
                 $profname = "Redaksi";
             } else {
                 if ($prof == 3) {
                     $profname = "Klinik";
                 } else {
                     if ($prof == 4) {
                         $profname = "English";
                     } else {
                         if ($prof == 5) {
                             $profname = "Layanan";
                         }
                     }
                 }
             }
         }
     }
     //$url = "tabtitle1=Division Reports of $y&tabtitle2=Total Records $sumrep&tabtitle3=$profname&y1legend=Value (record)&showvalue=1".$url; // --> JPGraph type 5
     $url = "tabtitle1=Division Reports of {$y}&tabtitle2=Total Records {$sumrep}&tabtitle3={$profname}&y1legend=Value (record)&novalue=0&decimal=1" . $url;
     $this->view->assign('y', $y);
     $this->view->assign('m', $mon);
     $this->view->assign('sAddition', $sAddition);
     $this->view->assign('show', $show);
     $this->view->assign('showname', $showname);
     $this->view->assign('prof', $prof);
     $this->view->assign('profname', $profname);
     $this->view->assign('p', $peraturan);
     $this->view->assign('yp', $yearper);
     $this->view->assign('put', $putusan);
     $this->view->assign('yput', $yearput);
     $this->view->assign('art', $article);
     $this->view->assign('yart', $yearart);
     $this->view->assign('clinic', $clinic);
     $this->view->assign('ykli', $yearkli);
     $this->view->assign('enews', $enews);
     $this->view->assign('yenews', $year_enews);
     $this->view->assign('eilb', $eilb);
     $this->view->assign('yeilb', $year_eilb);
     $this->view->assign('eild', $eild);
     $this->view->assign('yeild', $year_eild);
     $this->view->assign('user', $user);
     $this->view->assign('year_user', $year_user);
     $this->view->assign('user_individual', $user_individual);
     $this->view->assign('year_user_individual', $year_user_individual);
     $this->view->assign('user_corporate', $user_corporate);
     $this->view->assign('year_user_corporate', $year_user_corporate);
     $this->view->assign('user_ilb', $user_ilb);
     $this->view->assign('year_user_ilb', $year_user_ilb);
     $this->view->assign('user_ild', $user_ild);
     $this->view->assign('year_user_ild', $year_user_ild);
     $this->view->assign('user_complete', $user_complete);
     $this->view->assign('year_user_complete', $year_user_complete);
     $this->view->assign('user_professional', $user_professional);
     $this->view->assign('year_user_professional', $year_user_professional);
     $this->view->assign('user_premium', $user_premium);
     $this->view->assign('year_user_premium', $year_user_premium);
     $this->view->assign('user_exec', $user_exec);
     $this->view->assign('year_user_executive', $year_user_executive);
     $this->view->assign('sum', $sum);
     $this->view->assign('sumrep', $sumrep);
     $this->view->assign('uri', $uri);
     $this->view->assign('printmode', $printmode);
     //$this->view->assign('graph_url', ROOT_URL."/data/graph/graph.view.php?type=5&$url");
     $this->view->assign('graph_url', ROOT_URL . "/data/graph/graph.view.php?type=1&{$url}");
     $this->view->assign('graph_alt', "Division Reports");
 }
예제 #8
0
 public function countuserbyqueryAction()
 {
     //$mainQuery = "SELECT count(*) as count from KutuUser where ";
     $r = $this->getRequest();
     //$q = ($r->getParam('q'))? $r->getParam('q') : '';
     //$q = base64_decode($q);
     $pColumns = array('ku.kopel', 'ku.username', 'ku.company', 'gag.value', 'kus.status');
     $sWhere = "";
     if ($r->getParam('q')) {
         $q = base64_decode($r->getParam('q'));
         for ($i = 0; $i < count($pColumns); $i++) {
             $sWhere .= $pColumns[$i] . " LIKE '%" . mysql_real_escape_string($q) . "%' OR ";
         }
         $sWhere = substr_replace($sWhere, "", -3);
     } else {
         $sWhere = "1=1";
     }
     //$finalQuery = $mainQuery.$sWhere;
     //$db = Zend_Registry::get('db2');
     //$query = $db->query($finalQuery);
     //$db = Zend_Db_Table::getDefaultAdapter()->query($finalQuery);
     //$row = $query->fetchAll(Zend_Db::FETCH_ASSOC);
     //$row = $db->fetchAll(Zend_Db::FETCH_OBJ);
     //echo $row[0]['count'];
     $tblUser = new App_Model_Db_Table_User();
     $row = App_Model_Show_User::show()->countUser($sWhere);
     echo $row;
     die;
 }