本文整理汇总了PHP中eF_getTableData函数的典型用法代码示例。如果您正苦于以下问题:PHP eF_getTableData函数的具体用法?PHP eF_getTableData怎么用?PHP eF_getTableData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eF_getTableData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRefresh_rate
function getRefresh_rate()
{
$rate = eF_getTableData("module_chat_config", "refresh_rate", "1");
foreach ($rate as $r) {
echo $r['refresh_rate'];
}
}
示例2: getLessonFromId
function getLessonFromId()
{
if (eF_checkParameter($_GET['loglessonid'], 'id')) {
$id = $_GET["loglessonid"];
$result = eF_getTableData('lessons', 'id, name', "id='" . $id . "'");
echo json_encode(array('name' => $result[0]['name'], 'id' => $result[0]['id']));
}
}
示例3: __construct
/**
*
* @param $param
* @return unknown_type
*/
public function __construct($param)
{
//Special handling in case we are instantiating with string (name) instead of id
if (!eF_checkParameter($param, 'id') && eF_checkParameter($param, 'alnum_general')) {
$result = eF_getTableData("themes", "id", "name='" . $param . "'");
if (sizeof($result) == 0) {
throw new EfrontEntityException(_ENTITYNOTFOUND . ': ' . htmlspecialchars($param), EfrontEntityException::ENTITY_NOT_EXIST);
}
$param = $result[0]['id'];
}
parent::__construct($param);
if (strpos($this->{$this->entity}['path'], 'http') === 0) {
$this->remote = 1;
}
/*
//Check whether this is a remote theme
if (!is_dir($this -> {$this -> entity}['path']) && !is_file($this -> {$this -> entity}['path'])) {
if (!fopen($this -> {$this -> entity}['path'].'theme.xml', 'r')) {
throw new EfrontEntityException(_ENTITYNOTFOUND.': '.htmlspecialchars($this -> {$this -> entity}['path']), EfrontEntityException :: ENTITY_NOT_EXIST);
} else {
$this -> remote = 1;
}
}
*/
if (unserialize($this->{$this->entity}['options']) !== false) {
$this->options = unserialize($this->{$this->entity}['options']);
}
if (!$this->options) {
$this->options = array();
}
if (unserialize($this->{$this->entity}['layout']) !== false) {
$this->layout = unserialize($this->{$this->entity}['layout']);
}
if (!$this->layout) {
$this->layout = array();
}
//Check validity of current logo
try {
if (isset($this->options['logo'])) {
new EfrontFile($this->options['logo']);
} else {
throw new Exception();
}
} catch (Exception $e) {
$this->options['logo'] = false;
}
//Check validity of current favicon
try {
if (isset($this->options['favicon'])) {
new EfrontFile($this->options['favicon']);
} else {
throw new Exception();
}
} catch (Exception $e) {
$this->options['favicon'] = false;
}
}
示例4: getConnectedUsers
function getConnectedUsers()
{
$usersOnline = array();
//A user may have multiple active entries on the user_times table, one for system, one for unit etc. Pick the most recent
$result = eF_getTableData("user_times,users,module_chat_users", "users_LOGIN, users.name, users.surname, users.user_type, timestamp_now, session_timestamp", "users.login=user_times.users_LOGIN and users.login=module_chat_users.username and session_expired=0", "timestamp_now desc");
foreach ($result as $value) {
if (!isset($parsedUsers[$value['users_LOGIN']])) {
$value['login'] = $value['users_LOGIN'];
$usersOnline[] = array('login' => $value['users_LOGIN'], 'formattedLogin' => formatLogin($value['login'], $value), 'user_type' => $value['user_type'], 'timestamp_now' => $value['timestamp_now'], 'time' => eF_convertIntervalToTime(time() - $value['session_timestamp']));
$parsedUsers[$value['users_LOGIN']] = true;
}
}
return $usersOnline;
}
示例5: unset
$groups[$key]['partof'] = 1;
} else {
if ((!$group['active'] || !$_change_groups_) && !($_self_groups_ && $group['self_enroll'])) {
unset($groups[$key]);
}
}
}
$dataSource = $groups;
$tableName = 'groupsTable';
include "sorted_table.php";
}
} catch (Exception $e) {
handleAjaxExceptions($e);
}
if (isset($_GET['postAjaxRequest']) && ($_change_groups_ || $_self_groups_)) {
$result = eF_getTableData("groups", "*", "active=1");
$groups = array();
foreach ($result as $key => $value) {
if ($value['active'] && ($_change_groups_ || $_self_groups_ && $value['self_enroll'])) {
$groups[$value['id']] = $value;
}
}
try {
if ($_GET['insert'] == "true" && in_array($_GET['add_group'], array_keys($groups))) {
$editedUser->addGroups($_GET['add_group']);
} else {
if ($_GET['insert'] == "false" && in_array($_GET['add_group'], array_keys($groups))) {
$editedUser->removeGroups($_GET['add_group']);
} else {
if (isset($_GET['addAll'])) {
isset($_GET['filter']) ? $groups = eF_filterData($groups, $_GET['filter']) : null;
示例6: EfrontContentTree
}
$smarty->assign("T_TABLE_OPTIONS", $options);
$currentContent = new EfrontContentTree($currentLesson);
if ($_GET['scorm_review']) {
$iterator = new EfrontSCORMFilterIterator(new EfrontNodeFilterIterator(new RecursiveIteratorIterator(new RecursiveArrayIterator($currentContent->tree), RecursiveIteratorIterator::SELF_FIRST)));
foreach ($iterator as $key => $value) {
$scormContentIds[] = $key;
}
if (sizeof($scormContentIds)) {
$result = eF_getTableData("scorm_data, content, users", "scorm_data.*, content.name as content_name, users.name, users.surname", "scorm_data.users_LOGIN != '' and scorm_data.content_ID IN (" . implode(",", $scormContentIds) . ") and content_ID=content.id and users.login=scorm_data.users_LOGIN");
$result2004 = array();
if (G_VERSIONTYPE != 'community') {
#cpp#ifndef COMMUNITY
if (G_VERSIONTYPE != 'standard') {
#cpp#ifndef STANDARD
$result2004 = eF_getTableData("scorm_data_2004, content, users", "scorm_data_2004.*, content.name as content_name, users.name, users.surname", "scorm_data_2004.users_LOGIN != '' and scorm_data_2004.content_ID IN (" . implode(",", $scormContentIds) . ") and content_ID=content.id and users.login=scorm_data_2004.users_LOGIN");
}
#cpp#endif
}
#cpp#endif
$scormData = array_merge($result, $result2004);
} else {
$scormData = array();
}
foreach ($result as $value) {
//$scormData[$value['users_LOGIN']] = $value;
}
//$smarty -> assign("T_SCORM_DATA", $scormData);
if (isset($_GET['ajax']) && $_GET['ajax'] == 'scormUsersTable') {
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')) {
示例7: array
$skills_missing = array();
$all_skills = "";
foreach ($_GET as $key => $value) {
// all skill-related posted values are just the skill_ID ~ a uint value
if (eF_checkParameter($key, 'unit')) {
if ($value == 1) {
$skills_missing[] = $key;
}
}
}
// We found all the skills missing
$skills_missing = implode("','", $skills_missing);
// We have all the already attended courses
$alredy_attending = implode("','", array_keys($editedUser->getLessons()));
// Thus we can find the missing courses to fill the skill gap
$lessons_proposed = eF_getTableData("module_hcd_skills LEFT OUTER JOIN module_hcd_lesson_offers_skill ON module_hcd_skills.skill_ID = module_hcd_lesson_offers_skill.skill_ID JOIN lessons ON lessons.id = module_hcd_lesson_offers_skill.lesson_ID", "module_hcd_lesson_offers_skill.lesson_ID, lessons.*, count(module_hcd_lesson_offers_skill.skill_ID) as skills_offered", "module_hcd_lesson_offers_skill.skill_ID IN ('" . $skills_missing . "') AND module_hcd_lesson_offers_skill.lesson_ID NOT IN ('" . $alredy_attending . "')", "", "module_hcd_lesson_offers_skill.lesson_ID ORDER BY skills_offered DESC");
// And assign them
foreach ($lessons_proposed as $lesson) {
$editedUser->addLessons($lesson['lesson_ID']);
}
}
}
}
}
}
exit;
}
}
if (isset($_GET['ajax']) && $_GET['ajax'] == 'toggle_user' && $_GET['type'] == 'lesson' && $_change_lessons_) {
$response = array('status' => 1);
$editLesson = new EfrontLesson($_GET['id']);
示例8: catch
}
$currentContent->seekNode($value)->activate();
} catch (Exception $e) {
$errorMessages[] = $e->getMessage() . ' ' . $e->getCode();
}
}
}
}
if (isset($_POST['deactivate_nodes']) && $_POST['deactivate_nodes']) {
foreach ($_POST['deactivate_nodes'] as $value) {
if (in_array($value, $legalValues) && eF_checkParameter($value, 'id')) {
try {
// Deactivate also linked units
$linked_units = eF_getTableData('content', 'id', 'linked_to=' . $value);
foreach ($linked_units as $unit) {
$lessons_IDs = eF_getTableData('content', 'lessons_ID', 'id=' . $unit['id']);
foreach ($lessons_IDs as $lessons_ID) {
$lessonsContent = new EfrontContentTree($lessons_ID['lessons_ID']);
$lessonsContent->seekNode($unit['id'])->deactivate();
}
}
$currentContent->seekNode($value)->deactivate();
} catch (Exception $e) {
$errorMessages[] = $e->getMessage() . ' ' . $e->getCode();
}
}
}
}
if (isset($_POST['node_orders']) && $_POST['node_orders']) {
//$nodeOrders = explode(",", $_POST['node_orders']);
$previousContentId = 0;
示例9: catch
} catch (Exception $e) {
$smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
$message = $e->getMessage() . ' <a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
$message_type = failure;
}
} else {
$smarty->assign("T_CART", cart::prepareCart());
}
if (isset($_SESSION['s_login']) && ($GLOBALS['currentTheme']->options['sidebar_interface'] == 2 && $GLOBALS['currentTheme']->options['show_header'] == 2)) {
try {
//$currentUser = EfrontUserFactory :: factory($_SESSION['s_login']);
$currentUser = EfrontUser::checkUserAccess();
refreshLogin();
//$_SESSION['last_action_timestamp'] = time(); //Keep the last time something happened to the session
if ($accounts = unserialize($currentUser->user['additional_accounts'])) {
$result = eF_getTableData("users", "login, user_type", 'login in ("' . implode('","', array_values($accounts)) . '")');
$smarty->assign("T_MAPPED_ACCOUNTS", $result);
}
} catch (Exception $e) {
}
}
if (isset($_GET['ctg']) && is_numeric($_GET['ctg'])) {
//cheking a possible issue with search engine robots that overloads server
if (empty($customBlocks) || in_array($_GET['ctg'], array_keys($customBlocks)) !== true) {
eF_redirect("HTTP/1.0 404 Not Found");
}
}
if (isset($_SESSION['s_login']) && $_SESSION['s_login']) {
//This way, logged in users that stay on index.php are not logged out
$loadScripts[] = 'sidebar';
}
示例10: eF_local_printBranchJobs
function eF_local_printBranchJobs($branch)
{
$result = $branch->getJobDescriptions();
$branchJobs = array("--- {$branch->branch['name']} ---");
foreach ($result as $value) {
$branchJobs[$value['description']] = $value['description'];
}
$branchJobs['#empty#'] = "--- " . _OTHERBRANCHJOBS . " ---";
$result = eF_getTableData("module_hcd_job_description", "distinct description");
foreach ($result as $value) {
$branchJobs[$value['description']] = $value['description'];
}
return $branchJobs;
}
示例11: eF_getTableData
$smarty->assign("T_LAYOUT_CLASS", "centerFull hideLeft");
} 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
}
if (!$currentLesson->options['show_horizontal_bar'] && $_student_ || $_COOKIE['horizontalSideBar'] == 'hidden') {
$smarty->assign("T_HEADER_CLASS", "headerHidden");
} else {
$smarty->assign("T_HEADER_CLASS", "header");
//$currentTheme -> options['toolbar_position'] == "left" ? "hideRight" : "hideLeft"); //Whether to show the sidemenu on the left or on the right
}
if (isset($currentUnit['options']['maximize_viewport']) && $currentUnit['options']['maximize_viewport'] && $currentUser->getType($currentLesson) == "student") {
$smarty->assign("T_MAXIMIZE_VIEWPORT", 1);
}
if (isset($currentUnit['options']['scorm_times']) && $currentUnit['options']['scorm_times']) {
$result = eF_getTableData("users_to_content", "visits", "content_ID={$unit['id']} AND lessons_ID={$currentLesson->lesson['id']} AND users_LOGIN='{$currentUser->user['login']}'");
$remaining_times = $currentUnit['options']['scorm_times'] - $result[0]['visits'];
$remaining_times > 0 or $remaining_times = 0;
$smarty->assign("T_SCORM_TIMES_REMAINING", $remaining_times);
}
if (isset($currentUnit['options']['scorm_asynchronous']) && $currentUnit['options']['scorm_asynchronous']) {
$smarty->assign("T_SCORM_ASYNCHRONOUS", 1);
} else {
$smarty->assign("T_SCORM_ASYNCHRONOUS", 0);
}
if (isset($currentUnit['options']['object_ids']) && $currentUnit['options']['object_ids']) {
$smarty->assign("T_OBJECT_IDS", $currentUnit['options']['object_ids']);
}
$content_side_modules = array();
foreach ($loadedModules as $module) {
if (isset($currentLesson->options[$module->className]) && $currentLesson->options[$module->className] == 1) {
示例12: eF_getTableData
$result = eF_getTableData("users_to_content", "visits, attempt_identifier", "content_ID={$unit['id']} and users_LOGIN='{$scoUser->user['login']}'");
if (!empty($result)) {
// vd($_SESSION['attempt_identifier']);
// vd($result[0]['attempt_identifier']);
$visits = $result[0]['visits'];
if ($_SESSION['attempt_identifier'] != $result[0]['attempt_identifier']) {
eF_updateTableData("users_to_content", array("visits" => $result[0]['visits'] + 1, "attempt_identifier" => $_SESSION['attempt_identifier']), "content_ID={$unit['id']} and users_LOGIN='{$scoUser->user['login']}'");
$visits = $result[0]['visits'] + 1;
}
} else {
eF_insertTableData("users_to_content", array("attempt_identifier" => $_SESSION['attempt_identifier'], "visits" => 1, "content_ID" => $unit['id'], "lessons_ID" => $unit['lessons_ID'], "users_LOGIN" => $scoUser->user['login']));
$visits = 1;
}
$remaining_times = $unit['options']['scorm_times'] - $visits;
}
}
$newUserProgress = EfrontStats::getUsersLessonStatus($scoLesson, $scoUser->user['login']);
$newPercentage = $newUserProgress[$scoLesson->lesson['id']][$scoUser->user['login']]['overall_progress'];
$newConditionsPassed = $newUserProgress[$scoLesson->lesson['id']][$scoUser->user['login']]['conditions_passed'];
$newLessonPassed = $newUserProgress[$scoLesson->lesson['id']][$scoUser->user['login']]['lesson_passed'];
if ($scoLesson->lesson['course_only'] && $_SESSION['s_courses_ID']) {
$res = eF_getTableData("users_to_courses", "issued_certificate", "courses_ID=" . $_SESSION['s_courses_ID'] . " and users_LOGIN='" . $_SESSION['s_login'] . "'");
if ($res[0]['issued_certificate'] != "") {
$courseCertified = true;
}
}
echo json_encode(array($newPercentage, $newConditionsPassed, $newLessonPassed, $scormState, $redirectTo, $trackActivityInfo, $courseCertified, $remaining_times));
} catch (Exception $e) {
echo json_encode(array('error' => $e->getMessage()));
}
exit;
示例13: toggleSetting
private function toggleSetting($setting, $enable)
{
$result = eF_getTableData("lessons", "id, options");
foreach ($result as $value) {
$options = unserialize($value['options']);
$enable ? $options[$setting] = 1 : ($options[$setting] = 0);
eF_updateTableData("lessons", array("options" => serialize($options)), "id=" . $value['id']);
}
}
示例14: eF_getTableDataFlat
$result = eF_getTableDataFlat("f_users_to_polls", "count(*)", "vote != 0 and f_poll_ID=" . $poll['id']);
}
$polls[$k]['votes'] = $result['count(*)'][0];
}
$smarty->assign("T_FORUM_TOPICS", $topics);
$smarty->assign("T_FORUM_POLLS", $polls);
if ((!$currentUser->coreAccess['forum'] || $currentUser->coreAccess['forum'] == 'change') && ($currentUser->user['user_type'] != 'student' || isset($forum_config) && $forum_config['students_add_forums']) && (!isset($_GET['forum']) || $forums[$_GET['forum']]['status'] != 2)) {
$forum_options = array(1 => array('text' => _NEWFORUM, 'image' => "16x16/add.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=forum&add=1&type=forum&parent_forum_id={$parent_forum}&popup=1", 'onclick' => "eF_js_showDivPopup(event, '" . _NEWFORUM . "', 2)", 'target' => "POPUP_FRAME"));
$smarty->assign("T_FORUM_OPTIONS", $forum_options);
}
}
}
//Calculate the forum parents, so the title may be created and displayed
while ($parent_forum != 0 && $count++ < 100) {
//Count is put to prevent an unexpected infinite loop
$result = eF_getTableData("f_forums", "id,title,parent_id,lessons_ID", "id={$parent_forum}");
$parent_forum = $result[0]['parent_id'];
$parents[$result[0]['id']] = $result[0]['title'];
$firstNode = $result[0]['lessons_ID'];
}
//echo $firstNode;
$smarty->assign("T_FIRSTNODE", $firstNode);
//pr($parents);
$smarty->assign("T_FORUM_PARENTS", array_reverse($parents, true));
$dataSource = $topics;
$tableName = 'topicsTable';
include "sorted_table.php";
}
}
}
}
示例15: HTML_QuickForm
}
}
$smarty->assign("T_MODULES", $modulesList);
$upload_form = new HTML_QuickForm("upload_file_form", "post", basename($_SERVER['PHP_SELF']) . '?ctg=modules', "", null, true);
$upload_form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
//Register this rule for checking user input with our function, eF_checkParameter
$upload_form->addElement('file', 'file_upload[0]', null, 'class = "inputText"');
$upload_form->addElement('checkbox', 'overwrite', _OVERWRITEIFFOLDEREXISTS);
$upload_form->setMaxFileSize(FileSystemTree::getUploadMaxSize() * 1024);
//getUploadMaxSize returns size in KB
$upload_form->addElement('submit', 'submit_upload_file', _UPLOAD, 'class = "flatButton"');
if ($upload_form->isSubmitted() && $upload_form->validate()) {
$filesystem = new FileSystemTree(G_MODULESPATH);
$uploadedFile = $filesystem->uploadFile('file_upload', G_MODULESPATH, 0);
if (isset($_GET['upgrade'])) {
$prev_module_version = eF_getTableData("modules", "position", "className = '" . $_GET['upgrade'] . "'");
$prev_module_folder = $prev_module_version[0]['position'];
// The name of the temp folder to extract the new version of the module
$module_folder = $prev_module_folder;
//basename($filename[0], '.zip') . time();
$module_position = $prev_module_folder;
//basename($filename[0], '.zip');
} else {
$module_folder = basename($uploadedFile['path'], '.zip');
$module_position = $module_folder;
}
if (is_dir(G_MODULESPATH . $module_folder) && !isset($_GET['upgrade']) && !isset($_POST['overwrite'])) {
$message = _FOLDERWITHMODULENAMEEXISTSIN . G_MODULESPATH;
$message_type = 'failure';
} else {
$zip = new ZipArchive();