本文整理汇总了PHP中uid_to_name函数的典型用法代码示例。如果您正苦于以下问题:PHP uid_to_name函数的具体用法?PHP uid_to_name怎么用?PHP uid_to_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uid_to_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printPolls
function printPolls()
{
global $tool_content, $course_id, $course_code, $langCreatePoll, $langPollsActive, $langTitle, $langPollCreator, $langPollCreation, $langCancel, $langPollStart, $langPollEnd, $langPollNone, $is_editor, $langAnswers, $themeimg, $langEdit, $langDelete, $langActions, $langSurveyNotStarted, $langDeactivate, $langPollsInactive, $langPollHasEnded, $langActivate, $langParticipate, $langVisible, $user_id, $langHasParticipated, $langSee, $langHasNotParticipated, $uid, $langConfirmDelete, $langPurgeExercises, $langPurgeExercises, $langConfirmPurgeExercises, $langCreateDuplicate, $head_content, $langCreateDuplicateIn, $langCurrentCourse;
$head_content .= "\n <script>\n \$(document).on('click', '.warnLink', function() {\n var pid = \$(this).data('pid');\n \$('#clone_form').attr('action', '{$_SERVER['SCRIPT_NAME']}?pid=' + pid);\n }); \n </script>\n ";
$poll_check = 0;
$result = Database::get()->queryArray("SELECT * FROM poll WHERE course_id = ?d", $course_id);
$num_rows = count($result);
if ($num_rows > 0) {
++$poll_check;
}
if (!$poll_check) {
$tool_content .= "\n <div class='alert alert-warning'>" . $langPollNone . "</div><br>";
} else {
// Print active polls
$tool_content .= "\n <div class='table-repsonsive'>\n\t\t <table class='table-default'>\n\t\t <tr>\n\t\t\t<th><div align='left'> {$langTitle}</div></th>\n\t\t\t<th class='text-center'>{$langPollStart}</th>\n\t\t\t<th class='text-center'>{$langPollEnd}</th>";
if ($is_editor) {
$tool_content .= "<th class='text-center' width='16'>{$langAnswers}</th>" . "<th class='text-center'>" . icon('fa-cogs') . "</th>";
} else {
$tool_content .= "<th class='text-center'>{$langParticipate}</th>";
}
$tool_content .= "</tr>";
$index_aa = 1;
$k = 0;
foreach ($result as $thepoll) {
$total_participants = Database::get()->querySingle("SELECT COUNT(DISTINCT user_id) AS total FROM poll_answer_record WHERE pid = ?d", $thepoll->pid)->total;
$visibility = $thepoll->active;
if ($visibility or $is_editor) {
if ($visibility) {
$visibility_css = "";
$visibility_gif = "fa-eye";
$visibility_func = "deactivate";
$arrow_png = "arrow";
$k++;
} else {
$visibility_css = " class=\"not_visible\"";
$visibility_gif = "fa-eye-slash";
$visibility_func = "activate";
$arrow_png = "arrow";
$k++;
}
$tool_content .= "<tr {$visibility_css}>";
$temp_CurrentDate = date("Y-m-d H:i");
$temp_StartDate = $thepoll->start_date;
$temp_EndDate = $thepoll->end_date;
$temp_StartDate = mktime(substr($temp_StartDate, 11, 2), substr($temp_StartDate, 14, 2), 0, substr($temp_StartDate, 5, 2), substr($temp_StartDate, 8, 2), substr($temp_StartDate, 0, 4));
$temp_EndDate = mktime(substr($temp_EndDate, 11, 2), substr($temp_EndDate, 14, 2), 0, substr($temp_EndDate, 5, 2), substr($temp_EndDate, 8, 2), substr($temp_EndDate, 0, 4));
$temp_CurrentDate = mktime(substr($temp_CurrentDate, 11, 2), substr($temp_CurrentDate, 14, 2), 0, substr($temp_CurrentDate, 5, 2), substr($temp_CurrentDate, 8, 2), substr($temp_CurrentDate, 0, 4));
$creator_id = $thepoll->creator_id;
$theCreator = uid_to_name($creator_id);
$pid = $thepoll->pid;
$countAnswers = Database::get()->querySingle("SELECT COUNT(DISTINCT(user_id)) as counter FROM poll_answer_record WHERE pid = ?d", $pid)->counter;
// check if user has participated
$has_participated = Database::get()->querySingle("SELECT COUNT(*) as counter FROM poll_answer_record\n WHERE user_id = ?d AND pid = ?d", $uid, $pid)->counter;
// check if poll has ended OR not strarted yet
$poll_ended = 0;
$poll_not_started = 0;
if ($temp_CurrentDate < $temp_StartDate) {
$poll_not_started = 1;
} else {
if ($temp_CurrentDate >= $temp_EndDate) {
$poll_ended = 1;
}
}
if ($is_editor) {
$tool_content .= "\n <td><a href='pollparticipate.php?course={$course_code}&UseCase=1&pid={$pid}'>" . q($thepoll->name) . "</a>";
} else {
$tool_content .= "\n <td>";
if ($has_participated == 0 and $poll_ended == 0) {
$tool_content .= "<a href='pollparticipate.php?course={$course_code}&UseCase=1&pid={$pid}'>" . q($thepoll->name) . "</a>";
} else {
$tool_content .= q($thepoll->name);
}
}
$tool_content .= " \n <td class='text-center'>" . nice_format(date("Y-m-d H:i", strtotime($thepoll->start_date)), true) . "</td>\n <td class='text-center'>" . nice_format(date("Y-m-d H:i", strtotime($thepoll->end_date)), true) . "</td>";
if ($is_editor) {
$tool_content .= "\n <td class='text-center'>{$countAnswers}</td>\n <td class='text-center option-btn-cell'>" . action_button(array(array('title' => $langSee, 'icon' => 'fa-search', 'url' => "pollparticipate.php?course={$course_code}&UseCase=1&pid={$pid}"), array('title' => $langEdit, 'icon' => 'fa-edit', 'url' => "admin.php?course={$course_code}&pid={$pid}"), array('title' => $langPurgeExercises, 'icon' => 'fa-eraser', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&delete_results=yes&pid={$pid}", 'confirm' => $langConfirmPurgeExercises, 'show' => $total_participants > 0), array('title' => $langDelete, 'icon' => 'fa-times', 'class' => 'delete', 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&delete=yes&pid={$pid}", 'confirm' => $langConfirmDelete), array('title' => $langVisible, 'icon' => $visibility_gif, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&visibility={$visibility_func}&pid={$pid}"), array('title' => $langParticipate, 'icon' => 'fa-pie-chart', 'url' => "pollresults.php?course={$course_code}&pid={$pid}", 'show' => $total_participants > 0), array('title' => $langCreateDuplicate, 'icon' => 'fa-copy', 'icon-class' => 'warnLink', 'icon-extra' => "data-toggle='modal' data-target='#modalWarning' data-remote='false' data-pid='{$pid}'", 'url' => "#"))) . "</td></tr>";
} else {
$tool_content .= "\n <td class='text-center'>";
if ($has_participated == 0 && $poll_ended == 0 && $poll_not_started == 0) {
$tool_content .= "{$langHasNotParticipated}";
} else {
if ($poll_ended == 1) {
$tool_content .= $langPollHasEnded;
} elseif ($poll_not_started == 1) {
$tool_content .= $langSurveyNotStarted;
} else {
$tool_content .= $langHasParticipated;
}
}
$tool_content .= "</td></tr>";
}
}
$index_aa++;
}
$tool_content .= "</table></div>";
}
$my_courses = Database::get()->queryArray("SELECT a.course_id Course_id, b.title Title FROM course_user a, course b WHERE a.course_id = b.id AND a.course_id != ?d AND a.user_id = ?d AND a.status = 1", $course_id, $uid);
$tool_content .= "\n <!-- Modal -->\n <div class='modal fade' id='modalWarning' tabindex='-1' role='dialog' aria-labelledby='modalWarningLabel' aria-hidden='true'>\n <div class='modal-dialog'>\n <div class='modal-content'>\n <div class='modal-header'>\n {$langCreateDuplicateIn}\n <button type='button' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button>\n </div>\n <form action='{$_SERVER['SCRIPT_NAME']}' method='POST' id='clone_form'>\n <div class='modal-body'>\n <select class='form-control' id='course_id' name='clone_to_course_id'>\n <option value='{$course_id}' selected>--- {$langCurrentCourse} ---</option>";
foreach ($my_courses as $row) {
$tool_content .= "<option value='{$row->Course_id}'>{$row->Title}</option>";
//.........这里部分代码省略.........
示例2: uid_to_name
* ======================================================================== */
/**
* @file messageList.php
* @brief Functionality of chat module
*/
$require_current_course = TRUE;
$require_login = TRUE;
require_once '../../include/baseTheme.php';
require_once 'include/lib/textLib.inc.php';
$coursePath = $webDir . '/courses/';
$fileChatName = $coursePath . $course_code . '/chat.txt';
$tmpArchiveFile = $coursePath . $course_code . '/tmpChatArchive.txt';
$nick = uid_to_name($uid);
// How many lines to show on screen
define('MESSAGE_LINE_NB', 20);
// How many lines to keep in temporary archive
// (the rest are in the current chat file)
define('MAX_LINE_IN_FILE', 20);
if ($GLOBALS['language'] == 'el') {
$timeNow = date("d-m-Y / H:i", time());
} else {
$timeNow = date("Y-m-d / H:i", time());
}
if (!file_exists($fileChatName)) {
$fp = fopen($fileChatName, 'w') or die('<center>$langChatError</center>');
示例3: ceil
$total_reply_pages = ceil($replies / $posts_per_page);
$pagination .= "<strong class='pagination'><span> ".icon('fa-arrow-circle-right')." ";
add_topic_link(0, $total_reply_pages);
if ($total_reply_pages > PAGINATION_CONTEXT + 1) {
$pagination .= " ... ";
}
for ($p = max(1, $total_reply_pages - PAGINATION_CONTEXT); $p < $total_reply_pages; $p++) {
add_topic_link($p, $total_reply_pages);
}
$pagination .= " </span></strong>";
}
$tool_content .= "<td>$image <a href='$topiclink'><b>" . q($topic_title) . "</b></a>$pagination</td>";
$tool_content .= "<td class='text-center'>$replies</td>";
$tool_content .= "<td class='text-center'>" . q(uid_to_name($myrow->poster_id)) . "</td>";
$tool_content .= "<td class='text-center'>$myrow->num_views</td>";
$tool_content .= "<td class='text-center'>" . q(uid_to_name($myrow->poster_id)) . "<br />$last_post_datetime</td>";
$sql = Database::get()->querySingle("SELECT notify_sent FROM forum_notify
WHERE user_id = ?d AND topic_id = ?d AND course_id = ?d", $uid, $myrow->id, $course_id);
if ($sql) {
$topic_action_notify = $sql->notify_sent;
}
if (!isset($topic_action_notify)) {
$topic_link_notify = FALSE;
$topic_icon = '_off';
} else {
$topic_link_notify = toggle_link($topic_action_notify);
$topic_icon = toggle_icon($topic_action_notify);
}
$tool_content .= "<td class='text-center option-btn-cell'>";
$dyntools = (!$is_editor) ? array() : array(
示例4: profile_image
/**
* Link for displaying user profile
* @param type $uid
* @param type $size
* @param type $class
* @return type
*/
function profile_image($uid, $size, $class = null)
{
global $urlServer, $themeimg;
// makes $class argument optional
$class_attr = $class == null ? '' : "class='" . q($class) . "'";
$name = $uid > 0 ? q(trim(uid_to_name($uid))) : '';
if ($uid > 0 and file_exists("courses/userimg/{$uid}_{$size}.jpg")) {
return "<img src='{$urlServer}courses/userimg/{$uid}_{$size}.jpg' {$class_attr} title='{$name}' alt='{$name}'>";
} else {
return "<img src='{$themeimg}/default_{$size}.jpg' {$class_attr} title='{$name}' alt='{$name}'>";
}
}
示例5: foreach
}
} else { // free text questions
$answers = Database::get()->queryArray("SELECT answer_text, user_id
FROM poll_answer_record
WHERE qid = ?d
ORDER BY user_id", $q->pqid);
foreach ($answers as $a) {
$qlist[$a->user_id][$q->pqid] = $a->answer_text;
}
}
}
echo $crlf;
$k = 0;
foreach ($qlist as $user_id => $answers) {
$k++;
$student_name = $anonymized? "$langStudent $k": uid_to_name($user_id);
if ($anonymized) {
$user_id = $k;
}
echo csv_escape($student_name), ';', $user_id, ';',
implode(';', array_map('csv_escape', $answers)), $crlf;
}
} else {
echo csv_escape($langQuestions), $crlf, $crlf;
$questions = Database::get()->queryArray("SELECT * FROM poll_question WHERE pid=?d ORDER BY q_position",$p->pid);
foreach ($questions as $q) {
if ($q->qtype == QTYPE_LABEL) {
echo csv_escape(strip_tags($q->question_text)), $crlf, $crlf;
} else {
echo csv_escape($q->question_text), $crlf;
if ($q->qtype == QTYPE_SINGLE or $q->qtype == QTYPE_MULTIPLE) {
示例6: printPolls
//.........这里部分代码省略.........
$tool_content .= "<th class='text-center'>$langParticipate</th>";
}
$tool_content .= "<th class='text-center'>".icon('fa-cogs')."</th>";
$tool_content .= "</tr>";
$index_aa = 1;
$k = 0;
foreach ($result as $thepoll) {
$total_participants = Database::get()->querySingle("SELECT COUNT(DISTINCT user_id) AS total FROM poll_answer_record WHERE pid = ?d", $thepoll->pid)->total;
$visibility = $thepoll->active;
if (($visibility) or ($is_editor)) {
if ($visibility) {
$visibility_css = "";
$visibility_gif = "fa-eye";
$visibility_func = "deactivate";
$arrow_png = "arrow";
$k++;
} else {
$visibility_css = " class=\"not_visible\"";
$visibility_gif = "fa-eye-slash";
$visibility_func = "activate";
$arrow_png = "arrow";
$k++;
}
$tool_content .= "<tr $visibility_css>";
$temp_CurrentDate = date("Y-m-d H:i");
$temp_StartDate = $thepoll->start_date;
$temp_EndDate = $thepoll->end_date;
$temp_StartDate = mktime(substr($temp_StartDate, 11, 2), substr($temp_StartDate, 14, 2), 0, substr($temp_StartDate, 5, 2), substr($temp_StartDate, 8, 2), substr($temp_StartDate, 0, 4));
$temp_EndDate = mktime(substr($temp_EndDate, 11, 2), substr($temp_EndDate, 14, 2), 0, substr($temp_EndDate, 5, 2), substr($temp_EndDate, 8, 2), substr($temp_EndDate, 0, 4));
$temp_CurrentDate = mktime(substr($temp_CurrentDate, 11, 2), substr($temp_CurrentDate, 14, 2), 0, substr($temp_CurrentDate, 5, 2), substr($temp_CurrentDate, 8, 2), substr($temp_CurrentDate, 0, 4));
$creator_id = $thepoll->creator_id;
$theCreator = uid_to_name($creator_id);
$pid = $thepoll->pid;
$countAnswers = Database::get()->querySingle("SELECT COUNT(DISTINCT(user_id)) as counter FROM poll_answer_record WHERE pid = ?d", $pid)->counter;
// check if user has participated
$has_participated = Database::get()->querySingle("SELECT COUNT(*) as counter FROM poll_answer_record
WHERE user_id = ?d AND pid = ?d", $uid, $pid)->counter;
// check if poll has ended OR not strarted yet
$poll_ended = 0;
$poll_not_started = 0;
if($temp_CurrentDate < $temp_StartDate) {
$poll_not_started = 1;
} else if ($temp_CurrentDate >= $temp_EndDate) {
$poll_ended = 1;
}
if ($is_editor) {
$tool_content .= "
<td><a href='pollparticipate.php?course=$course_code&UseCase=1&pid=$pid'>".q($thepoll->name)."</a>";
} else {
$tool_content .= "
<td>";
if (($has_participated == 0) and $poll_ended == 0) {
$tool_content .= "<a href='pollparticipate.php?course=$course_code&UseCase=1&pid=$pid'>".q($thepoll->name)."</a>";
} else {
$tool_content .= q($thepoll->name);
}
}
$tool_content .= "
<td class='text-center'>" . nice_format(date("Y-m-d H:i", strtotime($thepoll->start_date)), true) . "</td>
<td class='text-center'>" . nice_format(date("Y-m-d H:i", strtotime($thepoll->end_date)), true) . "</td>";
if ($is_editor) {
$tool_content .= "
<td class='text-center'>$countAnswers</td>
示例7: bbb_session_details
/**
* @brief Print a box with the details of a bbb session
* @global type $course_id
* @global type $tool_content
* @global type $is_editor
* @global type $langNewBBBSessionStart
* @global type $langNewBBBSessionType
* @global type $langConfirmDelete
* @global type $langNewBBBSessionPublic
* @global type $langNewBBBSessionPrivate
* @global type $langBBBSessionJoin
* @global type $langNewBBBSessionDesc
* @global type $course_code
* @global type $langNote
* @global type $langBBBNoteEnableJoin
* @global type $langTitle
* @global type $langActivate
* @global type $langDeactivate
* @global type $langModify
* @global type $langDelete
*/
function bbb_session_details() {
global $course_id, $tool_content, $is_editor, $course_code, $head_content,
$langNewBBBSessionStart, $langNewBBBSessionType, $langParticipants,
$langConfirmDelete, $langNewBBBSessionPublic, $langNewBBBSessionPrivate,
$langBBBSessionJoin, $langNewBBBSessionDesc, $langNote,
$langBBBNoteEnableJoin, $langTitle,$langActivate, $langDeactivate,
$langEditChange, $langDelete, $langNoBBBSesssions, $langDaysLeft, $m,
$langBBBNotServerAvailableStudent, $langBBBNotServerAvailableTeacher,
$langBBBImportRecordings;
load_js('trunk8');
$myGroups = Database::get()->queryArray("SELECT group_id FROM group_members WHERE user_id=?d", $_SESSION['uid']);
$activeClause = $is_editor? '': "AND active = '1'";
$result = Database::get()->queryArray("SELECT * FROM bbb_session
WHERE course_id = ?s $activeClause ORDER BY start_date DESC", $course_id);
if (get_total_bbb_servers() == '0') {
if ($is_editor) {
$tool_content .= "<p class='alert alert-danger'><b>$langNote</b>:<br />$langBBBNotServerAvailableTeacher</p>";
} else {
$tool_content .= "<p class='alert alert-danger'><b>$langNote</b>:<br />$langBBBNotServerAvailableStudent</p>";
}
} elseif ($result) {
if (!$is_editor) {
$tool_content .= "<div class='alert alert-info'><label>$langNote</label>:<br>$langBBBNoteEnableJoin</div>";
}
$headingsSent = false;
$headings = "<div class='row'>
<div class='col-md-12'>
<div class='table-responsive'>
<table class='table-default'>
<tr class='list-header'>
<th style='width:25%'>$langTitle</th>
<th class='text-center'>$langNewBBBSessionDesc</th>
<th class='text-center'>$langNewBBBSessionStart</th>
<th class='text-center'>$langParticipants</th>
<th class='text-center'>".icon('fa-gears')."</th>
</tr>";
define('DAY_MINUTES', 24 * 40);
foreach ($result as $row) {
$participants = '';
// Get participants
$r_group = explode(",",$row->participants);
foreach ($r_group as $participant_uid) {
if ($participants) {
$participants .= ', ';
}
$participant_uid = str_replace("'", '', $participant_uid);
if (preg_match('/^_/', $participant_uid)) {
$participants .= gid_to_name(str_replace("_", '', $participant_uid));
} else {
$participants .= uid_to_name($participant_uid, 'fullname');
}
}
$participants = "<span class='trunk8'>$participants</span>";
$id = $row->id;
$title = $row->title;
$start_date = $row->start_date;
$timeLeft = date_diff_in_minutes($start_date, date('Y-m-d H:i:s'));
$timeLabel = $start_date;
if ($timeLeft > 0) {
$timeLabel .= "<br><span class='label label-warning'><small>$langDaysLeft " .
format_time_duration($timeLeft * 60) .
"</small></span>";
} elseif (-$timeLeft > DAY_MINUTES) {
$timeLabel .= "<br><span class='label label-danger'><small>$m[expired]</small></span>";
}
// $row->public == '1' ? $type = $langNewBBBSessionPublic: $type = $langNewBBBSessionPrivate;
$meeting_id = $row->meeting_id;
$att_pw = $row->att_pw;
$mod_pw = $row->mod_pw;
$record = $row->record;
$desc = isset($row->description)? $row->description: '';
$canJoin = $row->active == '1' &&
$timeLeft < $row->unlock_interval &&
//.........这里部分代码省略.........
示例8: while
while ($line !== false) {
$line = canonicalize_whitespace($line);
if (!empty($line)) {
$info = explode('|', $line);
$title = $info[0];
$prof_uid = null;
$prof_not_found = false;
if (isset($info[1])) {
$prof_info = trim($info[1]);
$prof_uid = find_prof(trim($info[1]));
if ($prof_info and !$prof_uid) {
$prof_not_found = true;
}
}
if ($prof_uid) {
$prof_name = uid_to_name($prof_uid);
} else {
$prof_name = '';
}
list($code, $cid) = create_course('', $_POST['lang'], $title, $departments, $vis, $prof_name, $_POST['password']);
if ($cid) {
if ($prof_uid) {
Database::get()->query("INSERT INTO course_user\n SET course_id = {$cid},\n user_id = {$prof_uid},\n status = 1,\n tutor = 1,\n reg_date = NOW()");
}
Database::get()->query("INSERT INTO group_properties SET\n course_id = {$cid},\n self_registration = 1,\n multiple_registration = 0,\n forum = 1,\n private_forum = 0,\n documents = 1,\n wiki = 0,\n agenda = 0");
create_modules($cid);
}
if ($code) {
course_index($code);
}
$class = $prof_not_found ? 'alert alert-warning' : 'alert alert-success';
示例9: isset
$head_content .= "<script type='text/javascript'>
$(function() {
$('#user_date_start, #user_date_end').datetimepicker({
format: 'dd-mm-yyyy hh:ii',
pickerPosition: 'bottom-left',
language: '".$language."',
autoclose: true
});
});
</script>";
$u = isset($_GET['u']) ? intval($_GET['u']) : '';
$pageName = "$langUserLog: " . uid_to_name($u);
$navigation[] = array('url' => 'index.php', 'name' => $langAdmin);
$navigation[] = array('url' => 'listusers.php', 'name' => $langListUsers);
if (isset($_POST['user_date_start'])) {
$uds = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_start']);
$u_date_start = $uds->format('Y-m-d H:i');
$user_date_start = $uds->format('d-m-Y H:i');
} else {
$date_start = new DateTime();
$date_start->sub(new DateInterval('P15D'));
$u_date_start = $date_start->format('Y-m-d H:i');
$user_date_start = $date_start->format('d-m-Y H:i');
}
if (isset($_POST['user_date_end'])) {
$ude = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_end']);
示例10: header
header("Content-type: text/csv; charset=UTF-16");
header("Pragma: no-cache");
header("Expires: 0");
$bom = "\357\273\277";
$crlf = "\r\n";
$output = "$bom$langSurname\t$langName\t$langAm\t$langStart\t$langExerciseDuration\t$langYourTotalScore2$crlf";
$output .= "$crlf";
$result = Database::get()->queryArray("SELECT DISTINCT uid FROM `exercise_user_record` WHERE eid = ?d", $exerciseId);
foreach ($result as $row) {
$sid = $row->uid;
$surname = uid_to_name($sid,'surname');
$name = uid_to_name($sid,'givenname');
$am = uid_to_am($sid);
$result2 = Database::get()->queryArray("SELECT DATE_FORMAT(record_start_date, '%Y-%m-%d / %H:%i') AS record_start_date,
record_end_date, TIME_TO_SEC(TIMEDIFF(record_end_date, record_start_date)) AS time_duration,
total_score, total_weighting
FROM `exercise_user_record` WHERE uid = ?d AND eid = ?d", $sid, $exerciseId);
foreach ($result2 as $row2) {
$output .= csv_escape($surname) . "\t";
$output .= csv_escape($name) . "\t";
$output .= csv_escape($am) . "\t";
$recordStartDate = $row2->record_start_date;
$output .= csv_escape($recordStartDate) . "\t";
if ($row2->time_duration == '00:00:00' or empty($row2->time_duration)) { // for compatibility
$output .= csv_escape($langNotRecorded) . "\t";
示例11: checkForm
} else {
$out .= "<form method='post' class='form-horizontal' role='form' action='dropbox_submit.php?course=$course_code' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
}
//hidden variables needed in case of a reply
foreach ($msg->recipients as $rec) {
if ($rec != $uid) {
$out .= "<input type='hidden' name='recipients[]' value='$rec' />";
}
}
$out .= "
<fieldset>
<legend>$langReply</legend>
<div class='form-group'>
<label for='senderName' class='col-sm-2 control-label'>$langSender:</label>
<div class='col-sm-10'>
<input name='senderName' type='text' class='form-control' id='senderName' value='" . q(uid_to_name($uid)) . "' disabled>
</div>
</div>
<div class='form-group'>
<label for='message_title' class='col-sm-2 control-label'>$langSubject:</label>
<div class='col-sm-10'>
<input name='message_title' type='text' class='form-control' id='message_title' value='" .
q($langMsgRe . ' ' . $msg->subject) . "'>
</div>
</div>
<div class='form-group'>
<label for='body' class='col-sm-2 control-label'>$langMessage:</label>
<div class='col-sm-10'>
".rich_text_editor('body', 4, 20, '')."
</div>
</div>";
示例12: checkForm
if ($course_id == 0) {
$out .= "<form method='post' action='dropbox_submit.php' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
if ($msg->course_id != 0) {
//thread belonging to a course viewed from the central ui
$out .= "<input type='hidden' name='course' value='" . course_id_to_code($msg->course_id) . "' />";
}
} else {
$out .= "<form method='post' action='dropbox_submit.php?course={$course_code}' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
}
//hidden variables needed in case of a reply
foreach ($msg->recipients as $rec) {
if ($rec != $uid) {
$out .= "<input type='hidden' name='recipients[]' value='{$rec}' />";
}
}
$out .= "<fieldset>\r\n <table width='100%' class='table table-bordered'>\r\n <caption><b>{$langReply}</b></caption>\r\n <tr>\r\n <th>{$langSender}:</th>\r\n <td>" . q(uid_to_name($uid)) . "</td>\r\n \t </tr>\r\n <tr>\r\n <th>{$langSubject}:</th>\r\n <td><input type='text' name='message_title' value='" . $langMsgRe . $msg->subject . "' /></td>\r\n \t </tr>";
$out .= "<tr>\r\n <th>" . $langMessage . ":</th>\r\n <td>" . rich_text_editor('body', 4, 20, '') . "\r\n <small><br/>{$langMaxMessageSize}</small></td>\r\n </tr>";
if ($course_id != 0) {
$out .= "<tr>\r\n <th width='120'>{$langFileName}:</th>\r\n <td><input type='file' name='file' size='35' />\r\n </td>\r\n </tr>";
}
$out .= "<tr>\r\n \t <th> </th>\r\n <td class='left'><input class='btn btn-primary' type='submit' name='submit' value='" . q($langSend) . "' /> \r\n {$langMailToUsers}<input type='checkbox' name='mailing' value='1' checked /></td>\r\n </tr>\r\n </table>\r\n </fieldset>\r\n </form>\r\n <p class='right smaller'>{$langMaxFileSize} " . ini_get('upload_max_filesize') . "</p>";
$out .= "<script type='text/javascript' src='{$urlAppend}js/select2-3.5.1/select2.min.js'></script>\n\r\n <script type='text/javascript'>\r\n \$(document).ready(function () {\r\n \$('#select-recipients').select2(); \r\n \$('#selectAll').click(function(e) {\r\n e.preventDefault();\r\n var stringVal = [];\r\n \$('#select-recipients').find('option').each(function(){\r\n stringVal.push(\$(this).val());\r\n });\r\n \$('#select-recipients').val(stringVal).trigger('change');\r\n });\r\n \$('#removeAll').click(function(e) {\r\n e.preventDefault();\r\n var stringVal = [];\r\n \$('#select-recipients').val(stringVal).trigger('change');\r\n }); \r\n });\r\n\r\n </script>";
}
/******End of Reply Form ********/
$out .= "</div>";
$out .= '<script>
$(function() {
$("#in_msg_body").find("a").addClass("outtabs");
$(".delete").click(function() {
if (confirm("' . $langConfirmDelete . '")) {
示例13: elseif
}
$answers_table .= "</table>";
$chart->normalize();
$tool_content .= $chart->plot();
$tool_content .= $answers_table;
} elseif ($theQuestion->qtype == QTYPE_FILL) {
$answers = Database::get()->queryArray("SELECT answer_text, user_id FROM poll_answer_record\n WHERE qid = ?d", $theQuestion->pqid);
$tool_content .= "<table class='table-default'>\n <tbody>\n <tr>\n <th>{$langUser}</th>\n <th>{$langAnswer}</th>\n </tr>";
if ($thePoll->anonymized == 1) {
$k = 1;
foreach ($answers as $theAnswer) {
$tool_content .= "\n <tr>\n <td>{$langStudent} {$k}</td>\n <td>" . q($theAnswer->answer_text) . "</td>\n </tr>";
$k++;
}
} else {
$k = 1;
foreach ($answers as $theAnswer) {
$tool_content .= "\n <tr " . ($k > 3 ? 'class="hidden_row" style="display:none;"' : '') . ">\n <td>" . q(uid_to_name($theAnswer->user_id)) . "</td>\n <td>" . q($theAnswer->answer_text) . "</td>\n </tr>";
$k++;
}
if ($k > 4) {
$tool_content .= "\n <tr>\n <td colspan='2'><a href='#' class='trigger_names' data-type='fill' id='show'>{$showall}</a></td>\n </tr>";
}
}
$tool_content .= '</tbody></table><br>';
}
$tool_content .= "</div></div>";
}
}
// display page
draw($tool_content, 2, null, $head_content);
示例14: draw
}
if ($course_id == 0 && $type == 'pm') {
if (!$personal_msgs_allowed) {
$tool_content .= "<div class='alert alert-warning'>{$langGeneralError}</div>";
draw($tool_content, 1, null, $head_content);
exit;
}
$tool_content .= "<div class='form-wrapper'><form class='form-horizontal' role='form' id='newmsg' method='post' action='dropbox_submit.php' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
} elseif ($course_id == 0 && $type == 'cm') {
$tool_content .= "<div class='form-wrapper'><form class='form-horizontal' role='form' method='post' action='dropbox_submit.php' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
} else {
$type = 'cm';
//only course messages are allowed in the context of a course
$tool_content .= "<div class='form-wrapper'><form class='form-horizontal' role='form' method='post' action='dropbox_submit.php?course={$course_code}' enctype='multipart/form-data' onsubmit='return checkForm(this)'>";
}
$tool_content .= "\n\t<fieldset>\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langSender}:</label>\n <div class='col-sm-10'>\n <input type='text' class='form-control' value='" . q(uid_to_name($uid)) . "' disabled>\n </div>\n </div>";
if ($type == 'cm' && $course_id == 0) {
//course message from central interface
//find user's courses
$sql = "SELECT course.code code, course.title title\n FROM course, course_user\n WHERE course.id = course_user.course_id\n AND course_user.user_id = ?d\n ORDER BY title";
$res = Database::get()->queryArray($sql, $uid);
$head_content .= "<script type='text/javascript'>\n \$(document).on('change','#courseselect',function(){\n \$.ajax({\n type: 'POST',\n dataType: 'json',\n url: 'load_recipients.php',\n data: {'course' : \$('#courseselect').val() }\n }).done(function(data) {\n \$('#select-recipients').empty();\n if(!(\$.isEmptyObject(data))) {\n \$('#select-recipients').empty();\n \$.each(data, function(key,value){\n if (key.charAt(0) == '_') {\n \$('#select-recipients').prepend('<option value=\\'' + key + '\\'>' + value + '</option>');\n } else {\n \$('#select-recipients').append('<option value=\\'' + key + '\\'>' + value + '</option>');\n }\n });\n }\n \$('#select-recipients').select2('destroy');\n \$('#select-recipients').select2();\n });\n });\n </script>";
$tool_content .= "\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langCourse}:</label>\n <div class='col-sm-10'>\n <select id='courseselect' class='form-control' name='course'>\n <option value='-1'> </option>";
foreach ($res as $course) {
$tool_content .= "<option value='" . $course->code . "'>" . q($course->title) . "</option>";
}
$tool_content .= " </select>\n </div>\n </div>";
}
$tool_content .= "\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langTitle}:</label>\n <div class='col-sm-10'>\n <input type='text' class='form-control' name='message_title'>\n </div>\n </div>\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langMessage}:</label>\n <div class='col-sm-10'>\n " . rich_text_editor('body', 4, 20, '') . "\n <span class='help-block'>{$langMaxMessageSize}</span>\n </div>\n </div>";
if ($course_id != 0 || $type == 'cm' && $course_id == 0) {
$tool_content .= "\n <div class='form-group'>\n <label for='title' class='col-sm-2 control-label'>{$langFileName}:</label>\n <div class='col-sm-10'>\n <input type='file' name='file'>\n </div>\n </div>";
示例15: get_limited_list
$crlf;
// display a list of user and their respective progress
$sql = "SELECT U.`surname`, U.`givenname`, U.`id`
FROM `user` AS U, `course_user` AS CU
WHERE U.`id`= CU.`user_id`
AND CU.`course_id` = $course_id
ORDER BY U.`surname` ASC, U.`givenname` ASC";
$usersList = get_limited_list($sql, 500000);
foreach ($usersList as $user) {
echo "$crlf";
$learningPathList = Database::get()->queryArray("SELECT learnPath_id FROM lp_learnPath WHERE course_id = ?d", $course_id);
$iterator = 1;
$globalprog = 0;
foreach ($learningPathList as $learningPath) {
// % progress
$prog = get_learnPath_progress($learningPath->learnPath_id, $user->id);
if ($prog >= 0) {
$globalprog += $prog;
}
$iterator++;
}
$total = round($globalprog / ($iterator - 1));
echo csv_escape(uid_to_name($user->id)) .
";" . csv_escape(uid_to_am($user->id)) .
";" . csv_escape(user_groups($course_id, $user->id, 'csv')) .
";" . $total . "%";
}
echo $crlf;