当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Datetime_UIType::getDBInsertedValue方法代码示例

本文整理汇总了PHP中Vtiger_Datetime_UIType::getDBInsertedValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Datetime_UIType::getDBInsertedValue方法的具体用法?PHP Vtiger_Datetime_UIType::getDBInsertedValue怎么用?PHP Vtiger_Datetime_UIType::getDBInsertedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Datetime_UIType的用法示例。


在下文中一共展示了Vtiger_Datetime_UIType::getDBInsertedValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process(Vtiger_Request $request)
 {
     $log = vglobal('log');
     $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__);
     $db = PearDatabase::getInstance();
     $qualifiedModule = $request->getModule(false);
     $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     // synchronise bank list
     $moduleModel->refreshBanks();
     $downloadBtn = !$request->isEmpty('download') ? $request->get('download') : false;
     $date = !$request->isEmpty('duedate') ? Vtiger_Datetime_UIType::getDBInsertedValue($request->get('duedate')) : false;
     $dateCur = '';
     if ($date) {
         // if its future date change it to present one
         if (strtotime($date) > strtotime(date('Y-m-d'))) {
             $date = date('Y-m-d');
         }
         $dateCur = $date;
     } else {
         $dateCur = date('Y-m-d');
     }
     // take currency rates for yesterday
     if (strcmp(date('Y-m-d'), $dateCur) == 0) {
         $dateCur = strtotime("-1 day", strtotime($dateCur));
         $dateCur = date('Y-m-d', $dateCur);
     }
     $dateCur = Vtiger_Functions::getLastWorkingDay($dateCur);
     // get currency if not already archived
     if ($downloadBtn) {
         $moduleModel->fetchCurrencyRates($dateCur);
     }
     $selectBankId = $moduleModel->getActiveBankId();
     $history = $moduleModel->getRatesHistory($selectBankId, $dateCur, $request);
     $bankTab = array();
     $bankSQL = "SELECT * FROM yetiforce_currencyupdate_banks";
     $bankResult = $db->query($bankSQL, true);
     $i = 0;
     while ($row = $db->fetchByAssoc($bankResult)) {
         $bankTab[$i]['id'] = $row['id'];
         $bankName = $row['bank_name'];
         $bankTab[$i]['bank_name'] = $bankName;
         $bankTab[$i]['active'] = $row['active'];
         $i++;
     }
     // number of currencies
     $curr_num = $moduleModel->getCurrencyNum();
     // get info about main currency
     $mainCurrencyInfo = Vtiger_Functions::getDefaultCurrencyInfo();
     $viewer = $this->getViewer($request);
     $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
     $viewer->assign('USER_MODEL', $currentUser);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('MODULENAME', 'CurrencyUpdate');
     $viewer->assign('DATE', $request->has('duedate') ? Vtiger_Date_UIType::getDisplayValue($dateCur) : '');
     $viewer->assign('CURRNUM', $curr_num);
     $viewer->assign('BANK', $bankTab);
     $viewer->assign('HISTORIA', $history);
     $viewer->assign('MAINCURR', $mainCurrencyInfo);
     $viewer->assign('SUPPORTED_CURRENCIES', $moduleModel->getSupportedCurrencies());
     $viewer->assign('UNSUPPORTED_CURRENCIES', $moduleModel->getUnSupportedCurrencies());
     $viewer->view('Index.tpl', $qualifiedModule);
     $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:64,代码来源:Index.php


注:本文中的Vtiger_Datetime_UIType::getDBInsertedValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。