Example #1
0
 function viewinvoiceAction()
 {
     $orderId = $this->_request->getParam('orderId');
     $tblOrder = new Kutu_Core_Orm_Table_Order();
     $items = $tblOrder->getOrderDetail($orderId);
     $this->view->orderId = $orderId;
     $this->view->invoiceNumber = $items[0]['invoiceNumber'];
     $this->view->datePurchased = Kutu_Lib_Formater::get_date($items[0]['datePurchased']);
     $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $rowTaxRate = $tblPaymentSetting->fetchRow("settingKey='taxRate'");
     if ($this->_user->kopel != $items[0]['userId']) {
         $this->_redirect(KUTU_ROOT_URL . '/store/cartempty');
     }
     $result = array();
     $result['subTotal'] = 0;
     for ($iCart = 0; $iCart < count($items); $iCart++) {
         $itemId = $items[$iCart]['itemId'];
         $qty = 1;
         $itemPrice = $items[$iCart]['price'];
         $result['items'][$iCart]['itemId'] = $itemId;
         $result['items'][$iCart]['item_name'] = $items[$iCart]['documentName'];
         $result['items'][$iCart]['itemPrice'] = $itemPrice;
         $result['items'][$iCart]['qty'] = $qty;
         $result['subTotal'] += $itemPrice * $qty;
     }
     $result['taxAmount'] = $result['subTotal'] * $rowTaxRate->settingValue / 100;
     $result['grandTotal'] = $result['subTotal'] + $result['taxAmount'];
     $this->view->cart = $result;
     $data = array();
     $data['taxNumber'] = $items[0]['taxNumber'];
     $data['taxCompany'] = $items[0]['taxCompany'];
     $data['taxAddress'] = $items[0]['taxAddress'];
     $data['taxCity'] = $items[0]['taxCity'];
     $data['taxZip'] = $items[0]['taxZip'];
     $data['taxProvince'] = $items[0]['taxProvince'];
     $data['taxCountry'] = $items[0]['taxCountryId'];
     $data['paymentMethod'] = $items[0]['paymentMethod'];
     $data['currencyValue'] = $items[0]['currencyValue'];
     $this->view->data = $data;
 }
Example #2
0
 function sendInvoiceToUser($orderId)
 {
     $config = new Zend_Config_Ini(KUTU_ROOT_DIR . '/application/configs/mail.ini', 'mail');
     $siteOwner = "Hukumonline";
     $siteName = $config->mail->sender->support->name;
     $contactEmail = $config->mail->sender->support->email;
     $tblOrder = new Kutu_Core_Orm_Table_Order();
     $rowOrder = $tblOrder->find($orderId)->current();
     $userId = $rowOrder->userId;
     $tblUser = new Kutu_Core_Orm_Table_User();
     $rowUser = $tblUser->find($userId)->current();
     $userEmail = $rowUser->email;
     $userFullname = $rowUser->fullName;
     $datePurchased = Kutu_Lib_Formater::get_date($rowOrder->datePurchased);
     if ($rowOrder->paymentMethodNote == "membership") {
         $duedate = date("d/m/y", strtotime($rowOrder->invoiceExpirationDate));
     } else {
         $duedate = "-";
     }
     $message = "Kepada Yth, \r\n{$userFullname}\r\n\r\nBerikut kami beritahukan bahwa Invoice untuk anda sudah dibuat pada tanggal {$datePurchased}.\r\n\r\nDengan metode pembayaran: {$rowOrder->paymentMethod}\r\n\r\nInvoice # {$rowOrder->invoiceNumber}\r\nJumlah tagihan: Rp. {$rowOrder->orderTotal}\r\nJatuh tempo: {$duedate}\r\n\r\nAnda bisa login di Ruang Konsumen untuk melihat status invoice ini atau melakukan pembayaran secara online di " . KUTU_ROOT_URL . "/store/viewinvoice/orderId/{$orderId}.\r\n\r\nTerima kasih,\r\n\r\nHukumonline\r\n\r\n==============================";
     $this->send($config->mail->sender->support->email, $config->mail->sender->support->name, $userEmail, '', "Hukumonline Invoice: " . $rowOrder->invoiceNumber, $message);
 }
Example #3
0
 public function reIndexCatalog()
 {
     gc_enable();
     $this->emptyIndex();
     $time_start = microtime(true);
     $solr =& $this->_solr;
     $log = new Kutu_Log();
     $formater = new Kutu_Lib_Formater();
     $title = new Kutu_View_Helper_GetCatalogTitle();
     //		$tbl = new Kutu_Core_Orm_Table_Catalog();
     //		$rowset = $tbl->fetchAll(); //("profileGuid='kutu_peraturan'");
     $query = "SELECT * FROM KutuCatalog";
     $results = $this->_conn->query($query);
     $rowset = $results->fetchAll(PDO::FETCH_OBJ);
     $documents = array();
     $rowCount = count($rowset);
     for ($iCount = 0; $iCount < $rowCount; $iCount++) {
         $row = $rowset[$iCount];
         //			if($iCount == 100)
         //				break;
         //			echo 'urutan: '.$iCount .'<br>';
         $nextRow = $rowset[$iCount + 1];
         //			echo 'current guid: '.$row->guid.'  '.'next guid: '.$nextRow->guid.'<br>';
         if ($row->modifiedBy !== $row->createdBy) {
             $modified = '<font color=red>[modifiedBy:<i>' . $row->modifiedBy . '</i>]</font>&nbsp;';
         } else {
             $modified = '';
         }
         echo '<li><span style="font:11px verdana,arial,helvetica,sans-serif;">[urutan:' . $iCount . ']&nbsp;indexing:<font color=green>' . $title->getCatalogTitle($row->guid) . '</font>[current guid: ' . $row->guid . '  ' . 'next guid: ' . $nextRow->guid . '][author:<i>' . $row->createdBy . '</i>]&nbsp;' . $modified . '[createdDate:<i>' . $formater->get_date($row->createdDate) . '</i>]</span></li>';
         $documents[] = $this->_createSolrDocument($row);
         if ($iCount % 500 == 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.' '.$row->guid;
                 $log->err($e->getMessage());
                 throw new Zend_Exception($e->getMessage());
                 //					echo $e->getMessage().'<br>';
             }
         }
         flush();
     }
     echo '</ul></div></td></tr></table>';
     try {
         $solr->addDocuments($documents);
         $solr->commit();
         //			$solr->optimize();
     } catch (Exception $e) {
         $log->err($e->getMessage());
         throw new Zend_Exception($e->getMessage());
         //			echo $e->getMessage().'<br>';
     }
     $time_end = microtime(true);
     $time = $time_end - $time_start;
     //		echo'<br>WAKTU EKSEKUSI: '. $time;
     $log->info("WAKTU EKSEKUSI: " . $time . " indexing catalog " . $iCount . " dari " . $rowCount . " " . $username);
     echo '<br><br><span style="font:11px verdana,arial,helvetica,sans-serif;color:#00FF00">WAKTU EKSEKUSI: ' . $time . '<br>indexing catalog ' . $iCount . ' dari ' . $rowCount . '</span>';
     // log to assetSetting
     $tblAssetSetting = new Kutu_Core_Orm_Table_AssetSetting();
     $rowAsset = $tblAssetSetting->fetchRow("application='INDEX CATALOG'");
     if ($rowAsset) {
         $rowAsset->valueText = "Update {$rowCount} indexing-catalog at " . date("Y-m-d H:i:s") . $username;
         $rowAsset->valueInt = $rowAsset->valueInt + 1;
     } else {
         $gman = new Kutu_Core_Guid();
         $catalogGuid = $gman->generateGuid();
         $rowAsset = $tblAssetSetting->fetchNew();
         $rowAsset->guid = $catalogGuid;
         $rowAsset->application = "INDEX CATALOG";
         $rowAsset->part = "KUTU";
         $rowAsset->valueType = "INDEX";
         $rowAsset->valueInt = 0;
         $rowAsset->valueText = $rowCount . " Indexing catalog at " . date("Y-m-d H:i:s") . $username;
     }
     $rowAsset->save();
 }
 function indexingTempAction()
 {
     $start = $this->_getParam('start') ? $this->_getParam('start') : 0;
     $end = $this->_getParam('limit') ? $this->_getParam('limit') : 10;
     $formater = new Kutu_Lib_Formater();
     $hTitle = new Pandamp_Controller_Action_Helper_GetCatalogTitle();
     $isFile = new Pandamp_Controller_Action_Helper_GetCatalogIsFile();
     $tblTmpIndex = new Pandamp_Modules_Extension_Index_Model_TmpIndex();
     $rowset = $tblTmpIndex->fetchAll(null, null, $end, $start);
     $rowCount = $tblTmpIndex->countCatalogsTempIndex();
     //		switch ($profileGuid)
     //		{
     //			case 'peraturan':
     //				$rowset = $tblTmpIndex->fetchAll("profileGuid IN ('kutu_doc','kutu_peraturan','kutu_putusan','kutu_peraturan_kolonial','kutu_rancangan_peraturan')",'',$end,$start);
     //				$rowCount = $tblTmpIndex->countCatalogsTempIndexPeraturan();
     //			break;
     //			case 'berita':
     //				$rowset = $tblTmpIndex->fetchAll("profileGuid IN ('aktual','suratpembaca','komunitas','news','talks','resensi','isuhangat','fokus','kolom','tokoh','jeda','tajuk','info','utama')",'',$end,$start);
     //				$rowCount = $tblTmpIndex->countCatalogsTempIndexArticle();
     //			break;
     //		}
     $a = array();
     $a['totalCount'] = $rowCount;
     $i = 0;
     if ($a['totalCount'] != 0) {
         foreach ($rowset as $row) {
             $a['index'][$i]['guid'] = $row->guid;
             $a['index'][$i]['catalogGuid'] = $row->catalogGuid;
             $a['index'][$i]['title'] = $hTitle->getCatalogTitle($row->catalogGuid) . '&nbsp;<font color=green>[' . $formater->getCatalogAuthor($row->catalogGuid) . ']</font>' . '&nbsp;' . $isFile->GetCatalogIsFile($row->catalogGuid) . '&nbsp;<font color=blue>[' . $row->profileGuid . ']</font>';
             $a['index'][$i]['status'] = $row->status;
             $a['index'][$i]['createdDate'] = $formater->get_date($row->createdDate);
             $i++;
         }
     }
     if ($a['totalCount'] == 0) {
         $a['index'][0]['guid'] = '';
         $a['index'][0]['title'] = '';
         $a['index'][0]['status'] = "";
         $a['index'][0]['createdDate'] = '';
     }
     echo Zend_Json::encode($a);
 }