本文整理汇总了PHP中eF_filterData函数的典型用法代码示例。如果您正苦于以下问题:PHP eF_filterData函数的具体用法?PHP eF_filterData怎么用?PHP eF_filterData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eF_filterData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urldecode
}
}
if (isset($_GET['postAjaxRequest']) && $_change_skills_) {
try {
$_GET['specification'] = urldecode($_GET['specification']);
if (isset($_GET['add_skill'])) {
if ($_GET['insert'] == "true") {
$editedEmployee->addSkills($_GET['add_skill'], $_GET['specification'], $_GET['score']);
} else {
if ($_GET['insert'] == "false") {
$editedEmployee->removeSkills($_GET['add_skill']);
} else {
if (isset($_GET['addAll']) || isset($_GET['removeAll'])) {
$skills = array_keys($editedEmployee->getSkills());
$allSkills = EfrontSkill::getAllSkills();
isset($_GET['filter']) ? $allSkills = eF_filterData($allSkills, $_GET['filter']) : null;
foreach ($allSkills as $skill) {
if (isset($_GET['removeAll'])) {
if (in_array($skill['skill_ID'], $skills)) {
$editedEmployee->removeSkills($skill['skill_ID']);
}
} else {
if (!in_array($skill['skill_ID'], $skills)) {
$editedEmployee->addSkills($skill['skill_ID'], "");
}
}
}
} else {
if (isset($_GET['from_skillgap_test'])) {
$skillsToAdd = array();
foreach ($_GET as $getkey => $getvalue) {
示例2: eF_getTableData
} else {
$smarty->assign("T_LAYOUT_CLASS", $currentTheme->options['toolbar_position'] == "left" ? "hideRight" : "hideLeft");
//Whether to show the sidemenu on the left or on the right
$folderMessages = eF_getTableData("f_personal_messages", "*", "users_LOGIN='" . $currentUser->user['login'] . "' and f_folders_ID=" . $currentFolder, "priority desc, viewed,timestamp desc");
if (isset($_GET['ajax']) && $_GET['ajax'] == 'messagesTable') {
isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
$sort = $_GET['sort'];
isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
} else {
$sort = 'priority';
}
$smarty->assign("T_MESSAGES_SIZE", sizeof($folderMessages));
$folderMessages = eF_multiSort($folderMessages, $_GET['sort'], $order);
if (isset($_GET['filter'])) {
$folderMessages = eF_filterData($folderMessages, $_GET['filter']);
}
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$folderMessages = array_slice($folderMessages, $offset, $limit);
}
foreach ($folderMessages as $key => $value) {
$recipients = explode(",", $folderMessages[$key]['recipient']);
foreach ($recipients as $k => $login) {
$recipients[$k] = formatLogin(trim($login));
}
$folderMessages[$key]['recipient'] = implode(", ", $recipients);
}
$smarty->assign("T_MESSAGES", $folderMessages);
//$smarty -> assign("T_MESSAGES_SIZE", sizeof($messages));
$smarty->display($currentUser->user['user_type'] . '.tpl');
示例3: eF_multiSort
}
$scormData = eF_multiSort($scormData, $sort, $order);
if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
//this applies to branch urls
$currentBranch = new EfrontBranch($_SESSION['s_current_branch']);
$branchTreeUsers = array_keys($currentBranch->getBranchTreeUsers());
foreach ($scormData as $key => $value) {
if ($value['type'] != 'global' && !in_array($value['users_LOGIN'], $branchTreeUsers)) {
unset($scormData[$key]);
}
}
$scormData = array_values($scormData);
}
$smarty->assign("T_USERS_SIZE", sizeof($scormData));
if (isset($_GET['filter'])) {
$scormData = eF_filterData($scormData, $_GET['filter']);
}
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$scormData = array_slice($scormData, $offset, $limit);
}
$smarty->assign("T_SCORM_DATA", $scormData);
$smarty->display('professor.tpl');
exit;
}
foreach ($scormData as $value) {
$scormIds[] = $value['id'];
}
if (isset($_GET['delete']) && in_array($_GET['delete'], $scormIds)) {
eF_deleteTableData("scorm_data", "id=" . $_GET['delete']);
$user = EfrontUserFactory::factory($scormData[0]['users_LOGIN']);
示例4: eF_getTableData
if (!$skillgap_tests) {
$recentTests = eF_getTableData("completed_tests ct, tests t, users u, users_to_lessons ul", "t.name, u.name as username, u.surname, ct.id, ct.status, ct.tests_ID, ct.score, ct.time_end, ct.users_LOGIN, ct.pending", "u.login=ul.users_login and ul.archive=0 and ul.lessons_ID=t.lessons_ID and ct.status != 'deleted' and ct.status != 'incomplete' and t.id = ct.tests_ID AND ct.users_login = u.login AND u.archive=0 and ct.tests_id IN ('" . implode("','", $testIds) . "')", "ct.pending DESC");
} else {
$recentTests = eF_getTableData("completed_tests JOIN tests ON tests_id = tests.id JOIN users ON completed_tests.users_LOGIN = users.login JOIN users_to_skillgap_tests ON completed_tests.users_LOGIN = users_to_skillgap_tests.users_LOGIN AND users_to_skillgap_tests.tests_ID = tests.id AND users_to_skillgap_tests.solved = 1", "completed_tests.id, completed_tests.score, users.name as username, users.surname, completed_tests.tests_ID, tests.name, completed_tests.timestamp, completed_tests.users_LOGIN", "completed_tests.status != 'deleted' and completed_tests.tests_id IN ('" . implode("','", $testIds) . "')", "timestamp DESC");
}
}
isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
$sort = $_GET['sort'];
isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
} else {
$sort = 'text';
}
$recentTests = eF_multiSort($recentTests, $sort, $order);
if (isset($_GET['filter'])) {
$recentTests = eF_filterData($recentTests, $_GET['filter']);
}
if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
//this applies to supervisors only
$currentBranch = new EfrontBranch($_SESSION['s_current_branch']);
$branchTreeUsers = array_keys($currentBranch->getBranchTreeUsers());
foreach ($recentTests as $key => $value) {
if (!in_array($value['users_LOGIN'], $branchTreeUsers)) {
unset($recentTests[$key]);
}
}
}
$smarty->assign("T_PENDING_SIZE", sizeof($recentTests));
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$recentTests = array_slice($recentTests, $offset, $limit, true);
示例5: array
// Added this to prevent events that changed time in the future as project expiration
$new_event = array("time" => $myEvents[$key]->event['time'], "message" => $myEvents[$key]->event['message']);
if ($myEvents[$key]->event['editlink']) {
$new_event['editlink'] = $myEvents[$key]->event['editlink'];
}
if ($myEvents[$key]->event['deletelink']) {
$new_event['deletelink'] = $myEvents[$key]->event['deletelink'];
}
// Keep that for the avatar searching after the filtering
$new_event['users_LOGIN'] = $event->event['users_LOGIN'];
$events[] = $new_event;
}
}
}
if (isset($_GET['filter'])) {
$events = eF_filterData($events, $_GET['filter']);
}
if (isset($_GET['ajax'])) {
foreach ($events as $key => $event) {
$events[$key]['avatar'] = $users_avatars[$event['users_LOGIN']];
try {
$file = new EfrontFile($events[$key]['avatar']);
list($events[$key]['avatar_width'], $events[$key]['avatar_height']) = eF_getNormalizedDims($file['path'], 50, 50);
} catch (EfrontFileException $e) {
$events[$key]['avatar'] = G_SYSTEMAVATARSPATH . "unknown_small.png";
$events[$key]['avatar_width'] = 50;
$events[$key]['avatar_height'] = 50;
}
}
}
$count = sizeof($events);
示例6: handlePostAjaxRequestForUsersRemoveAll
private function handlePostAjaxRequestForUsersRemoveAll()
{
$constraints = array('archive' => false, 'active' => true, 'condition' => 'uc.courses_ID is not null');
$users = $this->getCourseUsersIncludingUnassigned($constraints);
$users = EfrontUser::convertUserObjectsToArrays($users);
isset($_GET['filter']) ? $users = eF_filterData($users, $_GET['filter']) : null;
$this->archiveCourseUsers(array_keys($users));
}
示例7: toHTML
//.........这里部分代码省略.........
}
if ($defaultIterator) {
$iterator = $defaultIterator;
} else {
$iterator = new EfrontFileOnlyFilterIterator(new EfrontNodeFilterIterator(new ArrayIterator($currentDir)));
//Plain ArrayIterator so that it iterates only on the current folder's files
if ($options['db_files_only']) {
//Filter out directories without database representation
$iterator = new EfrontDBOnlyFilterIterator($iterator);
}
}
foreach ($iterator as $key => $value) {
//We convert iterator to a complete array of files, so we can apply sorting, filtering etc more easily
$current = (array) $iterator->current();
foreach ($current as $k => $v) {
//Remove child elements, such files, directories etc from the array, so we can successfully apply operations on to them, such as filtering
if ($v instanceof ArrayObject) {
unset($current[$k]);
}
}
$filesArray[] = (array) $current;
//Array representation of file objects, on which we can apply sorting, filtering, etc
}
$filesArray = eF_multiSort($filesArray, 'name', 'asc');
$fileArrays = array_merge($foldersArray, $filesArray);
isset($ajaxOptions['order']) && $ajaxOptions['order'] == 'asc' ? $ajaxOptions['order'] = 'asc' : ($ajaxOptions['order'] = 'desc');
!isset($ajaxOptions['sort']) ? $ajaxOptions['sort'] = 'name' : null;
!isset($ajaxOptions['limit']) ? $ajaxOptions['limit'] = 20 : null;
!isset($ajaxOptions['offset']) ? $ajaxOptions['offset'] = 0 : null;
!isset($ajaxOptions['filter']) ? $ajaxOptions['filter'] = '' : null;
$size = sizeof($fileArrays);
if ($size) {
$fileArrays = eF_multiSort($fileArrays, $ajaxOptions['sort'], $ajaxOptions['order']);
$ajaxOptions['filter'] ? $fileArrays = eF_filterData($fileArrays, $ajaxOptions['filter']) : null;
$fileArrays = array_slice($fileArrays, $ajaxOptions['offset'], $ajaxOptions['limit']);
}
$extraColumnsString = '';
foreach ($extraColumns as $value) {
$extraColumnsString = '<td class = "topTitle centerAlign" name = "' . $value . '">' . $value . '</td>';
}
$filesCode = '
<table class = "sortedTable" style = "width:100%" size = "' . $size . '" id = "' . $tableId . '" useAjax = "1" rowsPerPage = "20" other = "' . urlencode($currentDirectory) . '" url = "' . $url . '&" nomass = "1" currentDir = "' . (isset($currentDir['path']) ? $currentDir['path'] : '') . '">
<tr>' . ($options['show_type'] ? '<td class = "topTitle centerAlign" name = "extension">' . _TYPE . '</td>' : '') . '
' . ($options['show_name'] ? '<td class = "topTitle" name = "name" id = "filename_' . $tableId . '">' . _NAME . '</td>' : '') . '
' . ($options['show_size'] ? '<td class = "topTitle" name = "size">' . _SIZE . '</td>' : '') . '
' . ($options['show_date'] ? '<td class = "topTitle" name = "timestamp">' . _MODIFIED . '</td>' : '') . '
' . $extraColumnsString . '
' . ($_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "topTitle centerAlign" name = "shared">' . _SHARE . '</td>' : '') . '
' . ($options['show_tools'] ? '<td class = "topTitle centerAlign noSort">' . _OPERATIONS . '</td>' : '') . '
' . ($options['delete'] || $_SESSION['s_lessons_ID'] && $options['share'] ? '<td class = "topTitle centerAlign">' . _SELECT . '</td>' : '') . '
</tr>';
if (isset($parentDir)) {
if ($parentDir['path'] == $this->dir['path']) {
$parentDir['path'] = '';
}
$filesCode .= '
<tr class = "defaultRowHeight eventRowColor"><td class = "centerAlign" colspan = "100%">' . _CURRENTLYBROWSINGFOLDER . ': ' . EfrontFile::decode(str_replace($this->dir['path'], '', $currentDir['path'])) . '</td></tr>
<tr class = "defaultRowHeight oddRowColor">
<td class = "centerAlign"><span style = "display:none"></span><img src = "images/16x16/folder_up.png" alt = "' . _UPONELEVEL . '" title = "' . _UPONELEVEL . '"/></td>
<td><a class="editLink" href = "javascript:void(0)" onclick = "eF_js_rebuildTable($(\'filename_' . $tableId . '\').down().getAttribute(\'tableIndex\'), 0, \'\', \'desc\', \'' . urlencode($parentDir['path']) . '\');">.. (' . _UPONELEVEL . ')</a></td>
<td colspan = "5"></td></tr>';
}
$i = 0;
if ($_SESSION['supervises_branches'] != "") {
$currentEmployee = EfrontUserFactory::factory($_SESSION['s_login']);
$employees = eF_getTableData("users LEFT OUTER JOIN module_hcd_employee_has_job_description ON users.login = module_hcd_employee_has_job_description.users_LOGIN LEFT OUTER JOIN module_hcd_employee_works_at_branch ON users.login = module_hcd_employee_works_at_branch.users_LOGIN", "users.*, count(job_description_ID) as jobs_num", " users.user_type <> 'administrator' AND ((module_hcd_employee_works_at_branch.branch_ID IN (" . $_SESSION['supervises_branches'] . " ) AND module_hcd_employee_works_at_branch.assigned='1') OR EXISTS (SELECT module_hcd_employees.users_login FROM module_hcd_employees LEFT OUTER JOIN module_hcd_employee_works_at_branch ON module_hcd_employee_works_at_branch.users_login = module_hcd_employees.users_login WHERE users.login=module_hcd_employees.users_login AND module_hcd_employee_works_at_branch.branch_ID IS NULL)) GROUP BY login", "login");
示例8: getAjaxResults
private function getAjaxResults()
{
$smarty = $this->getSmartyVar();
$vLabData = eF_getTableData("module_vLab_data", "*");
isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
$sort = $_GET['sort'];
isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
} else {
$sort = 'login';
}
$vLabData = eF_multiSort($vLabData, $sort, $order);
$smarty->assign("T_TABLE_SIZE", sizeof($vLabData));
if (isset($_GET['filter'])) {
$vLabData = eF_filterData($vLabData, $_GET['filter']);
}
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$vLabData = array_slice($vLabData, $offset, $limit);
}
$smarty->assign("T_DATA_SOURCE", $vLabData);
}
示例9: handlePostAjaxRequestForUsersRemoveAll
private function handlePostAjaxRequestForUsersRemoveAll()
{
$constraints = array('archive' => false, 'active' => true, 'condition' => 'uc.courses_ID is not null');
$users = $this->getCourseUsersIncludingUnassigned($constraints);
$users = EfrontUser::convertUserObjectsToArrays($users);
isset($_GET['filter']) ? $users = eF_filterData($users, $_GET['filter']) : null;
$this->archiveCourseUsers(array_keys($users));
// Delete notifications related to the users and this course
foreach ($users as $login => $value) {
$notifications_to_delete = eF_getTableData("notifications", "id", "recipient='" . $login . "' AND id_type_entity LIKE '%_%_" . $this->course['id'] . "'");
foreach ($notifications_to_delete as $notification) {
eF_deleteTableData("notifications", "id = '" . $notification['id'] . "'");
}
}
}
示例10: eF_getTableData
}
}
}
}
}
if ($found) {
$employees = eF_getTableData($dif_tables, "users.*", $search_string, "");
// @todo: problem with professors in one and students in another course
foreach ($employees as $userId => $employee) {
if ($employee['user_type'] != 'student') {
unset($employees[$userId]);
}
}
$employees = eF_multiSort($employees, $_GET['sort'], $order);
if (isset($_GET['filter'])) {
$employees = eF_filterData($employees, $_GET['filter']);
}
$smarty->assign("T_EMPLOYEES_SIZE", sizeof($employees));
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$employees = array_slice($employees, $offset, $limit);
}
} else {
$employees = array();
}
$recipients = basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=";
$first = 1;
foreach ($employees as $employee) {
if ($first) {
$recipients .= $employee['login'];
$first = 0;
示例11: eF_filterHcdData
function eF_filterHcdData($dataSource, $filter, $userField = false)
{
$filters = trim(urldecode(explode("||||", $filter)));
if ($filters[0] != "" && $filters[0] != _FILTER . "...") {
$dataSource = eF_filterData($dataSource, $filters[0]);
// the default filter
}
if ($filters[1] != "" && $filters[1] != "all") {
$branchFilterExtraTable = " JOIN module_hcd_employee_works_at_branch ON module_hcd_employee_works_at_branch.users_login = users.login ";
$branchFilterCondition = " AND module_hcd_employee_works_at_branch.branch_ID = '" . $filters[1] . "' AND module_hcd_employee_works_at_branch.assigned = 1";
$enterprise_filters = true;
}
if ($filters[2] != "" && $filters[2] != _ALLJOBS) {
$jobFilterExtraTable = " LEFT OUTER JOIN module_hcd_employee_has_job_description ON module_hcd_employee_has_job_description.users_login = users.login JOIN module_hcd_job_description ON module_hcd_job_description.job_description_ID = module_hcd_employee_has_job_description.job_description_ID ";
$jobFilterCondition = " AND module_hcd_job_description.description = '" . $filters[2] . "'";
$enterprise_filters = true;
}
if ($enterprise_filters) {
if (!$userField) {
$userField = 'login';
}
$all_users_logins = array();
foreach ($dataSource as $key => $data) {
$all_users_logins[] = $data[$userField];
// get only users that are actually in the table - limit returned results
}
$filtered_users = eF_getTableDataFlat("users {$branchFilterExtraTable} {$jobFilterExtraTable}", "users.login", "users.login IN ('" . implode("','", $all_users_logins) . "') {$branchFilterCondition} {$jobFilterCondition}");
foreach ($dataSource as $key => $data) {
if (!in_array($data[$userField], $filtered_users['login'])) {
unset($dataSource[$key]);
}
}
}
return $dataSource;
}
示例12: getModule
public function getModule()
{
$currentUser = $this->getCurrentUser();
// Get smarty global variable
$smarty = $this->getSmartyVar();
$userRole = $currentUser->getRole($this->getCurrentLesson());
// If user is admin
if ($currentUser->getType() == "administrator") {
// Create form
$form = new HTML_QuickForm("BBB_server_entry_form", "post", $_SERVER['REQUEST_URI'], "", null, true);
$form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
//Register this rule for checking user input with our function, eF_checkParameter
$form->addElement('text', 'server', null, 'class = "inputText" id="server_input"');
$form->addRule('server', _BBBTHEFIELDNAMEISMANDATORY, 'required', null, 'client');
$form->addElement('text', 'salt', null, 'class = "inputText" id="salt_input"');
$form->addElement('text', 'logout_url', null, 'class = "inputText" id="logout_url_input"');
$form->addElement('checkbox', 'serverVersion', null);
$form->addElement('submit', 'submit_BBB_server', _SUBMIT, 'class = "flatButton"');
// if form isSubmitted
if ($form->isSubmitted() && $form->validate()) {
$server_name = $form->exportValue('server');
$salt_string = $form->exportValue('salt');
$version_choice = $form->exportValue('serverVersion');
$logout_url = $form->exportValue('logout_url');
if ($server_name[strlen($server_name) - 1] == "/") {
$server_name = substr($server_name, 0, strlen($server_name) - 1);
}
// register BBB configuration values
EfrontConfiguration::setValue("module_BBB_server", $server_name);
EfrontConfiguration::setValue("module_BBB_salt", $salt_string);
EfrontConfiguration::setValue("module_BBB_server_version", $version_choice);
EfrontConfiguration::setValue("module_BBB_logout_url", $logout_url);
$this->setMessageVar(_BBB_SUCCESFULLYCHANGEDSERVER, "success");
}
$form->setDefaults(array('server' => $this->getBBBServer()));
$form->setDefaults(array('salt' => $this->getBBBSalt()));
$form->setDefaults(array('serverVersion' => $this->getBBBServerVer()));
$form->setDefaults(array('logout_url' => $this->getBBBLogoutUrl()));
//echo 'My server version is 0.7+: '.$this -> getBBBServerVer();
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$form->accept($renderer);
$smarty->assign('T_BBB_FORM', $renderer->toArray());
}
/*** Ajax Methods - Add/remove skills/jobs***/
if (isset($_GET['postAjaxRequest'])) {
/** Post skill - Ajax skill **/
if (eF_checkParameter($_GET['edit_BBB'], 'id') === false) {
header("HTTP/1.0 500 ");
echo _UNPRIVILEGEDATTEMPT;
exit;
}
if ($_GET['insert'] == "true") {
// Adding a user to a conference
eF_insertTableData("module_BBB_users_to_meeting", array('users_LOGIN' => $_GET['user'], 'meeting_ID' => $_GET['edit_BBB']));
} else {
if ($_GET['insert'] == "false") {
// Removing a user from a conference
eF_deleteTableData("module_BBB_users_to_meeting", "users_LOGIN = '" . $_GET['user'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'");
} else {
if (isset($_GET['addAll'])) {
// Add all users to a conference
$users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND (meeting_ID <> '" . $_GET['edit_BBB'] . "' OR meeting_ID IS NULL)");
$users_attending = eF_getTableDataFlat("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'");
isset($_GET['filter']) ? $users = eF_filterData($users, $_GET['filter']) : null;
$users_attending = $users_attending['login'];
foreach ($users as $user) {
if (!in_array($user['login'], $users_attending)) {
eF_insertTableData("module_BBB_users_to_meeting", array('users_LOGIN' => $user['login'], 'meeting_ID' => $_GET['edit_BBB']));
$users_attending[] = $user['login'];
}
}
} else {
if (isset($_GET['removeAll'])) {
// Remove all users from a conference
$users_attending = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN LEFT OUTER JOIN module_BBB_users_to_meeting ON users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND meeting_ID = '" . $_GET['edit_BBB'] . "'");
//$users_attending = $users_attending['login'];
isset($_GET['filter']) ? $users_attending = eF_filterData($users_attending, $_GET['filter']) : null;
$users_to_delete = array();
foreach ($users_attending as $user) {
$users_to_delete[] = $user['login'];
}
eF_deleteTableData("module_BBB_users_to_meeting", "meeting_ID = '" . $_GET['edit_BBB'] . "' AND users_LOGIN IN ('" . implode("','", $users_to_delete) . "')");
} else {
if (isset($_GET['mail_users']) && $_GET['mail_users'] == 1) {
$currentLesson = $this->getCurrentLesson();
$meeting_users = eF_getTableData("module_BBB_users_to_meeting JOIN users ON module_BBB_users_to_meeting.users_LOGIN = users.login", "users.login, users.name, users.surname, users.email", "meeting_ID = " . $_GET['edit_BBB'] . " AND users.login <> '" . $currentUser->user['login'] . "'");
isset($_GET['filter']) ? $meeting_users = eF_filterData($meeting_users, $_GET['filter']) : null;
$meeting_info = eF_getTableData("module_BBB", "*", "id = " . $_GET['edit_BBB']);
$subject = _BBB_MEETING;
$count = 0;
foreach ($meeting_users as $user) {
$body = _BBB_DEAR . " " . $user['name'] . ",\n\n" . _BBB_YOUHAVEBEENINVITEDBYPROFESSOR . " " . $currentUser->user['name'] . " " . $currentUser->user['surname'] . " " . _BBB_TOATTENDACONFERENCE . " \"" . $meeting_info[0]['name'] . "\" " . _BBB_FORLESSON . " \"" . $currentLesson->lesson['name'] . "\" " . _BBB_SCHEDULEDFOR . "\n\n" . date("D d.m.y, g:i a", $meeting_info[0]['timestamp']) . "\n\n" . _BBBYOUCANJOINTHEMEETINGDIRECTLYBYCLICKINGTHEFOLLOWINGLINKAFTERITSTARTS . ":\n\n";
$userObject = EfrontUserFactory::factory($user['login']);
//$body .= $this -> createBBBUrl($userObject, $meeting_info[0], true);
$body .= "\n\n" . _BBB_SINCERELY . ",\n" . $currentUser->user['name'] . " " . $currentUser->user['surname'];
$my_email = $currentUser->user['email'];
$user_mail = $user['email'];
$header = array('From' => $GLOBALS['configuration']['system_email'], 'To' => $user_mail, 'Subject' => $subject, 'Content-type' => 'text/plain;charset="UTF-8"', 'Content-Transfer-Encoding' => '7bit');
$smtp = Mail::factory('smtp', array('auth' => $GLOBALS['configuration']['smtp_auth'] ? true : false, 'host' => $GLOBALS['configuration']['smtp_host'], 'password' => $GLOBALS['configuration']['smtp_pass'], 'port' => $GLOBALS['configuration']['smtp_port'], 'username' => $GLOBALS['configuration']['smtp_user'], 'timeout' => $GLOBALS['configuration']['smtp_timeout']));
if ($smtp->send($user_mail, $header, $body)) {
//.........这里部分代码省略.........
示例13: foreach
$currentTest->addQuestions($questions_to_add);
} else {
if (isset($_GET['removeAll'])) {
$testQuestions = $currentTest->getQuestions();
if ($skillgap_tests) {
// Create a field to simulate the values appearing under the Associated with column of skillgap tests
foreach ($testQuestions as $qid => $testQuestion) {
if ($testQuestion['lessons_ID'] == 0) {
$testQuestions[$qid]['name'] = _SKILLGAPTESTS;
} else {
$lesson = new EfrontLesson($testQuestion['lessons_ID']);
$testQuestions[$qid]['name'] = _LESSON . ": " . $lesson->lesson['name'];
}
}
}
isset($_GET['filter']) ? $testQuestions = eF_filterData($testQuestions, $_GET['filter']) : null;
$currentTest->removeQuestions(array_keys($testQuestions));
}
}
}
unset($currentTest->options['random_test']);
$currentTest->persist();
//ArrayObject is required in order for json to work well with prototype
$stats = new ArrayObject($currentTest->questionsInfo());
$stats['difficulties'] = new ArrayObject($stats['difficulties']);
$stats['types'] = new ArrayObject($stats['types']);
$stats['percentage'] = new ArrayObject($stats['percentage']);
$stats['duration'] = eF_convertIntervalToTime($stats['total_duration']);
$stats['random_pool'] = $currentTest->options['random_pool'];
$stats['test_duration'] = $currentTest->options['duration'];
header("content-type:application/json");
示例14: array
$directionPaths = $directionsTree->toPathString();
$smarty->assign("T_DIRECTIONS_PATHS", $directionPaths);
$constraints = array('archive' => false, 'condition' => "creator_LOGIN='{$_SESSION['s_login']}'") + createConstraintsFromSortedTable();
$dataSource = EfrontLesson::getAllLessons($constraints);
$totalEntries = EfrontLesson::countAllLessons($constraints);
$tableName = $_GET['ajax'];
$alreadySorted = 1;
$smarty->assign("T_TABLE_SIZE", $totalEntries);
include "sorted_table.php";
isset($_GET['limit']) ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
if (isset($_GET['sort'])) {
isset($_GET['order']) ? $order = $_GET['order'] : ($order = 'asc');
$lessons = eF_multiSort($lessons, $_GET['sort'], $order);
}
if (isset($_GET['filter'])) {
$lessons = eF_filterData($lessons, $_GET['filter']);
}
$smarty->assign("T_LESSONS_SIZE", sizeof($lessons));
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$lessons = array_slice($lessons, $offset, $limit);
}
foreach ($lessons as $key => $lesson) {
$obj = new EfrontLesson($lesson);
//$lessons[$key]['link'] = $obj -> toHTMLTooltipLink(basename($_SERVER['PHP_SELF']).'?ctg=professor_lessons&edit_lesson='.$lesson['id']);
$lessons[$key]['direction_name'] = $directionPaths[$lesson['directions_ID']];
$lessons[$key]['price_string'] = $obj->lesson['price_string'];
//$lessons[$key]['students'] = sizeof($obj -> getUsers('student'));
}
$smarty->assign("T_LESSONS_DATA", $lessons);
$smarty->display('professor.tpl');
示例15: unset
unset($courses[$key]);
}
}
}
}
$courses = array_values($courses);
//Reindex so that sorting works
$roles = EfrontLessonUser::getLessonsRoles(true);
$smarty->assign("T_ROLES_ARRAY", $roles);
isset($_GET['limit']) ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
if (isset($_GET['sort'])) {
isset($_GET['order']) ? $order = $_GET['order'] : ($order = 'asc');
$courses = eF_multiSort($courses, $_GET['sort'], $order);
}
if (isset($_GET['filter'])) {
$courses = eF_filterData($courses, $_GET['filter']);
}
$smarty->assign("T_COURSES_SIZE", sizeof($courses));
if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
$courses = array_slice($courses, $offset, $limit);
}
//foreach ($courses as $key => $course) {
//$courses[$key]['languages_NAME'] = $languages[$course['languages_NAME']];
//}
$smarty->assign("T_COURSES_DATA", $courses);
$smarty->display($_SESSION['s_type'] . '.tpl');
exit;
}
// We change a bit the following typical query to acquire the latest options values for the test - in case a threshold has been changed
$result = EfrontCompletedTest::retrieveCompletedTest("completed_tests ct JOIN completed_tests_blob ctb on ct.id=ctb.completed_tests_ID JOIN tests t ON t.id = ct.tests_ID", "ct.*, ctb.test, t.options", "ct.status != 'deleted' and ct.id = '" . $_GET['show_solved_test'] . "'");