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


PHP TimeDate::get_date_format方法代码示例

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


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

示例1: sync_events

function sync_events($one_user = false, $sel_user = "")
{
    global $beanList, $beanFiles, $path;
    $use_offset_time = true;
    $td = new TimeDate();
    $arr_modules[] = "Meetings";
    $arr_modules[] = "Calls";
    $arr_modules[] = "Tasks";
    global $timedate;
    global $beanList, $beanFiles, $path, $current_user;
    for ($tn = 0; $tn < count($arr_modules); $tn++) {
        ob_start();
        $module_name = $arr_modules[$tn];
        $class_name = $beanList[$module_name];
        require_once $beanFiles[$class_name];
        $seed = new $class_name();
        $tbn = $seed->table_name;
        $tablename = $tbn;
        $cstmtbname2 = $tablename . "_cstm";
        if ($one_user == true) {
            if ($_SESSION['authenticated_user_id'] == "" and 1 == 2) {
            } else {
                if ($sel_user != "") {
                    $cu = $sel_user;
                } else {
                    $cu = $_SESSION['authenticated_user_id'];
                }
                $tdus = new TimeDate();
                $cus = new User();
                $cus->retrieve($cu);
                ##############
                global $current_user;
                $current_user = $cus;
                ##############
                $calendar_priv_add = $cus->google_mcalendar_c;
                $crdatefilt = $cus->google_mafterdate_c;
                $crdatefilt = $tdus->swap_formats($crdatefilt, $td->get_date_format(true, $cus), "Y-m-d");
                unset($cus);
                $sql_user = " 1 and {$tbn}.assigned_user_id='{$cu}' and ({$cstmtbname2}.old_id_c='' or {$cstmtbname2}.old_id_c is null ) ";
                if ($crdatefilt != '') {
                    $sql_user .= "  and {$tbn}.date_entered>='{$crdatefilt}' ";
                }
                $query = $sql_user;
            }
        }
        $d1d = array();
        $s = array();
        $ch = array();
        $fd = array();
        $forexp = "";
        $fort1d = "";
        $t1d = "";
        $nt = "";
        $nt1 = "";
        $cm = date("m");
        $cy = date("Y");
        unset($response);
        global $max_events_upload_google;
        $response = $seed->get_list($order_by, $query, $offset, 10000, $max_events_upload_google, false);
        if ($tablename == "calls") {
        }
        $newdoc = $response['list'][$tn1];
        if (1 == 1) {
            $tablename = $tbn;
            echo "<br>****** Get events from {$tablename}";
            require_once 'modules/Calendar/DateTimeUtil.php';
            $cm = date("m");
            $cy = date("Y");
            for ($tn1 = 0; $tn1 < count($response['list']); $tn1++) {
                unset($a);
                unset($a1);
                unset($a2);
                unset($s);
                unset($current_user);
                unset($user);
                unset($td);
                $a1 = $response['list'][$tn1];
                $current_user = new User();
                $current_user->retrieve($a1->assigned_user_id);
                debugg("<br> current user for event " . $a1->assigned_user_id . "   " . $current_user->name);
                $user = $current_user;
                $td = new TimeDate();
                $user_google_mafterdate_c = $td->swap_formats($current_user->google_mafterdate_c, $td->get_date_format(true, $current_user), "Y-m-d");
                $add_notifications = $current_user->google_mnotifications_c;
                unset($a2);
                if ($tablename == 'meetings') {
                    $a2 = new Meeting();
                }
                if ($tablename == 'calls') {
                    $a2 = new Call();
                }
                if ($tablename == 'tasks') {
                    $a2 = new Task();
                }
                unset($a);
                $a = $a2->retrieve($a1->id);
                if ($a->old_id_c == "" or 1 == 1) {
                    global $calls_prefix;
                    global $meetings_prefix;
                    global $tasks_prefix;
//.........这里部分代码省略.........
开发者ID:Terradex,项目名称:sugar,代码行数:101,代码来源:sync.php

示例2: array

//подключение к базе
global $db;
//$bean->db
$r = $db->query('SELECT currency_code FROM px_exchangerates WHERE deleted=0 GROUP BY currency_code');
$load = array();
while ($a = $db->fetchByAssoc($r)) {
    $load[] = $a['currency_code'];
}
$datetime1 = new DateTime('2009-10-11');
$datetime2 = new DateTime('2009-10-13');
$interval = $datetime1->diff($datetime2);
$today = date("Y-m-d");
global $current_user;
$td = new TimeDate($current_user);
$date_my = $td->to_db_date(date($td->get_date_time_format()));
$date_my = $td->to_db_date(date($td->get_date_format()));
//только дата
$datetime1 = date($td->get_date_format());
$datetime2 = date_create_from_format($td->get_date_format(), $this->bean->px_status_study_date);
echo $interval->format('%R%a дней');
//%R плюс минус
echo $interval->format('%a дней');
$GLOBALS['timedate']->to_db_date();
$GLOBALS['timedate']->nowDbDate();
$GLOBALS['timedate']->nowDb();
//time
//debug_backtrace
$bcktrc = debug_backtrace();
$bcktrc = json_encode($bcktrc);
echo "<script> dbg_bcktrc = {$bcktrc}; </script>";
$debug_b = json_encode(debug_backtrace());
开发者ID:jasondavis,项目名称:sugarcrm,代码行数:31,代码来源:model.php

示例3: display

 function display()
 {
     $ss = new Sugar_Smarty();
     $table = array('Leads' => 'Leads', 'Opportunities' => 'Opportunities', 'FITs' => 'Customer', 'Contacts' => 'Contacts', 'Accounts' => 'Company', 'Cases' => 'Cases', 'Notes' => 'Notes', 'Calls' => 'Calls', 'Emails' => 'Emails', 'Meetings' => 'Meetings', 'Tasks' => 'Tasks');
     $timedate = new TimeDate();
     global $db, $mod_strings, $app_list_strings, $current_user;
     $ss = new Sugar_Smarty();
     $ss->assign('MOD', $mod_strings);
     $focus = new C_Reports();
     $role = $focus->getUserRole('Reports', $current_user->id);
     $list_user = $focus->getUserForReportAsRole();
     $list_group = $focus->getAllSecuritySuite();
     $ss->assign('lst_group', get_select_options_with_id($app_list_strings['report_securitysuite_dom'], ''));
     $ss->assign('lst_user', get_select_options_with_id($app_list_strings['report_user_dom'], ''));
     if (isset($_REQUEST['submit'])) {
         $start_date = $_REQUEST['start_date'];
         $end_date = $_REQUEST['end_date'];
         $user_id = $_REQUEST['lst_user'];
         $list_user = $_REQUEST['user_id'];
         $time_range = $_REQUEST['time_range'];
         $start_end_yes = $_REQUEST['start_end_yes'];
         $report_option = $_REQUEST['report_option'];
         $type = $time_range ? $time_range : $start_end_yes;
         $ss->assign('TYPE', $type);
         $ss->assign('report_option', $report_option);
         $lst_user = get_select_options($app_list_strings['report_user_dom'], $user_id);
         $ss->assign('lst_user', $lst_user);
         if ($list_user) {
             $user_id = json_decode(base64_decode($list_user));
             if (count($user_id) > 0) {
                 $user_id = $user_id;
             }
         }
         if ($user_id) {
             $user_id = (array) $user_id;
         } else {
             unset($app_list_strings['report_user_dom']['0']);
             $user_id = array_keys($app_list_strings['report_user_dom']);
         }
         if ($group) {
             $group = (array) $group;
         } else {
             unset($app_list_strings['report_securitysuite_dom']['0']);
             $group = array_keys($app_list_strings['report_securitysuite_dom']);
         }
         $dateOp = new AdvancedDatetimeOperations($focus);
         $user_format = $timedate->get_date_format($current_user);
         $date_format = $_REQUEST['date_format'] != '' ? $_REQUEST['date_format'] : $user_format;
         if ($start_end_yes) {
             $time_range = '';
             $start_date = $timedate->to_display($_REQUEST['start_date'], $date_format, 'Y-m-d');
             $end_date = $timedate->to_display($_REQUEST['end_date'], $date_format, 'Y-m-d');
         } else {
             $start_date = date('Y-m-d');
             $end_date = date('Y-m-d');
             $dateOp->calc_date2($start_date, $end_date, $time_range);
         }
         $date_start = $timedate->to_display($start_date, 'Y-m-d', $user_format);
         $date_end = $timedate->to_display($end_date, 'Y-m-d', $user_format);
         $html = '';
         $html = '<br /><div style="color:red"><b>Note : (Created/Assigned/Modified)</b></div>';
         $html .= '<table class="h3Row" cellpadding="0" cellspacing="0" width="100%" border="1" style="border-collapse: collapse;"> ';
         $html .= '<thead>';
         $html .= '<td class="tb_border" style="background:#EBEBED"><b>User</b></td>';
         foreach ($table as $table_name) {
             $html .= '<td style="background:#EBEBED;text-align:center" class="tb_border" width="' . 100 / count($table) . '%"><b>' . $table_name . '</b></td>';
         }
         $html .= '</tr>';
         $html .= '</thead>';
         if (count($user_id) > 0 && $user_id[0] != '0') {
             foreach ($user_id as $value) {
                 $html .= '<tr height="20">';
                 $html .= '<td class="tb_border"> ' . translate('report_user_dom', '', $value) . ' </td>';
                 foreach ($table as $table_value => $table_name) {
                     $recordCreate = $focus->countRecordCreate(strtolower($table_value), $value, $start_date, $end_date);
                     $recordModify = $focus->countRecordAsignedTo(strtolower($table_value), $value, $start_date, $end_date);
                     $recordModified = $focus->countRecordModify(strtolower($table_value), $value, $start_date, $end_date);
                     if ($recordCreate > 0) {
                         $create_url = '<a target="blank" href="index.php?module=' . $table_value . '&action=index&query=true&created_by_basic=' . $value . '&date_entered_basic_range_choice=between&start_range_date_entered_basic=' . $date_start . '&end_range_date_entered_basic=' . $date_end . '&searchFormTab=basic_search">' . $recordCreate . '</a>';
                     } else {
                         $create_url = $recordCreate;
                     }
                     if ($recordModify > 0) {
                         $modify_url = '<a target="blank" href="index.php?module=' . $table_value . '&action=index&query=true&assigned_user_id=' . $value . '&date_modified_basic_range_choice=between&start_range_date_modified_basic=' . $date_start . '&end_range_date_modified_basic=' . $date_end . '&searchFormTab=basic_search">' . $recordModify . '</a>';
                     } else {
                         $modify_url = $recordModify;
                     }
                     if ($recordModified > 0) {
                         $modified_url = '<a target="blank" href="index.php?module=' . $table_value . '&action=index&query=true&modified_user_id_basic=' . $value . '&date_modified_basic_range_choice=between&start_range_date_modified_basic=' . $date_start . '&end_range_date_modified_basic=' . $date_end . '&searchFormTab=basic_search">' . $recordModified . '</a>';
                     } else {
                         $modified_url = $recordModified;
                     }
                     $html .= '<td style="text-align:center" class="tb_border">' . $create_url . ' / ' . $modify_url . ' / ' . $modified_url . ' </td>';
                 }
                 $html .= '</tr>';
             }
         }
         //$countACC = $focus->get_audit_table_name();
         $html .= '</table>';
         // $start_date = $timedate->to_display($_REQUEST['start_date'],$date_format,$user_format);
//.........这里部分代码省略.........
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:101,代码来源:view.synthesis_report.php

示例4: trim

require_once "include/TimeDate.php";
require_once 'include/entryPoint.php';
global $db, $current_user;
$first_name = trim($_POST['first_name']);
$last_name = trim($_POST['last_name']);
$birthday = trim($_POST['birthday']);
$phone_mobile = trim($_POST['phone_mobile']);
$identy_card = trim($_POST['identy_card']);
$where = "deleted = 0 AND last_name = '" . $last_name . "'";
if ($first_name) {
    $where .= " AND first_name = '" . $first_name . "'";
}
if ($birthday) {
    // Xu ly chuoi ngay sinh
    $date_time = new TimeDate();
    $user_date_format = $date_time->get_date_format($current_user);
    $birdthday = $date_time->to_display($birthday, $user_date_format, 'Y-m-d');
    $where .= " AND birthday = '" . $birdthday . "'";
}
if ($phone_mobile) {
    $where .= " AND phone_mobile = '" . $phone_mobile . "'";
}
if ($identy_card) {
    $where .= " AND identy_card = '" . $identy_card . "'";
}
$sql = "SELECT id, first_name, last_name, birthday, phone_mobile, identy_card, assigned_user_id FROM fits WHERE {$where}";
$result = $db->query($sql);
//display
$n = $db->getRowCount($result);
$error = '';
if ($n > 0) {
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:31,代码来源:AjaxCheckDuplicateCustomer.php


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