本文整理汇总了PHP中api_format_date函数的典型用法代码示例。如果您正苦于以下问题:PHP api_format_date函数的具体用法?PHP api_format_date怎么用?PHP api_format_date使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_format_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Creates the mPDF object
* @param string $pageFormat format A4 A4-L see http://mpdf1.com/manual/index.php?tid=184&searchstring=format
* @param string $orientation orientation "P" = Portrait "L" = Landscape
* @param array $params
* @param Template $template
*/
public function __construct($pageFormat = 'A4', $orientation = 'P', $params = array(), $template = null)
{
$this->template = $template;
/* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
* mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
*/
if (!in_array($orientation, array('P', 'L'))) {
$orientation = 'P';
}
//$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation);
//left, right, top, bottom, margin_header, margin footer
$params['left'] = isset($params['left']) ? $params['left'] : 15;
$params['right'] = isset($params['right']) ? $params['right'] : 15;
$params['top'] = isset($params['top']) ? $params['top'] : 20;
$params['bottom'] = isset($params['bottom']) ? $params['bottom'] : 15;
$this->params['filename'] = isset($params['filename']) ? $params['filename'] : api_get_local_time();
$this->params['pdf_title'] = isset($params['pdf_title']) ? $params['pdf_title'] : get_lang('Untitled');
$this->params['course_info'] = isset($params['course_info']) ? $params['course_info'] : api_get_course_info();
$this->params['session_info'] = isset($params['session_info']) ? $params['session_info'] : api_get_session_info(api_get_session_id());
$this->params['course_code'] = isset($params['course_code']) ? $params['course_code'] : api_get_course_id();
$this->params['add_signatures'] = isset($params['add_signatures']) ? $params['add_signatures'] : false;
$this->params['show_real_course_teachers'] = isset($params['show_real_course_teachers']) ? $params['show_real_course_teachers'] : false;
$this->params['student_info'] = isset($params['student_info']) ? $params['student_info'] : false;
$this->params['show_grade_generated_date'] = isset($params['show_grade_generated_date']) ? $params['show_grade_generated_date'] : false;
$this->params['show_teacher_as_myself'] = isset($params['show_teacher_as_myself']) ? $params['show_teacher_as_myself'] : true;
$this->params['pdf_date'] = isset($params['pdf_date']) ? $params['pdf_date'] : api_format_date(api_get_local_time(), DATE_TIME_FORMAT_LONG);
$this->pdf = new mPDF('UTF-8', $pageFormat, '', '', $params['left'], $params['right'], $params['top'], $params['bottom'], 8, 8, $orientation);
}
示例2: html_to_pdf_with_template
/**
* Export the given HTML to PDF, using a global template
* @param string the HTML content
* @uses export/table_pdf.tpl
*/
function html_to_pdf_with_template($content)
{
Display::display_no_header();
//Assignments
Display::$global_template->assign('pdf_content', $content);
$organization = api_get_setting('Institution');
$img = api_get_path(SYS_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/header-logo.png';
if (file_exists($img)) {
$img = api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/header-logo.png';
$organization = "<img src='{$img}'>";
} else {
if (!empty($organization)) {
$organization = '<h2 align="left">' . $organization . '</h2>';
}
}
Display::$global_template->assign('organization', $organization);
//Showing only the current teacher/admin instead the all teacherlist name see BT#4080
$user_info = api_get_user_info();
$teacher_list = $user_info['complete_name'];
$session_name = api_get_session_name(api_get_session_id());
if (!empty($session_name)) {
Display::$global_template->assign('pdf_session', $session_name);
}
Display::$global_template->assign('pdf_course', $this->params['course_code']);
Display::$global_template->assign('pdf_date', api_format_date(api_get_utc_datetime(), DATE_TIME_FORMAT_LONG));
Display::$global_template->assign('pdf_teachers', $teacher_list);
Display::$global_template->assign('pdf_title', $this->params['pdf_title']);
Display::$global_template->assign('add_signatures', $this->params['add_signatures']);
//Getting template
$tpl = Display::$global_template->get_template('export/table_pdf.tpl');
$html = Display::$global_template->fetch($tpl);
$html = api_utf8_encode($html);
$css_file = api_get_path(TO_SYS, WEB_CSS_PATH) . '/print.css';
$css = file_exists($css_file) ? @file_get_contents($css_file) : '';
self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code']);
}
示例3: format_date
public static function format_date($timestamp, $format = null)
{
return api_format_date($timestamp, $format);
}
示例4: api_protect_admin_script
/* For license terms, see /license.txt */
/**
* List page for Paypal Payout for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Initialization
*/
$cidReset = true;
require_once '../../../main/inc/global.inc.php';
$htmlHeadXtra[] = '<link rel="stylesheet" href="../resources/css/style.css" type="text/css">';
api_protect_admin_script(true);
$plugin = BuyCoursesPlugin::create();
$paypalEnable = $plugin->get('paypal_enable');
$commissionsEnable = $plugin->get('commissions_enable');
if ($paypalEnable !== "true" && $commissionsEnable !== "true") {
api_not_allowed(true);
}
$payouts = $plugin->getPayouts();
$payoutList = [];
foreach ($payouts as $payout) {
$payoutList[] = ['id' => $payout['id'], 'reference' => $payout['sale_reference'], 'date' => api_format_date($payout['date'], DATE_TIME_FORMAT_LONG_24H), 'currency' => $payout['iso_code'], 'price' => $payout['item_price'], 'commission' => $payout['commission'], 'paypal_account' => $payout['paypal_account']];
}
$templateName = $plugin->get_lang('PaypalPayoutCommissions');
$template = new Template($templateName);
$template->assign('payout_list', $payoutList);
$content = $template->fetch('buycourses/view/paypal_payout.tpl');
$template->assign('header', $templateName);
$template->assign('content', $content);
$template->display_one_col_template();
示例5: array
$columns = array('name', 'date', 'course_per_session', 'student_per_session', 'details');
$result = array();
if (!empty($sessions)) {
foreach ($sessions as $session) {
if (api_drh_can_access_all_session_content()) {
$count_courses_in_session = count(SessionManager::get_course_list_by_session_id($session['id']));
} else {
$count_courses_in_session = count(Tracking::get_courses_followed_by_coach($user_id, $session['id']));
}
$count_users_in_session = count(SessionManager::get_users_by_session($session['id'], 0));
$session_date = array();
if (!empty($session['access_start_date']) && $session['access_start_date'] != '0000-00-00') {
$session_date[] = get_lang('From') . ' ' . api_format_date($session['access_start_date'], DATE_FORMAT_SHORT);
}
if (!empty($session['access_end_date']) && $session['access_end_date'] != '0000-00-00') {
$session_date[] = get_lang('Until') . ' ' . api_format_date($session['access_end_date'], DATE_FORMAT_SHORT);
}
if (empty($session_date)) {
$session_date_string = '-';
} else {
$session_date_string = implode(' ', $session_date);
}
$sessionUrl = api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id'];
$result[] = array('name' => $session['name'], 'date' => $session_date_string, 'course_per_session' => $count_courses_in_session, 'student_per_session' => $count_users_in_session, 'details' => Display::url(Display::return_icon('2rightarrow.png'), $sessionUrl));
}
}
break;
case 'get_sessions':
$session_columns = SessionManager::getGridColumns($list_type);
$columns = $session_columns['simple_column_name'];
if ($list_type == 'simple') {
示例6: get_attendance_calendar
/**
* Get all attendance calendar data inside current attendance
* @param int $attendance_id
* @param string $type
* @param int $calendar_id
* @param int $groupId
* @param bool $showAll = false show group calendar items or not
*
* @return array attendance calendar data
*/
public function get_attendance_calendar($attendance_id, $type = 'all', $calendar_id = null, $groupId = null, $showAll = false)
{
$tbl_attendance_calendar = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR);
$tbl_acrg = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
$attendance_id = intval($attendance_id);
$course_id = api_get_course_int_id();
$groupCondition = null;
if ($showAll) {
$sql = "SELECT * FROM {$tbl_attendance_calendar}\n\t\t\t\t\tWHERE c_id = {$course_id} AND attendance_id = '{$attendance_id}'";
} else {
$sql = "SELECT * FROM {$tbl_attendance_calendar}\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tc_id = {$course_id} AND\n\t\t\t\t\t\tattendance_id = '{$attendance_id}' AND\n\t\t\t\t\t\tid NOT IN (\n\t\t\t\t\t\t\tSELECT calendar_id FROM {$tbl_acrg}\n\t\t\t\t\t\t\tWHERE c_id = {$course_id} AND group_id != 0 AND group_id IS NOT NULL\n\t\t\t\t\t\t)\n\t\t\t\t\t";
}
if (!empty($groupId)) {
$groupId = intval($groupId);
$sql = "SELECT c.* FROM {$tbl_attendance_calendar} c\n\t\t\t\t\tINNER JOIN {$tbl_acrg} g\n\t\t\t\t\tON c.c_id = g.c_id AND c.id = g.calendar_id\n\t\t\t\t\tWHERE\n\t\t\t\t\t c.c_id = {$course_id} AND\n\t\t\t\t\t g.group_id = '{$groupId}' AND\n\t\t\t\t\t c.attendance_id = '{$attendance_id}'\n ";
}
if (!in_array($type, array('today', 'all', 'all_done', 'all_not_done', 'calendar_id'))) {
$type = 'all';
}
switch ($type) {
case 'calendar_id':
$calendar_id = intval($calendar_id);
if (!empty($calendar_id)) {
$sql .= " AND id = {$calendar_id}";
}
break;
case 'today':
//$sql .= ' AND DATE_FORMAT(date_time,"%d-%m-%Y") = DATE_FORMAT("'.api_get_utc_datetime().'", "%d-%m-%Y" )';
break;
case 'all_done':
$sql .= " AND done_attendance = 1 ";
break;
case 'all_not_done':
$sql .= " AND done_attendance = 0 ";
break;
case 'all':
default:
break;
}
$sql .= " ORDER BY date_time ";
$rs = Database::query($sql);
$data = array();
if (Database::num_rows($rs) > 0) {
while ($row = Database::fetch_array($rs, 'ASSOC')) {
$row['db_date_time'] = $row['date_time'];
$row['date_time'] = api_get_local_time($row['date_time']);
$row['date'] = api_format_date($row['date_time'], DATE_FORMAT_SHORT);
$row['time'] = api_format_date($row['date_time'], TIME_NO_SEC_FORMAT);
$row['groups'] = $this->getGroupListByAttendanceCalendar($row['id'], $course_id);
if ($type == 'today') {
if (date('d-m-Y', api_strtotime($row['date_time'], 'UTC')) == date('d-m-Y', time())) {
$data[] = $row;
}
} else {
$data[] = $row;
}
}
}
return $data;
}
示例7: get_data
function get_data($from, $count, $column, $direction)
{
if (!$this->is_valid()) {
return array();
}
$ceiling = $this->get_ceiling();
$active_only = $this->get_active_only();
$items = ZombieManager::listZombies($ceiling, $active_only, $count, $from, $column, $direction);
$result = array();
foreach ($items as $item) {
$row = array();
$row[] = $item['user_id'];
$row[] = $item['code'];
$row[] = $item['firstname'];
$row[] = $item['lastname'];
$row[] = $item['username'];
$row[] = $item['email'];
$row[] = $item['status'];
$row[] = $item['auth_source'];
$row[] = api_format_date($item['registration_date'], DATE_FORMAT_SHORT);
$row[] = api_format_date($item['login_date'], DATE_FORMAT_SHORT);
$row[] = $item['active'];
$result[] = $row;
}
return $result;
}
示例8: delete_inactive_student
/**
*
* @param int student id
* @param int years
* @param bool show warning_message
* @param bool return_timestamp
*/
public static function delete_inactive_student($student_id, $years = 2, $warning_message = false, $return_timestamp = false)
{
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = 'SELECT login_date FROM ' . $tbl_track_login . '
WHERE login_user_id = ' . intval($student_id) . '
ORDER BY login_date DESC LIMIT 0,1';
if (empty($years)) {
$years = 1;
}
$inactive_time = $years * 31536000;
//1 year
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
if ($last_login_date = Database::result($rs, 0, 0)) {
$last_login_date = api_get_local_time($last_login_date, null, date_default_timezone_get());
if ($return_timestamp) {
return api_strtotime($last_login_date);
} else {
if (!$warning_message) {
return api_format_date($last_login_date, DATE_FORMAT_SHORT);
} else {
$timestamp = api_strtotime($last_login_date);
$currentTimestamp = time();
//If the last connection is > than 7 days, the text is red
//345600 = 7 days in seconds 63072000= 2 ans
// if ($currentTimestamp - $timestamp > 184590 )
if ($currentTimestamp - $timestamp > $inactive_time && UserManager::delete_user($student_id)) {
Display::display_normal_message(get_lang('UserDeleted'));
echo '<p>', 'id', $student_id, ':', $last_login_date, '</p>';
}
}
}
}
}
return false;
}
示例9: api_get_cidreq
if ($view_dropbox_category_sent == $dropbox_file->category) {
$dropbox_file_data[] = $dropbox_file->id;
$link_open = '<a href="dropbox_download.php?' . api_get_cidreq() . '&id=' . $dropbox_file->id . '">';
$dropbox_file_data[] = $link_open . build_document_icon_tag('file', $dropbox_file->title) . '</a>';
$dropbox_file_data[] = '<a href="dropbox_download.php?' . api_get_cidreq() . '&id=' . $dropbox_file->id . '&action=download">' . Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL) . '</a>' . $link_open . $dropbox_file->title . '</a><br />' . $dropbox_file->description;
$file_size = $dropbox_file->filesize;
$dropbox_file_data[] = Text::format_file_size($file_size);
$receivers_celldata = null;
foreach ($dropbox_file->recipients as $recipient) {
$receivers_celldata = display_user_link_work($recipient['user_id'], $recipient['name']) . ', ' . $receivers_celldata;
}
$receivers_celldata = trim(trim($receivers_celldata), ',');
// Removing the trailing comma.
$dropbox_file_data[] = $receivers_celldata;
$last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
$dropbox_file_data[] = date_to_str_ago($last_upload_date) . '<br /><span class="dropbox_date">' . api_format_date($last_upload_date) . '</span>';
//$dropbox_file_data[] = $dropbox_file->author;
$receivers_celldata = '';
$action_icons = check_number_feedback($dropbox_file->id, $number_feedback) . ' ' . get_lang('Feedback') . '
<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $viewSentCategory . '&view=' . $view . '&action=viewfeedback&id=' . $dropbox_file->id . '&' . $sort_params . '">' . Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL) . '</a>
<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $viewSentCategory . '&view=' . $view . '&action=movesent&move_id=' . $dropbox_file->id . '&' . $sort_params . '">' . Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL) . '</a>
<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&view_sent_category=' . $viewSentCategory . '&view=' . $view . '&action=deletesentfile&id=' . $dropbox_file->id . '&' . $sort_params . '" onclick="javascript: return confirmation(\'' . $dropbox_file->title . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
// This is a hack to have an additional row in a sortable table
if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
$action_icons .= "</td></tr>\n";
// ending the normal row of the sortable table
$action_icons .= "<tr><td colspan=\"2\">";
$action_icons .= "<a href=\"index.php?" . api_get_cidreq() . "&view_received_category=" . $viewReceivedCategory . "&view_sent_category=" . $viewSentCategory . "&view=" . $view . '&' . $sort_params . "\">" . get_lang('CloseFeedback') . "</a>";
$action_icons .= "</td><td colspan=\"7\">" . feedback($dropbox_file->feedback2) . "</td></tr>";
}
$dropbox_file_data[] = $action_icons;
示例10: get_thematic_advance_data
/**
* Get the thematic advances to display on the current page (fill the sortable-table)
* @param int offset of first user to recover
* @param int Number of users to get
* @param int Column to sort on
* @param string Order (ASC,DESC)
* @see SortableTable#get_table_data($from)
*/
public static function get_thematic_advance_data($from, $number_of_items, $column, $direction)
{
$thematic_id = Session::read('thematic_id');
$tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE);
$column = intval($column);
$from = intval($from);
$number_of_items = intval($number_of_items);
if (!in_array($direction, array('ASC', 'DESC'))) {
$direction = 'ASC';
}
$data = array();
$course_id = api_get_course_int_id();
if (api_is_allowed_to_edit(null, true)) {
$sql = "SELECT id AS col0, start_date AS col1, duration AS col2, content AS col3\n FROM {$tbl_thematic_advance}\n \t\t\t\tWHERE c_id = {$course_id} AND thematic_id = {$thematic_id}\n \t\t\t\tORDER BY col{$column} {$direction}\n \t\t\t\tLIMIT {$from},{$number_of_items} ";
$list = api_get_item_property_by_tool('thematic_advance', api_get_course_id(), api_get_session_id());
$elements = array();
foreach ($list as $value) {
$elements[] = $value['ref'];
}
$res = Database::query($sql);
$i = 1;
while ($thematic_advance = Database::fetch_row($res)) {
if (in_array($thematic_advance[0], $elements)) {
$thematic_advance[1] = api_get_local_time($thematic_advance[1]);
$thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
$actions = '';
$actions .= '<a href="index.php?' . api_get_cidreq() . '&action=thematic_advance_edit&thematic_id=' . $thematic_id . '&thematic_advance_id=' . $thematic_advance[0] . '">' . Display::return_icon('edit.png', get_lang('Edit'), '', 22) . '</a>';
$actions .= '<a onclick="javascript:if(!confirm(\'' . get_lang('AreYouSureToDelete') . '\')) return false;" href="index.php?' . api_get_cidreq() . '&action=thematic_advance_delete&thematic_id=' . $thematic_id . '&thematic_advance_id=' . $thematic_advance[0] . '">' . Display::return_icon('delete.png', get_lang('Delete'), '', 22) . '</a></center>';
$data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
$i++;
}
}
}
return $data;
}
示例11: get_attendance_calendar
/**
* Get all attendance calendar data inside current attendance
* @param int attendance id
* @return array attendance calendar data
*/
public function get_attendance_calendar($attendance_id, $type = 'all', $calendar_id = null)
{
global $dateFormatShort, $timeNoSecFormat;
$tbl_attendance_calendar = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR);
$attendance_id = intval($attendance_id);
$course_id = $this->get_course_int_id();
$sql = "SELECT * FROM {$tbl_attendance_calendar} WHERE c_id = {$course_id} AND attendance_id = '{$attendance_id}' ";
if (!in_array($type, array('today', 'all', 'all_done', 'all_not_done', 'calendar_id'))) {
$type = 'all';
}
switch ($type) {
case 'calendar_id':
$calendar_id = intval($calendar_id);
if (!empty($calendar_id)) {
$sql .= " AND id = {$calendar_id}";
}
break;
case 'today':
//$sql .= ' AND DATE_FORMAT(date_time,"%d-%m-%Y") = DATE_FORMAT("'.api_get_utc_datetime().'", "%d-%m-%Y" )';
break;
case 'all_done':
$sql .= " AND done_attendance = 1 ";
break;
case 'all_not_done':
$sql .= " AND done_attendance = 0 ";
break;
case 'all':
default:
break;
}
$sql .= " ORDER BY date_time ";
$rs = Database::query($sql);
$data = array();
if (Database::num_rows($rs) > 0) {
while ($row = Database::fetch_array($rs, 'ASSOC')) {
$row['db_date_time'] = $row['date_time'];
$row['date_time'] = api_get_local_time($row['date_time']);
$row['date'] = api_format_date($row['date_time'], DATE_FORMAT_SHORT);
$row['time'] = api_format_date($row['date_time'], TIME_NO_SEC_FORMAT);
if ($type == 'today') {
if (date('d-m-Y', api_strtotime($row['date_time'], 'UTC')) == date('d-m-Y', time())) {
$data[] = $row;
}
} else {
$data[] = $row;
}
}
}
return $data;
}
示例12: getUserCertificatesInSessions
/**
* Get the achieved certificates for a user in course sessions
* @param int $userId The user id
* @param type $includeNonPublicCertificates Whether include the non-plublic certificates
* @return array
*/
public static function getUserCertificatesInSessions($userId, $includeNonPublicCertificates = true)
{
$userId = intval($userId);
$sessionList = [];
$sessions = SessionManager::get_sessions_by_user($userId);
foreach ($sessions as $session) {
if (empty($session['courses'])) {
continue;
}
$sessionCourses = SessionManager::get_course_list_by_session_id($session['session_id']);
foreach ($sessionCourses as $course) {
if (!$includeNonPublicCertificates) {
$allowPublicCertificates = api_get_course_setting('allow_public_certificates', $course['code']);
if (empty($allowPublicCertificates)) {
continue;
}
}
$courseGradebookCategory = Category::load(null, null, $course['code'], null, null, $session['session_id']);
if (empty($courseGradebookCategory)) {
continue;
}
$courseGradebookId = $courseGradebookCategory[0]->get_id();
$certificateInfo = GradebookUtils::get_certificate_by_user_id($courseGradebookId, $userId);
if (empty($certificateInfo)) {
continue;
}
$sessionList[] = ['session' => $session['session_name'], 'course' => $course['title'], 'score' => $certificateInfo['score_certificate'], 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT), 'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}"];
}
}
return $sessionList;
}
示例13: export_tickets_by_user_id
//.........这里部分代码省略.........
OR user.lastname LIKE '%$keyword_request_user%'
OR concat(user.firstname,' ',user.lastname) LIKE '%$keyword_request_user%'
OR concat(user.lastname,' ',user.firstname) LIKE '%$keyword_request_user%'
OR user.username LIKE '%$keyword_request_user%') ";
}
if ($keyword_admin != '') {
$sql .= " AND ticket.assigned_last_user = '$keyword_admin' ";
}
if ($keyword_status != '') {
$sql .= " AND ticket.status_id = '$keyword_status' ";
}
if ($keyword_range == '' && $keyword_start_date_start != '') {
$sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') = '$keyword_start_date_start' ";
}
if ($keyword_range == '1' && $keyword_start_date_start != '' && $keyword_start_date_end != '') {
$sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') >= '$keyword_start_date_start'
AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') <= '$keyword_start_date_end'";
}
if ($keyword_priority != '') {
$sql .= " AND ticket.priority_id = '$keyword_priority' ";
}
if ($keyword_source != '') {
$sql .= " AND ticket.source = '$keyword_source' ";
}
if ($keyword_priority != '') {
$sql .= " AND ticket.priority_id = '$keyword_priority' ";
}
if ($keyword_course != '') {
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN ( ";
$sql .= "SELECT id
FROM $course_table
WHERE (title LIKE '%$keyword_course%'
OR code LIKE '%$keyword_course%'
OR visual_code LIKE '%$keyword_course%' )) ";
}
if ($keyword_unread == 'yes') {
$sql .= " AND ticket.ticket_id IN (
SELECT ticket.ticket_id
FROM $table_support_tickets ticket,
$table_support_messages message,
$table_main_user user
WHERE ticket.ticket_id = message.ticket_id
AND message.status = 'NOL'
AND message.sys_insert_user_id = user.user_id
AND user.status != 1 AND ticket.status_id != 'REE'
GROUP BY ticket.ticket_id)";
} else {
if ($keyword_unread == 'no') {
$sql .= " AND ticket.ticket_id NOT IN (
SELECT ticket.ticket_id
FROM $table_support_tickets ticket,
$table_support_messages message,
$table_main_user user
WHERE ticket.ticket_id = message.ticket_id
AND message.status = 'NOL'
AND message.sys_insert_user_id = user.user_id
AND user.status != 1
AND ticket.status_id != 'REE'
GROUP BY ticket.ticket_id)";
}
}
}
//$sql .= " ORDER BY col$column $direction";
$sql .= " LIMIT $from,$number_of_items";
$result = Database::query($sql);
$tickets[0] = array(
utf8_decode('Ticket#'),
utf8_decode('Fecha'),
utf8_decode('Fecha Edicion'),
utf8_decode('Categoria'),
utf8_decode('Usuario'),
utf8_decode('Estado'),
utf8_decode('Mensajes'),
utf8_decode('Responsable'),
utf8_decode('Programa')
);
while ($row = Database::fetch_assoc($result)) {
if ($row['responsable'] != 0) {
$row['responsable'] = api_get_user_info($row['responsable']);
$row['responsable'] = $row['responsable']['firstname'] . ' ' . $row['responsable']['lastname'];
}
$row['sys_insert_datetime'] = api_format_date(
$row['sys_insert_datetime'], '%d/%m/%y - %I:%M:%S %p'
);
$row['sys_lastedit_datetime'] = api_format_date(
$row['sys_lastedit_datetime'], '%d/%m/%y - %I:%M:%S %p'
);
$row['category'] = utf8_decode($row['category']);
$row['programa'] = utf8_decode($row['fullname']);
$row['fullname'] = utf8_decode($row['fullname']);
$row['responsable'] = utf8_decode($row['responsable']);
$tickets[] = $row;
}
return $tickets;
}
示例14: foreach
exit;
}
$userInfo = ['id' => $user->getId(), 'complete_name' => $user->getCompleteName()];
$skillInfo = ['id' => $skill->getId(), 'name' => $skill->getName(), 'short_code' => $skill->getShortCode(), 'description' => $skill->getDescription(), 'criteria' => $skill->getCriteria(), 'badge_image' => $skill->getWebIconPath(), 'courses' => []];
$badgeAssertions = [];
foreach ($userSkills as $userSkill) {
$sessionId = 0;
$course = $entityManager->find('ChamiloCoreBundle:Course', $userSkill->getCourseId());
$courseName = $course ? $course->getTitle() : '';
if ($userSkill->getSessionId()) {
$session = $entityManager->find('ChamiloCoreBundle:Session', $userSkill->getSessionId());
$sessionId = $session->getId();
$courseName = "[{$session->getName()}] {$course->getTitle()}";
}
$userSkillDate = api_get_local_time($userSkill->getAcquiredSkillAt());
$skillInfo['courses'][] = ['name' => $courseName, 'date_issued' => api_format_date($userSkillDate, DATE_TIME_FORMAT_LONG)];
$assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?";
$assertionUrl .= http_build_query(array('user' => $user->getId(), 'skill' => $skill->getId(), 'course' => $userSkill->getCourseId(), 'session' => $userSkill->getSessionId()));
$badgeAssertions[] = $assertionUrl;
}
$allowExport = api_get_user_id() == $user->getId();
if ($allowExport) {
$backpack = 'https://backpack.openbadges.org/';
$configBackpack = api_get_setting('gradebook.openbadges_backpack');
if (strcmp($backpack, $configBackpack) !== 0) {
$backpack = $configBackpack;
}
$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';
}
$objSkill = new Skill();
$skills = $objSkill->get($skillId);
示例15: foreach
?>
</tbody>
</table>
</div>
<?php
echo '<div class="divTableWithFloatingHeader attendance-calendar-table" style="margin:0px;padding:0px;float:left;width:55%;overflow:auto;overflow-y:hidden;">';
echo '<table class="tableWithFloatingHeader data_table" width="100%">';
echo '<thead>';
$result = null;
if (count($attendant_calendar) > 0) {
foreach ($attendant_calendar as $calendar) {
$date = $calendar['date'];
$time = $calendar['time'];
$datetime = $date . '<br />' . $time;
$datetime = api_format_date($calendar['date_time'], DATE_FORMAT_NUMBER_NO_YEAR);
$img_lock = Display::return_icon('lock.gif', get_lang('DateUnLock'), array('class' => 'img_lock', 'id' => 'datetime_column_' . $calendar['id']));
if (!empty($calendar['done_attendance'])) {
$datetime = '<font color="blue">' . $datetime . '</font>';
}
$disabled_check = 'disabled = "true"';
if ($next_attendance_calendar_id == $calendar['id']) {
$input_hidden = '<input type="hidden" id="hidden_input_' . $calendar['id'] . '" name="hidden_input[]" value="' . $calendar['id'] . '" />';
$disabled_check = '';
$img_lock = Display::return_icon('unlock.gif', get_lang('DateLock'), array('class' => 'img_unlock', 'id' => 'datetime_column_' . $calendar['id']));
} else {
$input_hidden = '<input type="hidden" id="hidden_input_' . $calendar['id'] . '" name="hidden_input[]" value="" />';
}
$result .= '<th width="800px" style="text-align:center">';
$result .= '<center><div style="width:40px;">' . $datetime . '<br />';
if (api_is_allowed_to_edit(null, true)) {