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


PHP api_get_week_days_long函数代码示例

本文整理汇总了PHP中api_get_week_days_long函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_week_days_long函数的具体用法?PHP api_get_week_days_long怎么用?PHP api_get_week_days_long使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: api_protect_course_script

$this_section = SECTION_COURSES;
$current_course_tool = TOOL_BLOGS;
/* 	ACCESS RIGHTS */
// notice for unauthorized people.
api_protect_course_script(true);
//session
if (isset($_GET['id_session'])) {
    $_SESSION['id_session'] = intval($_GET['id_session']);
}
$lib_path = api_get_path(LIBRARY_PATH);
require_once $lib_path . 'blog.lib.php';
require_once $lib_path . 'fckeditor/fckeditor.php';
$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
$nameTools = get_lang('Blogs');
$DaysShort = api_get_week_days_short();
$DaysLong = api_get_week_days_long();
$MonthsLong = api_get_months_long();
$current_page = $_GET['action'];
/*
	PROCESSING
*/
$safe_post_title = Security::remove_XSS($_POST['post_title']);
$safe_post_file_comment = Security::remove_XSS($_POST['post_file_comment']);
$safe_post_full_text = Security::remove_XSS(stripslashes(api_html_entity_decode($_POST['post_full_text'])), COURSEMANAGERLOWSECURITY);
$safe_comment_text = Security::remove_XSS(stripslashes(api_html_entity_decode($_POST['comment_text'])), COURSEMANAGERLOWSECURITY);
$safe_comment_title = Security::remove_XSS($_POST['comment_title']);
$safe_task_name = Security::remove_XSS($_POST['task_name']);
$safe_task_description = Security::remove_XSS($_POST['task_description']);
if (!empty($_POST['new_post_submit']) and !empty($_POST['post_title'])) {
    Blog::create_post($safe_post_title, $safe_post_full_text, $safe_post_file_comment, $blog_id);
    $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogAdded'));
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:blog.php

示例2: print_login_stats

 /**
  * Show some stats about the number of logins
  * @param string $type month, hour or day
  */
 static function print_login_stats($type)
 {
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
     $access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
     $current_url_id = api_get_current_access_url_id();
     if (api_is_multiple_url_enabled()) {
         $table_url = ", {$access_url_rel_user_table}";
         $where_url = " WHERE login_user_id=user_id AND access_url_id='" . $current_url_id . "'";
         $where_url_last = ' AND login_date > DATE_SUB(NOW(),INTERVAL 1 %s)';
     } else {
         $table_url = '';
         $where_url = '';
         $where_url_last = ' WHERE login_date > DATE_SUB(NOW(),INTERVAL 1 %s)';
     }
     switch ($type) {
         case 'month':
             $months = api_get_months_long();
             $period = get_lang('PeriodMonth');
             $sql = "SELECT DATE_FORMAT( login_date, '%Y-%m' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . " GROUP BY stat_date ORDER BY login_date ";
             $sql_last_x = "SELECT DATE_FORMAT( login_date, '%Y-%m' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . sprintf($where_url_last, 'YEAR') . " GROUP BY stat_date ORDER BY login_date ";
             break;
         case 'hour':
             $period = get_lang('PeriodHour');
             $sql = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . " GROUP BY stat_date ORDER BY stat_date ";
             $sql_last_x = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . sprintf($where_url_last, 'DAY') . " GROUP BY stat_date ORDER BY stat_date ";
             break;
         case 'day':
             $week_days = api_get_week_days_long();
             $period = get_lang('PeriodDay');
             $sql = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . " GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) ";
             $sql_last_x = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date , count( login_id ) AS number_of_logins FROM " . $table . $table_url . $where_url . sprintf($where_url_last, 'WEEK') . " GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) ";
             break;
     }
     $res_last_x = Database::query($sql_last_x);
     $result_last_x = array();
     while ($obj = Database::fetch_object($res_last_x)) {
         $stat_date = $obj->stat_date;
         switch ($type) {
             case 'month':
                 $stat_date = explode('-', $stat_date);
                 $stat_date[1] = $months[$stat_date[1] - 1];
                 $stat_date = implode(' ', $stat_date);
                 break;
             case 'day':
                 $stat_date = $week_days[$stat_date];
                 break;
         }
         $result_last_x[$stat_date] = $obj->number_of_logins;
     }
     Statistics::print_stats(get_lang('LastLogins') . ' (' . $period . ')', $result_last_x, true);
     flush();
     //flush web request at this point to see something already while the full data set is loading
     echo '<br />';
     $res = Database::query($sql);
     $result = array();
     while ($obj = Database::fetch_object($res)) {
         $stat_date = $obj->stat_date;
         switch ($type) {
             case 'month':
                 $stat_date = explode('-', $stat_date);
                 $stat_date[1] = $months[$stat_date[1] - 1];
                 $stat_date = implode(' ', $stat_date);
                 break;
             case 'day':
                 $stat_date = $week_days[$stat_date];
                 break;
         }
         $result[$stat_date] = $obj->number_of_logins;
     }
     Statistics::print_stats(get_lang('AllLogins') . ' (' . $period . ')', $result, true);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:75,代码来源:statistics.lib.php

示例3: api_not_allowed

            api_not_allowed(true);
        }
        $extra_field_data = UserManager::get_extra_user_data_by_field(api_get_user_id(), 'google_calendar_url');
        if (!empty($extra_field_data) && isset($extra_field_data['google_calendar_url']) && !empty($extra_field_data['google_calendar_url'])) {
            $tpl->addGlobal('use_google_calendar', 1);
            $tpl->addGlobal('google_calendar_url', $extra_field_data['google_calendar_url']);
        }
        $this_section = SECTION_MYAGENDA;
        if (!api_is_anonymous()) {
            $can_add_events = 1;
        }
        break;
}
//Setting translations
$day_short = api_get_week_days_short();
$days = api_get_week_days_long();
$months = api_get_months_long();
$months_short = api_get_months_short();
//Setting calendar translations
$tpl->addGlobal('month_names', json_encode($months));
$tpl->addGlobal('month_names_short', json_encode($months_short));
$tpl->addGlobal('day_names', json_encode($days));
$tpl->addGlobal('day_names_short', json_encode($day_short));
$tpl->addGlobal('button_text', json_encode(array('today' => get_lang('Today'), 'month' => get_lang('Month'), 'week' => get_lang('Week'), 'day' => get_lang('Day'))));
//see http://docs.jquery.com/UI/Datepicker/$.datepicker.formatDate
$tpl->addGlobal('js_format_date', 'D d M yy');
$region_value = api_get_language_isocode();
if ($region_value == 'en') {
    $region_value = 'en-GB';
}
$tpl->addGlobal('region_value', $region_value);
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:agenda_js.php


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