/**
  * Lay ve mxRecord dung de gui mail
  *
  * @return string Chuoi chua mxRecord dung de gui mail
  * @author DoNguyen added [20100914]
  */
 private function getSMTPServer()
 {
     // CONSTANT Ten cua file .app chua danh sach SMTPServer
     $smtpServerFileName = "smtpServerList";
     // Tao pathname
     $pathName = global_common::FOLDER_CONFIG . $smtpServerFileName;
     // Lay noi dung file
     $arrSMTPServer = Application::getVar($pathName);
     // Noi dung file khong ton tai hoac noi dung rong hoac doc file khong duoc
     if (empty($arrSMTPServer)) {
         // Lay gia tri mac dinh
         $arrSMTPServer = self::getSMTPServerList();
     }
     // Di chuyen chi so mang den mxRecord tiep theo, neu no dang la mxRecord cuoi thi quay ve dau
     $arrSMTPServer[0]++;
     if ($arrSMTPServer[0] >= count($arrSMTPServer)) {
         $arrSMTPServer[0] = 1;
     }
     // Cap nhat lai noi dung file
     Application::setVar($pathName, $arrSMTPServer);
     // Tra ve mxRecord
     return $arrSMTPServer[$arrSMTPServer[0]];
 }
 /**
  * lấy con số id lớn nhất tiếp theo của một bảng
  *
  * @param string $strTableName tên bảng
  * @param int $intReserveId This is a description
  * @param object $readonly nếu được truyền và true thì chỉ đọc lên rồi trả về, ngược lại thì tăng lên 1
  * @return int id lớn nhất
  *	@@author PhongHong edited[20110426]
  */
 public function getMaxID($strTableName, $intReserveId = 1, $readonly)
 {
     $strFileName = self::FOLDER_FILES_MAXID . $strTableName;
     if (!file_exists($strFileName . '.app')) {
         // file not exist
         $arrResult = 0;
         $result = Application::setVar($strFileName, $arrResult);
         if ($result == false) {
             return false;
         }
     }
     $arrResult = Application::getVar($strFileName);
     if ($readonly) {
         return $arrResult;
     }
     $firstId = $arrResult + 1;
     $iswrite = Application::setVar($strFileName, $firstId);
     if ($iswrite) {
         return $firstId;
     }
     return false;
 }
Example #3
0
 public function getArticleTypeByID($objID, $selectField = '*')
 {
     $cache = Application::getVar('getArticleTypeByID' . $objID);
     if ($cache) {
         //global_common::writeLog('get cache',1,$_mainFrame->pPage);
         return $cache;
     }
     $selectField = $selectField ? $selectField : '*';
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_ARTICLE_TYPE, 'WHERE ' . global_mapping::ArticleTypeID . ' = \'' . $objID . '\' '));
     //echo $strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get sl_article_type ByID:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     Application::setVar('getArticleTypeByID' . $objID, $arrResult[0]);
     //print_r($arrResult);
     return $arrResult[0];
 }
Example #4
0
 } else {
     $cat = '0';
 }
 if ($address) {
     if ($condition) {
         $condition .= ' AND ';
     }
     $condition .= '`' . global_mapping::Name . '` like \'%' . $address . '%\'';
 }
 //echo  $condition;
 //print_r($location);
 //return;
 $allStores = Application::getVar('allStores_' . $cat . '_' . $address);
 if (!$allStores) {
     $allStores = $objStore->getAllStore(0, global_mapping::StoreID . ',' . global_mapping::Latitude . ',' . global_mapping::Longitude, $condition);
     Application::setVar('allStores_' . $cat . '_' . $address, $allStores);
 }
 //print_r($allStores);
 //return;
 $count = 0;
 //return;
 $result = array();
 //echo $distance.'<br>';
 foreach ($allStores as $item) {
     //echo date('Y-m-d H:i:s').'<br>';
     //removing
     //   $count++;
     //   if($count>=1000)
     //     break;
     //End removing
     //echo $location['lat'].$location['long'].$item[global_mapping::Latitude].$item[global_mapping::Longitude].'<br>';