$ar = $currentBranch->createJobDescriptionsSelect($attributes); } else { if (isset($_GET['getSupervisorsSelect'])) { $ar = $currentBranch->createSupervisorsSelect($_GET['only_existing']); } } foreach ($ar as $val => $element) { echo $val . "<option>" . $element . "<option>"; } exit; } catch (Exception $e) { } } } #cpp#endif $users = eF_countTableData("users", "login", "active=1 and archive=0"); if (G_VERSIONTYPE != 'community') { #cpp#ifndef COMMUNITY if (G_VERSIONTYPE != 'standard') { #cpp#ifndef STANDARD $versionUsers = (int) $GLOBALS['configuration']['version_users']; if ($users[0]['count'] >= $versionUsers && $versionUsers > 0) { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=contact&limit_reached=1&message=" . urlencode(_MAXIMUMUSERSLIMITREACHEDCONTACTUS) . "&message_type=failure"); } } #cpp#endif } #cpp#endif $smarty->assign("T_CTG", "signup"); $form = new HTML_QuickForm("signup_register_personal_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=signup" . (isset($_GET['ldap']) ? '&ldap=1' : ''), "", "class = 'indexForm'", true); $form->removeAttribute('name');
public function countUserCoursesAggregatingResults($constraints = array()) { !empty($constraints) or $constraints = array('archive' => false, 'active' => true); list($where, $limit, $orderby) = EfrontCourse::convertCourseConstraintsToSqlParameters($constraints); $where[] = "d.id=c.directions_ID"; if (isset($constraints['active']) && $constraints['active']) { $activeSql = 'and c1.active=1'; } else { if (isset($constraints['active']) && !$constraints['active']) { $activeSql = 'and c1.active=0'; } else { $activeSql = ''; } } $where[] = "(select count(*) > 0 from users_to_courses uc1, courses c1 where uc1.users_login='******'login'] . "' and uc1.archive=0 {$activeSql} and c1.archive = 0 and (c1.instance_source=c.id or c1.id=c.id) and c1.id=uc1.courses_ID)=1"; $result = eF_countTableData("directions d,courses c left outer join (select id from courses) r on c.id=r.id", "c.id", implode(" and ", $where)); return $result[0]['count']; }
public static function countAllCourses($constraints = array()) { list($where, $limit, $orderby) = EfrontCourse::convertCourseConstraintsToSqlParameters($constraints); $tables = "courses c"; if (isset($constraints['branch_url']) && $_SESSION['s_current_branch']) { $tables .= ' LEFT OUTER JOIN module_hcd_course_to_branch cb on cb.courses_ID=c.id'; } //$where[] = "d.id=c.directions_ID"; $result = eF_countTableData($tables, "c.id", implode(" and ", $where)); return $result[0]['count']; }
public static function countAllLessons($constraints = array()) { list($where, $limit, $orderby) = EfrontLesson::convertLessonConstraintsToSqlParameters($constraints); $result = eF_countTableData("lessons l", "l.id", implode(" and ", $where)); return $result[0]['count']; }
/** * Count group courses based on the specified constraints, including unassigned * @param array $constraints The constraints for the query * @return int the number of entries in the result set * @since 3.6.3 * @access public */ public function countGroupCoursesIncludingUnassigned($constraints = array()) { !empty($constraints) or $constraints = array('archive' => false, 'active' => true); list($where, $limit, $orderby) = EfrontCourse::convertCourseConstraintsToSqlParameters($constraints); $result = eF_countTableData("courses c left outer join (select courses_ID from courses_to_groups where groups_ID=" . $this->group['id'] . ") r on c.id=r.courses_ID", "c.id", implode(" and ", $where)); return $result[0]['count']; }
$sort = $_GET['sort']; // @TODO fix if ($sort == "timestamp") { $order = "desc"; } else { isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc'); } } else { $sort = 'timestamp'; $order = 'asc'; } $constraints = createConstraintsFromSortedTable(); list($where, $limit, $orderby) = EfrontNotification::convertNotificationConstraintsToSqlParameters($constraints); // ** Get queue messages ** $sending_queue_msgs = eF_getTableData("notifications as n", "*", implode(" and ", $where), $orderby, false, $limit); $sending_queue_size = eF_countTableData("notifications as n", "n.id", implode(" and ", $where)); //$sending_queue_msgs = eF_getTableData("notifications", "*", "active = 1", "timestamp ASC"); // Create the corresponding info per message foreach ($sending_queue_msgs as $key => $sending_queue_msg) { // recipients if ($sending_queue_msg['send_conditions'] == "N;") { $sending_queue_msgs[$key]['recipients'] = _ALLUSERS; } else { $sending_queue_msg['send_conditions'] = unserialize($sending_queue_msg['send_conditions']); if (is_array($sending_queue_msg['send_conditions'])) { if (isset($sending_queue_msg['send_conditions']['lessons_ID'])) { if ($sending_queue_msg['send_conditions']['lessons_ID'] != 0) { $lesson = new EfrontLesson($sending_queue_msg['send_conditions']['lessons_ID']); if (isset($sending_queue_msg['send_conditions']['user_type'])) { $sending_queue_msgs[$key]['recipients'] = _PROFESSORSOFLESSON . ": " . $lesson->lesson['name']; } else {
$lastLogEntry = eF_getTableData("logs", "timestamp", "", "timestamp", false, 1); $smarty->assign("T_LAST_LOG_ENTRY", $lastLogEntry[0]['timestamp']); $cleanupForm = new HTML_QuickForm("cleanup_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=maintenance&tab=cleanup", "", null, true); $cleanupForm->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $cleanupForm->addElement("text", "logs_size", null, 'class = "inputText" style = "width:60px"'); $cleanupForm->addElement("submit", "submit", _SUBMIT, 'class = "flatButton"'); if ($cleanupForm->isSubmitted() && $cleanupForm->validate()) { $timestamp = mktime(0, 0, 0, $_POST['purge_Month'], $_POST['purge_Day'], $_POST['purge_Year']); if (eF_checkParameter($timestamp, 'int')) { eF_deleteTableData("logs", "timestamp < {$timestamp}"); } eF_redirect(basename($_SERVER['PHP_SELF'] . "?ctg=maintenance&tab=cleanup&message=" . urlencode(_SUCCESSFULLYPURGEDLOGS) . "&message_type=success")); } $renderer = prepareFormRenderer($cleanupForm); $smarty->assign("T_CLEANUP_FORM", $renderer->toArray()); $notificationsSize = eF_countTableData("notifications"); $smarty->assign("T_NOTIFICATIONS_SIZE", $notificationsSize[0]['count']); $lastNotificationEntry = eF_getTableData("notifications", "timestamp", "", "timestamp", false, 1); $smarty->assign("T_LAST_NOTIFICATIONS_ENTRY", $lastNotificationEntry[0]['timestamp']); $form = new HTML_QuickForm("cleanup_notifications_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=maintenance&tab=cleanup", "", null, true); $form->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $form->addElement("text", "notifications_size", null, 'class = "inputText" style = "width:60px"'); $form->addElement("submit", "submit", _SUBMIT, 'class = "flatButton"'); if ($form->isSubmitted() && $form->validate()) { $timestamp = mktime(0, 0, 0, $_POST['purge_Month'], $_POST['purge_Day'], $_POST['purge_Year']); if (eF_checkParameter($timestamp, 'int')) { eF_deleteTableData("notifications", "timestamp < {$timestamp}"); } eF_redirect(basename($_SERVER['PHP_SELF'] . "?ctg=maintenance&tab=cleanup&message=" . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . "&message_type=success")); } $renderer = prepareFormRenderer($form);