public function getTransaction($start_index, $results, $sort, $dir, $filter = false) { $query = "SELECT t.id_trans, t.date_creation, t.date_activated, t.paid, SUM(ti.price) as price, u.userid, u.firstname, u.lastname" . " FROM %adm_transaction as t" . " JOIN %adm_transaction_info as ti ON t.id_trans = ti.id_trans" . " JOIN %adm_user as u ON t.id_user = u.idst" . " WHERE 1"; $query .= " GROUP BY t.id_trans"; switch ($sort) { case 'userid': $query .= " ORDER BY u.userid " . $dir; break; case 'firstname': $query .= " ORDER BY u.firstname " . $dir; break; case 'lastname': $query .= " ORDER BY u.lastname " . $dir; break; case 'date_creation': $query .= " ORDER BY t.date_creation " . $dir; break; case 'date_activated': $query .= " ORDER BY t.date_activated " . $dir; break; } $start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results); $result = sql_query($query); $res = array(); while ($row = sql_fetch_assoc($result)) { $row['userid'] = $this->acl_man->relativeId($row['userid']); $row['date_creation'] = Format::date($row['date_creation'], 'datetime'); $row['date_activated'] = Format::date($row['date_activated'], 'datetime'); $row['paid'] = $row['paid'] == 1 ? Get::img('standard/status_active.png', Lang::t('_ACTIVATED', 'transaction')) : Get::img('standard/status_deactive.png', Lang::t('_NOT_ACTIVATED', 'transaction')); $row['edit'] = '<a href="index.php?r=alms/transaction/mod&id_trans=' . $row['id_trans'] . '" title="' . Lang::t('_MOD', 'transaction') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')) . '</a>'; $res[] = $row; } return $res; }
public function getLabelsTask() { $start_index = Get::req('startIndex', DOTY_INT, 0); $results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25)); $sort = Get::req('sort', DOTY_MIXED, 'title'); $dir = Get::req('dir', DOTY_MIXED, 'asc'); $labels = $this->model->getLabels($start_index, $results, $sort, $dir); $total_label = $this->model->getTotalLabelsCount(); $list = array(); $first = true; $count = count($labels); $counter = 0; foreach ($labels as $value) { $position = ""; if ($first) { $position .= 'first'; $first = false; } $counter++; if ($counter == $count) { $position .= 'last'; } $list[] = array('id_common_label' => $value[LABEL_ID_COMMON], 'title' => $value[LABEL_TITLE], 'description' => $this->_formatDescription($value[LABEL_DESCRIPTION], 100), 'position' => $position, 'sequence' => $value[LABEL_SEQUENCE], 'mod' => '<a href="index.php?r=alms/label/mod&id_common_label=' . $value[LABEL_ID_COMMON] . '" title="' . Lang::t('_MOD', 'label') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'label')) . '</a>', 'del' => 'ajax.adm_server.php?r=alms/label/dellabel&id_common_label=' . $value[LABEL_ID_COMMON]); } $result = array('totalRecords' => $total_label, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($list), 'records' => $list); echo $this->json->encode($result); }
/** * Return the link for the logout * @return <type> */ public static function logout() { $res = ""; if (!Docebo::user()->isAnonymous()) { $res .= '<a href="index.php?action=logout">' . Get::img('standard/exit.png', Lang::t('_LOG_LOGOUT')) . Lang::t('_LOG_LOGOUT') . '</a>'; } return $res; }
function getFbRegisterBox() { $res = ''; $lang =& DoceboLanguage::createInstance('login', 'cms'); $res = '<div class="container-feedback"><span class="ico-sprite fd_info"><span></span></span> <b>' . $lang->def('_REGISTER_WITH_FACEBOOK') . '</b>: <a href="index.php?modname=login&op=reg_with_fb">' . Get::img('social/bt_fConnect.png', $lang->def('_REGISTER_WITH_FACEBOOK')) . '</a></div>'; return $res; }
function pathelem() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php'; $lang =& DoceboLanguage::createInstance('coursepath', 'lms'); $id_path = importVar('id_path', true, 0); $mod_perm = checkPerm('mod', true); $path_man = new CoursePath_Manager(); $course_man = new Man_Course(); $path = $path_man->getCoursepathInfo($id_path); // retriving id of the courses in this path $slots = $path_man->getPathSlot($id_path); $courses = $path_man->getPathElem($id_path); // retrive all i need about courses name if (isset($courses['course_list'])) { $course_info = $course_man->getAllCourses(false, 'all', $courses['course_list']); } else { $course_info = array(); } $area_title = array('index.php?modname=coursepath&op=pathlist' => $lang->def('_COURSEPATH'), $path['path_name']); $GLOBALS['page']->add(getTitleArea($area_title, 'coursepath') . '<div class="std_block">' . getBackUi('index.php?modname=coursepath&op=pathlist', $lang->def('_BACK')), 'content'); if (isset($_GET['result'])) { switch ($_GET['result']) { case "ok": $GLOBALS['page']->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')), 'content'); break; case "err": $GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE')), 'content'); break; } } $tb_path = new Table(0, $lang->def('_COURSE_PATH_COURSES_CAPTION'), $lang->def('_COURSE_PATH_COURSES_CAPTION')); $cont_h = array($lang->def('_CODE'), $lang->def('_COURSE_NAME'), $lang->def('_PREREQUISITES')); $type_h = array('coursepath_code', 'coursepath_name', '', 'image'); if ($mod_perm) { $cont_h[] = Get::img('standard/down.png', Lang::t('_DOWN', 'coursepath')); $type_h[] = 'image'; $cont_h[] = Get::img('standard/up.png', Lang::t('_UP', 'coursepath')); $type_h[] = 'image'; $cont_h[] = Get::img('standard/moderate.png', Lang::t('_MOD', 'coursepath')); $type_h[] = 'image'; $cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />'; $type_h[] = 'image'; } $tb_path->setColsStyle($type_h); $tb_path->addHead($cont_h); $slot_number = 0; foreach ($slots as $id_slot => $slot_info) { $tb_path->emptyBody(); $tb_path->emptyFoot(); $i = 0; if (!isset($courses[$id_slot])) { $num_course = 0; } else { $num_course = count($courses[$id_slot]); $all_courses = true; if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) { $all_courses = false; require_once _base_ . '/lib/lib.preference.php'; $adminManager = new AdminPreference(); $admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST()); $all_course = false; if (isset($admin_courses['course'][0])) { $all_course = true; } elseif (isset($admin_courses['course'][-1])) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt()); if (count($user_catalogue) > 0) { $courses = array(0); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true); $courses = array_merge($courses, $catalogue_course); } foreach ($courses as $id_course) { if ($id_course != 0) { $admin_courses['course'][$id_course] = $id_course; } } } elseif (Get::sett('on_catalogue_empty', 'off') == 'on') { $all_courses = true; } } else { $array_courses = array(); $array_courses = array_merge($array_courses, $admin_courses['course']); if (!empty($admin_courses['coursepath'])) { require_once _lms_ . '/lib/lib.coursepath.php'; $path_man = new CoursePath_Manager(); $coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']); $array_courses = array_merge($array_courses, $coursepath_course); } if (!empty($admin_courses['catalogue'])) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); foreach ($admin_courses['catalogue'] as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true); $array_courses = array_merge($array_courses, $catalogue_course); } } $admin_courses['course'] = array_merge($admin_courses['course'], $array_courses); } } while (list($id_item, $prerequisites) = each($courses[$id_slot])) { $cont = array($course_info[$id_item]['code'], $course_info[$id_item]['name']); if ($prerequisites != '') { $cont[] = coursePathSubstPrer($prerequisites, $course_info); } else { $cont[] = ''; } if ($mod_perm) { if (in_array($id_item, $admin_courses['course']) || $all_courses) { if ($i != $num_course - 1) { $cont[] = '<a href="index.php?modname=coursepath&op=downelem&id_path=' . $id_path . '&id_course=' . $id_item . '&id_slot=' . $id_slot . '" ' . 'title="' . $lang->def('_MOVE_DOWN') . ' : ' . $course_info[$id_item]['name'] . '">' . Get::img('standard/down.png', Lang::t('_DOWN', 'coursepath')) . '</a>'; } else { $cont[] = ''; } if ($i != 0) { $cont[] = '<a href="index.php?modname=coursepath&op=upelem&id_path=' . $id_path . '&id_course=' . $id_item . '&id_slot=' . $id_slot . '" ' . 'title="' . $lang->def('_MOVE_UP') . ' : ' . $course_info[$id_item]['name'] . '">' . Get::img('standard/up.png', Lang::t('_UP', 'coursepath')) . '</a>'; } else { $cont[] = ''; } $cont[] = '<a href="index.php?modname=coursepath&op=modprerequisites&id_path=' . $id_path . '&id_course=' . $id_item . '&id_slot=' . $id_slot . '" ' . 'title="' . $lang->def('_MOD') . ' : ' . $course_info[$id_item]['name'] . '">' . Get::img('standard/moderate.png', Lang::t('_MOD', 'coursepath') . ' : ' . $course_info[$id_item]['name']) . '</a>'; $cont[] = '<a href="index.php?modname=coursepath&op=delcoursepath&id_path=' . $id_path . '&id_course=' . $id_item . '&id_slot=' . $id_slot . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . $course_info[$id_item]['name'] . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $course_info[$id_item]['name'] . '" /></a>'; } else { $cont[] = ''; $cont[] = ''; $cont[] = ''; $cont[] = ''; } } $tb_path->addBody($cont); $i++; } } // add link if ($mod_perm) { $tb_path->addActionAdd('<a class="ico-wt-sprite subs_import" href="index.php?modname=coursepath&op=importcourse&load=1&id_path=' . $id_path . '&id_slot=' . $id_slot . '" ' . 'title="' . $lang->def('_IMPORT_COURSE') . '">' . '<span>' . $lang->def('_IMPORT_COURSE') . '</span>' . '</a>'); } $GLOBALS['page']->add($tb_path->getTable() . '<br />', 'content'); $slot_number++; } /* $GLOBALS['page']->add( '<a href="index.php?modname=coursepath&op=modslot&id_path='.$id_path.'" ' .'title="'.$lang->def('_NEW_SLOT_TITLE').'">' .'<img src="'.getPathimage().'standard/add.png" alt="'.$lang->def('_ADD').'" />' .$lang->def('_NEW_SLOT') .'</a>' ,'content'); */ $GLOBALS['page']->add(getBackUi('index.php?modname=coursepath&op=pathlist', $lang->def('_BACK')) . '</div>', 'content'); }
<br /> <?php $array_title = array('index.php?r=adm/publicadminrules/show' => Lang::t('_PUBLIC_ADMIN_RULES', 'menu'), Lang::t('_ADMIN_MANAGE', 'adminrules') . ' - ' . $model->getGroupName($idst)); echo getTitleArea($array_title) . '<div class="std_block">'; $add_url = 'index.php?r=adm/publicadminrules/add_admin&idst=' . $idst . '&load=1'; $rel_action = '<a class="ico-wt-sprite subs_add" href="' . $add_url . '"><span>' . Lang::t('_ADD', 'adminrules') . '</span></a>'; $this->widget('table', array('id' => 'admin_rules_table', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/publicadminrules/getAdmins&idst=' . $idst . '&', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'userid', 'dir' => 'asc', 'columns' => array(array('key' => 'userid', 'label' => Lang::t('_USERNAME', 'adminrules'), 'sortable' => true), array('key' => 'firstname', 'label' => Lang::t('_FIRSTNAME', 'adminrules'), 'sortable' => true), array('key' => 'lastname', 'label' => Lang::t('_LASTNAME', 'adminrules'), 'sortable' => true), array('key' => 'del', 'label' => Get::img('standard/delete.png', Lang::t('_DEL', 'adminrules')), 'formatter' => 'doceboDelete', 'className' => 'img-cell')), 'fields' => array('id_user', 'userid', 'firstname', 'lastname', 'del'), 'stdSelection' => false, 'rel_actions' => $rel_action, 'delDisplayField' => 'groupid')); ?> </div>
Get::title(array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), Lang::t('_CLASSROOM', 'course') . ' : ' . $course_name)); ?> <div class="std_block"> <?php echo getBackUi('index.php?r=' . $base_link_course . '/show', Lang::t('_BACK', 'course')); $_columns = array(array('key' => 'code', 'label' => Lang::t('_CODE', 'course'), 'sortable' => true), array('key' => 'name', 'label' => Lang::t('_NAME', 'course'), 'sortable' => true), array('key' => 'status', 'label' => Lang::t('_STATUS', 'course'), 'sortable' => true, 'formatter' => 'statusFormatter'), array('key' => 'date_begin', 'label' => Lang::t('_DATE_BEGIN', 'course'), 'sortable' => true), array('key' => 'date_end', 'label' => Lang::t('_DATE_END', 'course'), 'sortable' => true), array('key' => 'classroom', 'label' => Lang::t('_CLASSROOM', 'course')), array('key' => 'students', 'label' => Lang::t('_STUDENTS', 'coursereport'), 'className' => 'img-cell')); if ($permissions['subscribe']) { $_columns[] = array('key' => 'subscription', 'label' => Get::sprite('subs_users', Lang::t('_SUBSCRIPTION', 'course')), 'className' => 'img-cell'); Docebo::user()->preference->getAdminPreference('admin_rules.course_presence_admin') === 'on' && Docebo::user()->getUserLevelId() !== ADMIN_GROUP_GODADMIN || Docebo::user()->getUserLevelId() === ADMIN_GROUP_GODADMIN ? $_columns[] = array('key' => 'presence', 'label' => Lang::t('_ATTENDANCE', 'course'), 'className' => 'img-cell') : ''; } if ($permissions['mod']) { $_columns[] = array('key' => 'mod', 'label' => Get::img('standard/edit.png', Lang::t('_MOD', 'course')), 'className' => 'img-cell'); } if ($permissions['del'] && !Get::cfg('demo_mode')) { $_columns[] = array('key' => 'del', 'label' => Get::img('standard/delete.png', Lang::t('_DEL', 'course')), 'formatter' => 'doceboDelete', 'className' => 'img-cell'); } $_params = array('id' => 'classroom_edition_table', 'ajaxUrl' => 'ajax.adm_server.php?r=' . $base_link_classroom . '/getclassroomedition&id_course=' . $model->getIdCourse() . '&', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'name', 'dir' => 'asc', 'columns' => $_columns, 'fields' => array('id_date', 'code', 'name', 'status', 'date_begin', 'date_end', 'classroom', 'students', 'num_subscribe', 'subscription', 'presence', 'mod', 'del'), 'show' => 'table', 'editorSaveEvent' => ''); if ($permissions['add']) { $_params['rel_actions'] = '<a class="ico-wt-sprite subs_add" href="index.php?r=' . $base_link_classroom . '/addclassroom&id_course=' . $model->getIdCourse() . '"><span>' . Lang::t('_ADD', 'subscribe') . '</span></a>'; } $this->widget('table', $_params); echo getBackUi('index.php?r=' . $base_link_course . '/show', Lang::t('_BACK', 'course')); ?> </div> <script type="text/javascript"> var StatusList = { <?php $conds = array(); $list = $this->model->getStatusForDropdown(); foreach ($list as $id_status => $name_status) {
<?php echo getTitleArea(Lang::t('_TIME_PERIODS', 'time_periods')); ?> <div class="std_block"> <?php //Table $columns = array(array('key' => 'title', 'label' => Lang::t('_NAME', 'standard'), 'sortable' => true), array('key' => 'start_date', 'label' => Lang::t('_DATE_BEGIN'), 'sortable' => true), array('key' => 'end_date', 'label' => Lang::t('_DATE_END'), 'sortable' => true)); if ($permissions['mod']) { $icon = Get::img('standard/edit.png', Lang::t('_MOD', 'standard')); $columns[] = array('key' => 'mod', 'label' => $icon, 'formatter' => 'doceboModify', 'className' => 'img-cell'); } if ($permissions['del']) { $icon = Get::img('standard/delete.png', Lang::t('_DEL', 'standard')); $columns[] = array('key' => 'del', 'label' => $icon, 'formatter' => 'doceboDelete', 'className' => 'img-cell'); } $params = array('id' => 'timeperiods', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/timeperiods/gettimeperiodslist', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'title', 'dir' => 'asc', 'columns' => $columns, 'fields' => array('id', 'title', 'label', 'start_date', 'end_date', 'mod', 'del'), 'show' => 'table', 'generateRequest' => 'YAHOO.TimePeriods.requestBuilder', 'delDisplayField' => 'title'); if ($permissions['add']) { $rel_actions = array('<a id="add_over" class="ico-wt-sprite subs_add" href="ajax.adm_server.php?r=alms/timeperiods/add"><span>' . Lang::t('_ADD', 'standard') . '</span></a>', '<a id="add_bott" class="ico-wt-sprite subs_add" href="ajax.adm_server.php?r=alms/timeperiods/add"><span>' . Lang::t('_ADD', 'standard') . '</span></a>'); $params['rel_actions'] = $rel_actions; } $this->widget('table', $params); ?> </div> <script type="text/javascript"> YAHOO.namespace("TimePeriods"); YAHOO.TimePeriods.filter = { text: "" }
<div class="list_block"> <h3 class="heading"><?php echo $title; ?> </h3> <p class="content"> <?php echo Get::img('standard/report32.png', '', '', 'style="float:left; padding:0 4px 0 0"'); ?> <?php echo $description; ?> </p> <div class="actions"> <?php echo Form::openForm('form_' . $id, $url); echo Form::openButtonSpace(); if (isset($users)) { echo Form::getInputDropdown(Lang::t('_USERS', 'standard'), 'dropdown_' . $id, 'id_user', $users['list'], $users['selected'], ''); } echo Form::getButton('button_' . $id, 'button_' . $id, Lang::t('_SHOW', 'standard')); echo Form::closeButtonSpace(); echo Form::closeForm(); ?> </div> <div class="nofloat"></div> </div>
function expandCourses(id_path, type) { var div = YAHOO.util.Dom.get('courses_' + id_path); var link = YAHOO.util.Dom.get('courses_link_' + type + '_' + id_path); div.style.display = 'block'; link.innerHTML = '<a class="no_decoration" href="javascript:;" onclick="collapseCourses(\'' + id_path + '\',\'' + type + '\');"><span class="expand_path_info"><?php echo Lang::t('_COLLAPSE', 'coursepath'); ?> </span> <?php echo Get::img('course/close.png', Lang::t('_COLLAPSE', 'coursepath')); ?> </a>'; } function collapseCourses(id_path, type) { var div = YAHOO.util.Dom.get('courses_' + id_path); var link = YAHOO.util.Dom.get('courses_link_' + type + '_' + id_path); div.style.display = 'none'; link.innerHTML = '<a class="no_decoration" href="javascript:;" onclick="expandCourses(\'' + id_path + '\',\'' + type + '\');"><span class="expand_path_info"><?php echo Lang::t('_EXPAND', 'coursepath'); ?> </span> <?php echo Get::img('course/expand.png', Lang::t('_EXPAND', 'coursepath')); ?> </a>'; } </script>
$course_list =& $man_courses->getCoursesRequest($startIndex, $results, $sort, $dir, $filter); require_once _lms_ . '/lib/lib.permission.php'; if (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN) { $moderate = checkPerm('moderate', true, 'public_course_admin', 'lms'); } elseif (Docebo::user()->getUserLevelId() == ADMIN_GROUP_ADMIN) { $moderate = checkPerm('moderate', true, 'course', 'lms'); } else { $moderate = true; } while ($row = sql_fetch_assoc($course_list)) { $row['status'] = $course_status[$row['status']]; $highlight = false; if (isset($filter['c_filter']['value']) && $filter['c_filter']['value'] != '') { $highlight = true; } $courses[] = array('idCourse' => $row['idCourse'], 'code' => $highlight ? highlightText($row['code'], $filter['c_filter']['value']) : $row['code'], 'name' => $highlight ? highlightText($row['name'], $filter['c_filter']['value']) : $row['name'], 'status' => $row['status'], 'waiting' => $row['pending'] && $moderate ? '<a href="index.php?modname=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'public_subscribe_admin' : 'subscribe') . '&op=waitinguser&id_course=' . $row['idCourse'] . '">' . $row['pending'] . '</a>' : '', 'subscriptions' => $row['course_edition'] != 1 ? isset($row['subscriptions']) ? $row['subscriptions'] : 0 : '--', 'classroom' => $row['course_edition'] == 1 ? '<a href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? '' : 'alms/') . 'edition/show&id_course=' . $row['idCourse'] . '">' . (isset($num_edition[$row['idCourse']]) ? $num_edition[$row['idCourse']] : '0') . '</a>' : '', 'certificate' => true, 'competence' => true, 'menu' => true, 'dup' => '<a id="dup_' . $row['idCourse'] . '" href="index.php?modname=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'public_course_admin' : 'course') . '&op=dup_course&id_course=' . $row['idCourse'] . '">' . Get::img('standard/dup.png', $lang->def('_MAKE_A_COPY')) . '</a>', 'mod' => true, 'del' => true); } $output = array('startIndex' => (int) $startIndex, 'recordsReturned' => count($courses), 'sort' => $sort, 'dir' => $dir, 'totalRecords' => (int) $man_courses->getCoursesCountFiltered($filter), 'pageSize' => (int) $results, 'records' => $courses); $json = new Services_JSON(); aout($json->encode($output)); break; case 'del_row': require_once _lms_ . '/lib/lib.course.php'; $output = array('success' => false); $id_course = Get::req('idrow', DOTY_INT, -1); if ($id_course > 0) { $man_course = new Man_Course(); $output['success'] = $man_course->deleteCourse($id_course); } $json = new Services_JSON(); aout($json->encode($output));
YAHOO.util.Event.onDOMReady(function() {initialize("<?php echo Lang::t('_UNDO', 'standard'); ?> ");}); function makeOrderPopup() { var title = '<?php echo Lang::t('_PAYMENT_SELECT', 'cart'); ?> '; var body = '<?php $body = '<a href="index.php?r=cart/makeOrder&wire=1">' . Get::img('standard/wire_payment.png') . ' ' . Lang::t('_WIRE_PAYMENT', 'cart') . '</a>'; if (Get::sett('paypal_mail', '') !== '') { $body .= '<br/><br/>' . '<a href="javascript:;" onclick="makeOrderPaypal();">' . Get::img('standard/PayPal.gif') . ' ' . Lang::t('_PAY_WITH_PAYPAL', 'cart') . '</a>'; } //'<a class="ico-wt-sprite subs_add" href="javascript:;" onclick="makeOrderPaypal();"><span class="order_now">'.Lang::t('_PAY_WITH_PAYPAL', 'cart').'</span></a>'; echo $body; ?> '; dialog.setHeader(title); dialog.setBody(body); dialog.show(); } function hideDialog() { dialog.hide(); }
function dispatch($op) { switch ($op) { case "tab": YuiLib::load(array('tabview' => 'tabview-min.js'), array('tabview/assets/skins/sam/' => 'tabview.css')); require_once $GLOBALS['where_framework'] . '/lib/user_selector/lib.basetree.php'; require_once $GLOBALS['where_framework'] . '/lib/user_selector/lib.groupselectortable.php'; require_once $GLOBALS['where_framework'] . '/lib/user_selector/lib.userselectortable.php'; require_once $GLOBALS['where_framework'] . '/lib/user_selector/lib.dynamicuserfilter.php'; cout(getTitleArea(array('Test manager e selettore utenti'))); cout('<div class="std_block">'); $bt = new BaseTree('user_orgchart', false, false, _TREE_COLUMNS_TYPE_RADIO); $bt->init(); $bt->setInitialSelection(); $bt_out = $bt->get(); $gst = new GroupSelectorTable('group_table'); $gst->init(); $gst_out = $gst->get(); $ust = new UserSelectorTable('user_table'); $ust->init(); $ust_out = $ust->get(); $duf = new DynamicUserFilter('user_rules'); $duf->init(); $duf_out = $duf->get(); cout($bt_out['js'], 'page_head'); cout($gst_out['js'], 'page_head'); cout($ust_out['js'], 'page_head'); cout($duf_out['js'], 'page_head'); cout('<div id="' . $this->id . '" class="yui-navset"> <ul class="yui-nav"> <li><a href="#tab1"><em>Organigramma</em></a></li> <li class="selected"><a href="#tab2"><em>Utenti</em></a></li> <li><a href="#tab3"><em>Gruppi</em></a></li> <li><a href="#tab4"><em>Regole</em></a></li> </ul> <div class="yui-content"> <div id="tab1">' . $bt_out['html'] . '</div> <div id="tab2">' . $ust_out['html'] . '</div> <div id="tab3"><p>' . $gst_out['html'] . '</p></div> <div id="tab4">' . $duf_out['html'] . '</div> </div> </div>'); cout('<script type="text/javascript"> var tabView = new YAHOO.widget.TabView(\'demo\'); </script>'); cout('</div>'); break; case "final": require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_framework'] . '/lib/user_selector/lib.fulluserselector.php'; $selector = new FullUserSelector('selector'); $selector->init(); $temp = $selector->get(); cout(getTitleArea(array('Selettore utenti completo'))); cout('<div class="std_block">'); cout(Form::openForm('test', 'index.php?modname=_test_module&op=resp_to_form')); cout($temp['js'], 'page_head'); cout($temp['html']); cout(Form::openButtonSpace() . Form::getButton('save', 'save', 'SALVA') . Form::getButton('undo', 'undo', 'ANNULLA') . Form::closeButtonSpace()); cout(Form::closeForm()); cout('</div>'); break; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ case 'dataexport': require_once _base_ . '/lib/dataexport/lib.dataexport.php'; $lang =& DoceboLanguage::CreateInstance('standard', 'framework'); $query = "SELECT * FROM core_user ORDER BY lastname LIMIT 0,20 "; $source = new DataSource_Query($query); $nameGroup = array(); $nameGroup[] = new DataColumn('lastname', $lang->def('_LASTNAME')); $nameGroup[] = new DataColumn('firstname', $lang->def('_FIRSTNAME')); $columns = array(); $columns[] = new DataColumn('idst', $lang->def('_ID')); $columns[] = new DataColumnGroup('name', $lang->def('_NAME'), $nameGroup); $columns[] = new DataColumn('userid', $lang->def('_USERNAME'), 'formatter_userid'); $columns[] = new DataColumn('email', $lang->def('_EMAIL')); //$columns[] = new DataColumn(); $export = new DataExport(DATATYPE_HTM, 'users', $columns, $source); cout($export->render()); cout('<br /><br /><a href="index.php?modname=_test_module&op=dataexportcsv">SCARICA IN CSV</a>'); break; case 'dataexportcsv': require_once _base_ . '/lib/lib.download.php'; require_once _base_ . '/lib/dataexport/lib.dataexport.php'; $lang =& DoceboLanguage::CreateInstance('standard', 'framework'); $query = "SELECT * FROM core_user ORDER BY lastname LIMIT 0,20 "; $source = new DataSource_Query($query); $nameGroup = array(); $nameGroup[] = new DataColumn('lastname', $lang->def('_LASTNAME')); $nameGroup[] = new DataColumn('firstname', $lang->def('_FIRSTNAME')); $columns = array(); $columns[] = new DataColumn('idst', $lang->def('_ID')); $columns[] = new DataColumnGroup('name', $lang->def('_NAME'), $nameGroup); $columns[] = new DataColumn('userid', $lang->def('_USERNAME'), 'formatter_userid'); $columns[] = new DataColumn('email', $lang->def('_EMAIL')); //$columns[] = new DataColumn(); $export = new DataExport(DATATYPE_XLS, 'users', $columns, $source); sendStrAsFile($export->render(), "export_utenti.xls"); break; case 'sample': $libs = YuiLib::load(false, false, true); $GLOBALS['page']->add($libs, 'page_head'); $GLOBALS['page']->add(Util::get_css('../yui-skin/datatable.css'), 'page_head'); Util::get_js(Get::rel_path('base') . '/docebocore/modules/_test_module/sample.js', true, true); $script = 'YAHOO.util.Event.onDOMReady(function(e) { initTable(); });'; //$GLOBALS['page']->add('<p>TITLE</p>'); $GLOBALS['page']->add('<div id="datatable"></div>'); $GLOBALS['page']->add('<script type="text/javascript">' . $script . '</script>'); break; case 'datatable': require_once _lms_ . '/lib/table_view/class.coursetableview.php'; $_temp_ = array(array("idCourse" => 0, "code" => "codice_001", "name" => "nome_001", "status" => "ok", "subscriptions" => 10), array("idCourse" => 1, "code" => "codice_002", "name" => "nome_002", "status" => "ok", "subscriptions" => 20), array("idCourse" => 2, "code" => "codice_003", "name" => "nome_003", "status" => "ok", "subscriptions" => 30), array("idCourse" => 3, "code" => "codice_004", "name" => "nome_004", "status" => "no", "subscriptions" => 40), array("idCourse" => 4, "code" => "codice_005", "name" => "nome_005", "status" => "ok", "subscriptions" => 50)); require_once _lms_ . '/lib/table_view/class.coursetableview.php'; $tableView = new CourseTableView("courses_table"); $tableView->useDOMReady = true; //to change $tableView->isGlobalVariable = true; //just for debug purpose $tableView->initLibraries(); $tableView->setInitialData($_temp_); $temp = $tableView->get(); cout($temp['js'], 'page_head'); cout('<div style="border:solid 1px black; padding:8px;"><p>DATATABLE:</p>' . $temp['html'] . '</div>'); break; case "catalogue": YuiLib::load(); cout('<div class="area_block"><h1 class="main_title_dashboard" id="main_area_title">Catalogo corsi</h1></div>', 'content'); cout('<div class="std_block">', 'content'); cout('<div id="course_cat" class="">', 'content'); cout('<ul class=""> <li class="selected"><a href="#tab1"><em>Inviti</em></a></li> <li><a href="#tab2"><em>Nuovi</em></a></li> <li><a href="#tab3"><em>Consigliati</em></a></li> <li><a href="#tab4"><em>Completo</em></a></li> <li><a href="#tab5"><em>Calendario</em></a></li> </ul> <div class="yui-content"> <div>' . Get::img(Get::rel_path('base') . '/mycourses.jpg', false, false, false, true) . '</div> <div> <p>Lorem ipsum dolor sit amet consectetuer accumsan enim tempor neque urna. Tempus interdum euismod felis mauris Aliquam et vitae elit vel leo. Accumsan Phasellus sit natoque rutrum nibh auctor eu neque porta tincidunt. Ipsum enim ut felis nunc Pellentesque sed malesuada justo nec nec. Sem justo dolor mattis porta Quisque.</p> <p>Interdum ut diam convallis Sed hendrerit est augue eget ipsum lacinia. Et at montes Sed est nec arcu cursus congue neque quis. Sagittis nec dictum nibh urna non urna justo consectetuer accumsan pretium. A risus velit ante id Donec nibh eros vitae at amet. Enim et hac Nam mus tellus consequat sapien eros nec sapien. Wisi Integer sapien suscipit tincidunt et tincidunt eu et neque et. Semper nisl et.</p> <p>Justo nunc et Maecenas dictum Vestibulum vel a neque libero non. Hendrerit metus Vestibulum Pellentesque consectetuer augue malesuada Ut Vestibulum Vestibulum scelerisque. Elit tellus enim purus nascetur Cum condimentum est vitae pellentesque pellentesque. Nisl pretium vel dolor Integer et pharetra elit nulla et nonummy. Phasellus tempus malesuada cursus ipsum urna consectetuer ut quis condimentum consequat. Parturient pretium convallis accumsan.</p> <p>Turpis vitae turpis lorem dignissim quis lorem rutrum pede mus justo. Morbi dictumst interdum ut dui elit faucibus ac tempor eget a. Pede penatibus urna mus id pellentesque commodo amet porta risus pede. Sapien semper congue nibh sit tortor enim nibh amet quis in. Vivamus condimentum egestas dictumst vel auctor ut Aenean malesuada mattis convallis. Ipsum Pellentesque libero Nullam Donec nec at enim faucibus sit orci. </p> </div> <div>' . Get::img(Get::rel_path('base') . '/mycourses.jpg', false, false, false, true) . '</div> <div>' . Get::img(Get::rel_path('base') . '/mycourses.jpg', false, false, false, true) . '</div> <div>' . Get::img(Get::rel_path('base') . '/calendar.jpg', false, false, false, true) . '</div> </div>', 'content'); cout('</div>', 'content'); cout('' . '<script type="text/javascript">' . "\n" . '</script>' . "\n", 'scripts'); break; default: YuiLib::load(); //cout('<div class="area_block">PROVA ALBERO</div>', 'content'); cout('<div style="margin: 2em">', 'content'); cout('<div id="course_tag" class="yui-navset">', 'content'); cout('<style> .subcatbox { margin-bottom: 20px; font-size: 86%; } .subcatbox dt { font-weight: bold; font-size: 108%; margin-bottom: 4px; } .subcatbox dd { margin-left: 10px; margin-bottom: 4px; } </style>', 'page_head'); cout(' <ul class="yui-nav"> <li><a href="#tab1"><em>Corsi</em></a></li> <li class="selected"><a href="#tab2"><em>Documenti e multimedia</em></a></li> <li><a href="#tab3"><em>Videconferenze</em></a></li> </ul> <div class="yui-content yui-nopadding"> <div> <div class="subtab_list"> <ul class=""> <li class="selected"><a href="#tab1"><em>In itinere</em></a></li> <li><a href="#tab1"><em>Completati</em></a></li> <li><a href="#tab1"><em>Inviti</em></a></li> <li><a href="#"><em>Nuovi</em></a></li> <li><a href="#"><em>Consigliati</em></a></li> <li><a href="#"><em>Tutti</em></a></li> <li><a href="#"><em>Calendario</em></a></li> </ul> </div> ' . Get::img(Get::rel_path('base') . '/mycourses.jpg', false, false, false, true) . ' </div> <div> <div class="subtab_list"> <ul class=""> <li class="selected"><a href="#tab1"><em>Ricerca</em></a></li> <li><a href="#tab1"><em>Gestione</em></a></li> </ul> </div> <br /> <br /> <div style="text-align: center; position:relative;"> <input type="text" size="40" id="c_filter" name="c_filter" value="Cerca ..." class="" maxlength="255" alt="Cerca" onclick="this.value=\'\';" /><input type="submit" id="c_filter" name="c_filter" value="Cerca" class="search_b" maxlength="255" alt="Cerca" /> <br/><br/> <input type="radio" name="searchin" value="2" checked="checked" /> Nei documenti e nei corsi <input type="radio" name="searchin" value="0" /> Nei documenti <input type="radio" name="searchin" value="1" /> Nei corsi </div> <br /> <br /> <br /> <div class="yui-gb" style="margin: 0 22px"> <div class="yui-u first"> <!-- sample code from ciao.it--> <dl class="subcatbox"><dt> <a href="http://www.ciao.it/Portatili_206481_2" id="Node_Category_197256" class="hdl">Portatili</a></dt><dd> <a href="http://www.ciao.it/Portatili_206481_2-apple" class="subnr">Portatili Apple</a> <span class="subnr">(104)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-sony" class="subnr">Portatili Sony</a> <span class="subnr">(383)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-dell" class="subnr">Portatili Dell</a> <span class="subnr">(81)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-fujitsu_siemens" class="subnr">Portatili Fujitsu-Siemens</a> <span class="subnr">(400)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-hp" class="subnr">Portatili HP</a> <span class="subnr">(799)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-asus" class="subnr">Portatili Asus</a> <span class="subnr">(663)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-acer" class="subnr">Portatili Acer</a> <span class="subnr">(713)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-toshiba" class="subnr">Portatili Toshiba</a> <span class="subnr">(737)</span></dd><dd> <a href="http://www.ciao.it/Portatili_206481_2-samsung" class="subnr">Portatili Samsung</a> <span class="subnr">(43)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/PC_178183_2" id="Node_Category_168457" class="hdl">PC</a></dt><dd> <a href="http://www.ciao.it/PC_178183_2-hp" class="subnr">PC HP</a> <span class="subnr">(1643)</span></dd><dd> <a href="http://www.ciao.it/PC_178183_2-acer" class="subnr">PC Acer</a> <span class="subnr">(649)</span></dd><dd> <a href="http://www.ciao.it/PC_178183_2-packard_bell" class="subnr">PC Packard Bell</a> <span class="subnr">(864)</span></dd><dd> <a href="http://www.ciao.it/PC_178183_2-apple" class="subnr">PC Apple</a> <span class="subnr">(227)</span></dd><dd> <a href="http://www.ciao.it/PC_178183_2-olidata" class="subnr">PC Olidata</a> <span class="subnr">(574)</span></dd><dd> <a href="http://www.ciao.it/PC_178183_2-compaq" class="subnr">PC Compaq</a> <span class="subnr">(627)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Stampanti_178158_2" id="Node_Category_168459" class="hdl">Stampanti</a></dt><dd> <a href="http://www.ciao.it/Stampanti_178158_2-hp" class="subnr">Stampanti HP</a> <span class="subnr">(55)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_178158_2-epson" class="subnr">Stampanti Espson</a> <span class="subnr">(466)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_178158_2-lexmark_international" class="subnr">Stampanti Lexmark</a> <span class="subnr">(301)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_178158_2-canon" class="subnr">Stampanti Canon</a> <span class="subnr">(239)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_178158_2-brother" class="subnr">Stampanti Brother</a> <span class="subnr">(99)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_178158_2-xerox" class="subnr">Stampanti Xerox</a> <span class="subnr">(182)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2" id="Node_Category_196265" class="hdl">Stampanti Multifunzione</a></dt><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-xerox" class="subnr">Stampanti Multifunzione Xerox</a> <span class="subnr">(340)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-canon" class="subnr">Stampanti Multifunzione Canon</a> <span class="subnr">(182)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-brother" class="subnr">Stampanti Multifunzione Brother</a> <span class="subnr">(138)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-lexmark_international" class="subnr">Stampanti Multifunzione Lexmark</a> <span class="subnr">(97)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-epson" class="subnr">Stampanti Multifunzione Epson</a> <span class="subnr">(76)</span></dd><dd> <a href="http://www.ciao.it/Stampanti_Multifunzione_205569_2-samsung" class="subnr">Stampanti Multifunzione Samsung</a> <span class="subnr">(59)</span></dd></dl> <!-- end of sample code from ciao.it--> </div> <div class="yui-u"> <!-- sample code from ciao.it--> <dl class="subcatbox"><dt> <a href="http://www.ciao.it/Componenti_Hardware_178057_2" id="Node_Category_168463" class="hdl">Componenti Hardware</a></dt><dd> <a href="http://www.ciao.it/Schede_Madri_205459_3" class="subnr">Schede Madri</a> <span class="subnr">(1877)</span></dd><dd> <a href="http://www.ciao.it/Hard_Disk_178068_3" class="subnr">Hard Disk</a> <span class="subnr">(3568)</span></dd><dd> <a href="http://www.ciao.it/Drive_178061_3" class="subnr">Drive</a> <span class="subnr">(158)</span></dd><dd> <a href="http://www.ciao.it/Floppy_178067_3" class="subnr">Floppy</a> <span class="subnr">(169)</span></dd><dd> <a href="http://www.ciao.it/Alimentatori_178074_3" class="subnr">Alimentatori</a> <span class="subnr">(3207)</span></dd><dd> <a href="http://www.ciao.it/Componenti_Hardware_178057_2" id="Node_Category_More_168463" class="hdl">continua</a> </dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Monitor_LCD_178159_2" id="Node_Category_168460" class="hdl">Monitor LCD</a></dt><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-samsung" class="subnr">Monitor Samsung</a> <span class="subnr">(394)</span></dd><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-lg" class="subnr">Monitor LG</a> <span class="subnr">(315)</span></dd><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-sony" class="subnr">Monitor Sony</a> <span class="subnr">(181)</span></dd><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-philips" class="subnr">Monitor Philips</a> <span class="subnr">(275)</span></dd><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-acer" class="subnr">Monitor Acer</a> <span class="subnr">(323)</span></dd><dd> <a href="http://www.ciao.it/Monitor_LCD_178159_2-hp" class="subnr">Monitor HP</a> <span class="subnr">(127)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Monitor_CRT_206455_2" id="Node_Category_197225" class="hdl">Monitor CRT</a></dt><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-philips" class="subnr">Monitor CRT Philips</a> <span class="subnr">(120)</span></dd><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-hp" class="subnr">Monitor CRT HP</a> <span class="subnr">(41)</span></dd><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-samsung" class="subnr">Monitor CRT Samsung</a> <span class="subnr">(80)</span></dd><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-ibm" class="subnr">Monitor CRT IBM</a> <span class="subnr">(67)</span></dd><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-compaq" class="subnr">Monitor CRT Compaq</a> <span class="subnr">(61)</span></dd><dd> <a href="http://www.ciao.it/Monitor_CRT_206455_2-nec" class="subnr">Monitor CRT NEC</a> <span class="subnr">(64)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Processori_206294_2" id="Node_Category_197039" class="hdl">Processori</a></dt><dd> <a href="http://www.ciao.it/Processori_206294_2-hewlett_packard" class="subnr">Processori HP</a> <span class="subnr">(379)</span></dd><dd> <a href="http://www.ciao.it/Processori_206294_2-intel" class="subnr">Processori Intel</a> <span class="subnr">(311)</span></dd><dd> <a href="http://www.ciao.it/Processori_206294_2-ibm" class="subnr">Processori IBM</a> <span class="subnr">(141)</span></dd><dd> <a href="http://www.ciao.it/Processori_206294_2-fujitsu_siemens_computers" class="subnr">Processori Fujitsu Siemens</a> <span class="subnr">(43)</span></dd><dd> <a href="http://www.ciao.it/Processori_206294_2-compaq" class="subnr">Processori Compaq</a> <span class="subnr">(14)</span></dd><dd> <a href="http://www.ciao.it/Processori_206294_2-acer" class="subnr">Processori Acer</a> <span class="subnr">(24)</span></dd></dl> <!-- end of sample code from ciao.it--> </div> <div class="yui-u"> <!-- sample code from ciao.it--> <dl class="subcatbox"><dt> <a href="http://www.ciao.it/Componenti_di_Rete_178049_2" id="Node_Category_168462" class="hdl">Componenti di Rete</a></dt><dd> <a href="http://www.ciao.it/Modem_178051_3" class="subnr">Modem</a> <span class="subnr">(1428)</span></dd><dd> <a href="http://www.ciao.it/Schede_di_Rete_178050_3" class="subnr">Schede di Rete</a> <span class="subnr">(3191)</span></dd><dd> <a href="http://www.ciao.it/Router_e_Bridge_178053_3" class="subnr">Router e Bridge</a> <span class="subnr">(1176)</span></dd><dd> <a href="http://www.ciao.it/Hub_e_Switch_178052_3" class="subnr">Hub e Switch</a> <span class="subnr">(2739)</span></dd><dd> <a href="http://www.ciao.it/Dispositivi_di_Rete_205570_3" class="subnr">Dispositivi di Rete</a> <span class="subnr">(1791)</span></dd><dd> <a href="http://www.ciao.it/Componenti_di_Rete_178049_2" id="Node_Category_More_168462" class="hdl">continua</a></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2" id="Node_Category_197255" class="hdl">Palmari & Smartphone</a></dt><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-htc" class="subnr">Palmari HTC</a> <span class="subnr">(26)</span></dd><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-nokia" class="subnr">Palmari Nokia</a> <span class="subnr">(22)</span></dd><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-hp" class="subnr">Palmari HP</a> <span class="subnr">(85)</span></dd><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-i_mate" class="subnr">Palmari i-mate</a> <span class="subnr">(19)</span></dd><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-samsung" class="subnr">Palmari Samsung</a> <span class="subnr">(10)</span></dd><dd> <a href="http://www.ciao.it/Palmari_Smartphone_206480_2-palm" class="subnr">Palmari Palm</a> <span class="subnr">(89)</span></dd></dl> <dd> <a href="http://www.ciao.it/Mouse_178035_3" class="subnr">Mouse</a> <span class="subnr">(3589)</span></dd><dd> <a href="http://www.ciao.it/Tastiere_178036_3" class="subnr">Tastiere</a> <span class="subnr">(2826)</span></dd><dd> <a href="http://www.ciao.it/Scanner_178040_3" class="subnr">Scanner</a> <span class="subnr">(879)</span></dd><dd> <a href="http://www.ciao.it/Webcam_206484_3" class="subnr">Webcam</a> <span class="subnr">(578)</span></dd><dd> <a href="http://www.ciao.it/USB_Flash_Drive_205463_3" class="subnr">USB Flash Drive</a> <span class="subnr">(1086)</span></dd><dd> <a href="http://www.ciao.it/Periferiche_178035_2" id="Node_Category_More_168461" class="hdl">continua</a></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Storage_Media_178080_2" id="Node_Category_168465" class="hdl">Storage Media</a></dt><dd> <a href="http://www.ciao.it/CD_Registrabili_178080_3" class="subnr">CD Registrabili</a> <span class="subnr">(2340)</span></dd><dd> <a href="http://www.ciao.it/DVD_Registrabili_178081_3" class="subnr">DVD Registrabili</a> <span class="subnr">(2490)</span></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Accessori_178161_2" id="Node_Category_168466" class="hdl">Accessori</a></dt><dd> <a href="http://www.ciao.it/Supporti_Cartacei_per_Stampanti_205643_3" class="subnr">Supporti Cartacei per Stampanti</a> <span class="subnr">(1891)</span></dd><dd> <a href="http://www.ciao.it/Accessori_per_Stampanti_205472_3" class="subnr">Accessori per Stampanti</a> <span class="subnr">(20111)</span></dd><dd> <a href="http://www.ciao.it/Cartucce_per_Stampanti_e_Toner_206282_3" class="subnr">Cartucce per Stampanti e Toner</a></dd><dd> <a href="http://www.ciao.it/Accessori_per_Portatili_197962_3" class="subnr">Accessori per Portatili</a> <span class="subnr">(42)</span></dd><dd> <a href="http://www.ciao.it/Accessori_per_Palmari_178161_3" class="subnr">Accessori per Palmari</a> <span class="subnr">(41)</span></dd><dd> <a href="http://www.ciao.it/Accessori_178161_2" id="Node_Category_More_168466" class="hdl">continua</a></dd></dl><dl class="subcatbox"><dt> <a href="http://www.ciao.it/Servizi_e_Consigli_178181_2" id="Node_Category_168467" class="hdl">Servizi e Consigli</a></dt></dl> <!-- end of sample code from ciao.it--> </div> </div> </div> <div> <div class="subtab_list"> <ul class=""> <li><a href="#tab1"><em>Attive ora</em></a></li> <li><a href="#tab1"><em>Programmate</em></a></li> <li class="selected"><a href="#tab1"><em>Calendario</em></a></li> </ul> </div> ' . Get::img(Get::rel_path('base') . '/calendar.jpg', false, false, false, true) . ' </div> ', 'content'); cout('</div>', 'content'); cout('</div>', 'content'); cout('' . '<script type="text/javascript">' . "\n" . "\tvar myTabs = new YAHOO.widget.TabView('course_tag'); " . "\n" . '</script>' . "\n", 'scripts'); /* cout('<script type="text/javascript"> var temp; YAHOO.util.Event.onDOMReady(function(e) { var oConfig = { dragdrop: false, initNodes: '.$nodes.', ajax_url: "ajax.adm_server.php?plf=framework&file=category_tree&sf=folder_tree'.'" }; temp = new FolderTree("tree", oConfig); }); </script>', 'page_head'); cout('<div class="area_block">PROVA ALBERO</div>', 'content'); cout('<div class="std_block">', 'content'); cout('<div style="border:solid 1px" class="folder_tree">', 'content'); cout('<div id="tree"></div>', 'content'); cout('</div>', 'content'); cout('<br /><br />DEBUG: <button onclick="alert(temp.getCurrentSelection());">SELEZIONE</button>', 'content'); cout('</div>', 'content'); require_once(_lms_.'/lib/folder_tree/class.category_tree.php'); $tree = new CategoryTree('categorytree'); $tree->initLibraries(); $tree->useDOMready = true; $temp = $tree->get(); cout($temp['js'], 'page_head'); cout('<div class="area_block">PROVA ALBERO</div>', 'content'); cout('<div class="std_block">', 'content'); cout('<div style="border:solid 1px" class="folder_tree">', 'content'); cout($temp['html'], 'content'); cout('</div>', 'content'); cout('<br /><br />DEBUG: <button onclick="alert(temp.getCurrentSelection());">SELEZIONE</button>', 'content'); cout('</div>', 'content'); */ break; } }
public function getcourselist() { //Datatable info $start_index = Get::req('startIndex', DOTY_INT, 0); $results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25)); $sort = Get::req('sort', DOTY_MIXED, 'userid'); $dir = Get::req('dir', DOTY_MIXED, 'asc'); $id_category = Get::req('node_id', DOTY_INT, (int) $this->_getSessionTreeData('id_category', 0)); $filter_text = $_SESSION['course_filter']['text']; $classroom = $_SESSION['course_filter']['classroom']; $descendants = $_SESSION['course_filter']['descendants']; $waiting = $_SESSION['course_filter']['waiting']; $filter_open = false; if ($descendants || $waiting) { $filter_open = true; } $filter = array('id_category' => $id_category, 'classroom' => $classroom, 'descendants' => $descendants, 'waiting' => $waiting, 'text' => $filter_text, 'open' => $filter_open); $total_course = $this->model->getCourseNumber($filter); if ($start_index >= $total_course) { if ($total_course < $results) { $start_index = 0; } else { $start_index = $total_course - $results; } } $course_res = $this->model->loadCourse($start_index, $results, $sort, $dir, $filter); $course_with_cert = $this->model->getCourseWithCertificate(); $course_with_competence = $this->model->getCourseWithCompetence(); $list = array(); while ($row = sql_fetch_assoc($course_res)) { $course_type = 'elearning'; switch ($row['course_type']) { case 'classroom': $course_type = 'classroom'; case 'elearning': if ($row['course_edition'] > 0) { $course_type = 'edition'; } } $num_subscribed = $row['subscriptions'] - $row['pending']; $list[$row['idCourse']] = array('id' => $row['idCourse'], 'code' => $row['code'], 'name' => $row['name'], 'type' => Lang::t('_' . strtoupper($row['course_type'])), 'type_id' => $course_type, 'wait' => $row['course_edition'] != 1 && $row['pending'] != 0 ? '<a href="index.php?r=' . $this->base_link_subscription . '/waitinguser&id_course=' . $row['idCourse'] . '" title="' . Lang::t('_WAITING', 'course') . '">' . $row['pending'] . '</a>' : '', 'user' => $row['course_type'] !== 'classroom' && $row['course_edition'] != 1 ? '<a class="nounder" href="index.php?r=' . $this->base_link_subscription . '/show&id_course=' . $row['idCourse'] . '" title="' . Lang::t('_SUBSCRIPTION', 'course') . '">' . $num_subscribed . ' ' . Get::img('standard/moduser.png', Lang::t('_SUBSCRIPTION', 'course')) . '</a>' : '', 'edition' => $row['course_type'] === 'classroom' ? '<a href="index.php?r=' . $this->base_link_classroom . '/classroom&id_course=' . $row['idCourse'] . '" title="' . Lang::t('_CLASSROOM_EDITION', 'course') . '">' . $this->model->classroom_man->getDateNumber($row['idCourse'], true) . '</a>' : ($row['course_edition'] == 1 ? '<a href="index.php?r=' . $this->base_link_edition . '/show&id_course=' . $row['idCourse'] . '" title="' . Lang::t('_EDITIONS', 'course') . '">' . $this->model->edition_man->getEditionNumber($row['idCourse']) . '</a>' : ''), 'certificate' => '<a href="index.php?r=' . $this->base_link_course . '/certificate&id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_pdf' . (!isset($course_with_cert[$row['idCourse']]) ? '_grey' : ''), Lang::t('_CERTIFICATE_ASSIGN_STATUS', 'course')) . '</a>', 'competences' => '<a href="index.php?r=' . $this->base_link_competence . '/man_course&id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_competence' . (!isset($course_with_competence[$row['idCourse']]) ? '_grey' : ''), Lang::t('_COMPETENCES', 'course')) . '</a>', 'menu' => '<a href="index.php?r=' . $this->base_link_course . '/menu&id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_menu', Lang::t('_ASSIGN_MENU', 'course')) . '</a>', 'dup' => 'ajax.adm_server.php?r=' . $this->base_link_course . '/dupcourse&id_course=' . $row['idCourse'], 'mod' => '<a href="index.php?r=' . $this->base_link_course . '/modcourse&id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_mod', Lang::t('_MOD', 'standard')) . '</a>', 'del' => 'ajax.adm_server.php?r=' . $this->base_link_course . '/delcourse&id_course=' . $row['idCourse'] . '&confirm=1'); } if (!empty($list)) { $id_list = array_keys($list); $count_students = $this->model->getCoursesStudentsNumber($id_list); foreach ($list as $id_course => $cinfo) { $list[$id_course]['students'] = isset($count_students[$id_course]) ? $count_students[$id_course] : ''; } } $result = array('totalRecords' => $total_course, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($list), 'records' => array_values($list)); echo $this->json->encode($result); }
echo $course['idCourse']; ?> "<?php echo $course['direct_play'] == 1 && $course['level'] <= 3 && $course['first_lo_type'] == 'scormorg' ? ' rel="lightbox"' : ''; ?> > <?php echo $course['lang_code'] != 'none' ? Get::img('language/' . strtolower($course['lang_code']) . '.png', $course['lang_code']) : ''; ?> <?php echo $keyword != "" ? Layout::highlight($course['name'], $keyword) : $course['name']; ?> </a> <?php } else { echo Get::img('standard/locked.png', Lang::t('_' . strtoupper($course['can_enter']['reason']), 'standard')); echo ' ' . ($keyword != "" ? Layout::highlight($course['name'], $keyword) : $course['name']); } ?> </h2> <p class="course_support_info"> <?php echo Lang::t($this->ustatus[$course['user_status']], 'course') . '' . Lang::t('_USER_LVL', 'course', array('[level]' => '<b>' . $this->levels[$course['level']] . '</b>')); ?> </p> <?php $acl_man = Docebo::user()->getAclManager(); $levels = CourseLevel::getLevels(); while (list($num_lv, $name_level) = each($levels)) { if (CourseLevel::isTeacher($num_lv)) { }
function create() { checkPerm('mod'); require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $id_certificate = importVar('id_certificate', true, 0); $id_meta = array(); $acl_man =& Docebo::user()->getAclManager(); $first = true; $tot_element = 0; $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $tb = new Table(Get::sett('visuItem'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION')); $tb->initNavBar('ini', 'button'); $ini = $tb->getSelectedElement(); $query = "SELECT idMetaCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta" . " WHERE idCertificate = '" . $id_certificate . "'"; $result = sql_query($query); while (list($id_meta_temp) = sql_fetch_row($result)) { $id_meta[] = $id_meta_temp; } $query = "SELECT idCourse, idUser" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE status = '" . _CUS_END . "'"; $result = sql_query($query); $user_course_completed = array(); while (list($id_course_t, $id_user_t) = sql_fetch_row($result)) { $user_course_completed[$id_user_t][$id_course_t] = $id_course_t; } $query = "SELECT idMetaCertificate, title" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta"; $result = sql_query($query); $array_title = array(); while (list($id_meta_t, $title_t) = sql_fetch_row($result)) { $array_title[$id_meta_t] = $title_t; } $query = "SELECT idUser, idMetaCertificate, COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " GROUP BY idUser, idMetaCertificate"; $result = sql_query($query); $array_control = array(); while (list($id_user_t, $id_meta_t, $control_t) = sql_fetch_row($result)) { $array_control[$id_user_t][$id_meta_t] = $control_t; } if (isset($_POST['undo_filter_create'])) { unset($_POST['filter_username']); unset($_POST['filter_firstname']); unset($_POST['filter_lastname']); unset($_POST['filter_release_status']); } $query = "SELECT m.idUser, u.lastname, u.firstname, u.userid" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as m" . " JOIN " . $GLOBALS['prefix_fw'] . "_user as u ON u.idst = m.idUser" . " WHERE m.idMetaCertificate IN (" . implode(',', $id_meta) . ")" . (isset($_POST['filter_username']) ? "AND u.userid LIKE '%" . $_POST['filter_username'] . "%'" : '') . (isset($_POST['filter_firstname']) ? "AND u.firstname LIKE '%" . $_POST['filter_firstname'] . "%'" : '') . (isset($_POST['filter_lastname']) ? "AND u.lastname LIKE '%" . $_POST['filter_lastname'] . "%'" : '') . " GROUP BY m.idUser, u.lastname, u.firstname, u.userid" . " ORDER BY u.lastname, u.firstname, u.userid"; $result = sql_query($query); while (list($id_user, $lastname, $firstname, $userid) = sql_fetch_row($result)) { foreach ($id_meta as $idmeta) { if (isset($array_control[$id_user][$idmeta]) && $array_control[$id_user][$idmeta]) { $title = strip_tags($array_title[$idmeta]); $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $idmeta . "'"; $result_int = sql_query($query); $control = true; while (list($id_course) = sql_fetch_row($result_int)) { if (!isset($user_course_completed[$id_user][$id_course])) { $control = false; } } if ($control) { $tot_element++; if ($tot_element > $ini && $tot_element <= $ini + Get::sett('visuItem')) { list($is_released) = sql_fetch_row(sql_query("SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $idmeta . "'")); if (!isset($_POST['filter_release_status']) || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == 0 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '1' && $is_released == 1 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '2' && $is_released == 0) { if ($first) { $first = false; $type_h = array('', '', '', 'image', 'image', 'image'); $cont_h = array($lang->def('_FULLNAME'), $lang->def('_USERNAME'), $lang->def('_TITLE'), Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate')), Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate')), '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" />'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); } $cont = array(); $cont[] = $lastname . ' ' . $firstname; $cont[] = $acl_man->relativeId($userid); $cont[] = $title; $cont[] = '<a href="index.php?modname=meta_certificate&op=preview_cert&id_certificate=' . $id_certificate . '&idmeta=' . $idmeta . '&iduser='******'">' . Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate') . ' : ' . strip_tags($title)) . '</a>'; $cont[] = '<a href="index.php?modname=meta_certificate&op=release_cert&id_certificate=' . $id_certificate . '&idmeta=' . $idmeta . '&iduser='******'">' . Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate') . ' : ' . strip_tags($title)) . '</a>'; if ($is_released) { $cont[] = '<a href="index.php?modname=meta_certificate&op=del_released&id_certificate=' . $id_certificate . '&idmeta=' . $idmeta . '&iduser='******'">' . '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" /></a>'; } else { $cont[] = ''; } $tb->addBody($cont); } } } } } } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=del_released]'); $array_release_status = array($lang->def('_ALL') => '0', $lang->def('_ONLY_RELEASED') => '1', $lang->def('_ONLY_NOT_RELEASED') => '2'); if ($first) { $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_CREATE'), 'certificate') . '<div class="std_block">'); if (isset($_POST['filter'])) { $out->add(Form::openForm('meta_certificate_filter', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate) . Form::openElementSpace() . Form::getTextfield($lang->def('_USERNAME'), 'filter_username', 'filter_username', '255', isset($_POST['filter_username']) ? $_POST['filter_username'] : '') . Form::getTextfield($lang->def('_FIRSTNAME'), 'filter_firstname', 'filter_firstname', '255', isset($_POST['filter_firstname']) ? $_POST['filter_firstname'] : '') . Form::getTextfield($lang->def('_LASTNAME'), 'filter_lastname', 'filter_lastname', '255', isset($_POST['filter_lastname']) ? $_POST['filter_lastname'] : '') . Form::getRadioSet($lang->def('_RELEASE_STATUS_FILTER'), 'filter_release_status', 'filter_release_status', $array_release_status, isset($_POST['filter_release_status']) ? $_POST['filter_release_status'] : '0') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('undo_filter_create', 'undo_filter_create', $lang->def('_UNDO_FILTER')) . Form::closeButtonSpace() . Form::closeForm()); } $out->add($lang->def('_NO_USER_FOUND') . getBackUi('index.php?modname=meta_certificate&op=meta_certificate', $lang->def('_BACK')) . '</div>'); } else { $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_CREATE'), 'certificate') . '<div class="std_block">'); if (isset($_GET['result'])) { switch ($_GET['result']) { case "ok": $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); break; case "err_del_cert": $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; } } $out->add(Form::openForm('meta_certificate_filter', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate) . Form::openElementSpace() . Form::getTextfield($lang->def('_USERNAME'), 'filter_username', 'filter_username', '255', isset($_POST['filter_username']) ? $_POST['filter_username'] : '') . Form::getTextfield($lang->def('_FIRSTNAME'), 'filter_firstname', 'filter_firstname', '255', isset($_POST['filter_firstname']) ? $_POST['filter_firstname'] : '') . Form::getTextfield($lang->def('_LASTNAME'), 'filter_lastname', 'filter_lastname', '255', isset($_POST['filter_lastname']) ? $_POST['filter_lastname'] : '') . Form::getRadioSet($lang->def('_RELEASE_STATUS_FILTER'), 'filter_release_status', 'filter_release_status', $array_release_status, isset($_POST['filter_release_status']) ? $_POST['filter_release_status'] : '0') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('undo_filter_create', 'undo_filter_create', $lang->def('_UNDO_FILTER')) . Form::closeButtonSpace() . $tb->getTable() . $tb->getNavBar($ini, $tot_element) . Form::closeForm() . getBackUi('index.php?modname=meta_certificate&op=meta_certificate', $lang->def('_BACK')) . '</div>'); } }
<?php require_once _lms_ . '/lib/lib.stats.php'; $first = true; foreach ($user_coursepath as $id_path => $path_info) { echo '<div class="coursepath_container">' . '<h2>' . $path_info['path_name'] . '</h2>' . '<div class="yui-ge">' . '<div class="yui-u first coursepath_description"><div class="textof">' . $path_info['path_descr'] . '</div></div>' . '<div class="yui-u">' . '<div class="yui-ge percentage_cont">' . '<div class="yui-u first">' . Lang::t('_COMPLETED', 'standard') . ':<br /><br />' . renderCoursepathProgress($path_info['course_completed'], $path_info['coursepath_courses']) . '</div>' . '<div class="yui-u">' . '<br /><br /> <span class="coursepath_percentage">' . $path_info['percentage'] . ' %</span>' . '</div>' . '</div>' . '</div>' . '</div>' . '<div id="courses_link_' . $type . '_' . $id_path . '" class="coursepath_action">' . '<a class="no_decoration" href="javascript:;" onclick="expandCourses(\'' . $id_path . '\',\'' . $type . '\');">' . '<span class="expand_path_info">' . Lang::t('_EXPAND', 'coursepath') . '</span> ' . Get::img('course/expand.png', Lang::t('_EXPAND', 'course')) . '</a>' . '</div>'; foreach ($coursepath_courses[$id_path] as $id_course => $course_info) { //Control coursepath prerequisite $query = "SELECT cc.prerequisites" . " FROM %lms_coursepath_courses AS cc" . " JOIN %lms_coursepath_user AS cu ON cc.id_path = cu.id_path" . " WHERE cu.idUser = "******" AND cc.id_item = " . (int) $id_course; $result = sql_query($query); $unlock = true; while (list($prerequisites) = sql_fetch_row($result)) { if ($prerequisites !== '') { $num_prerequisites = count(explode(',', $prerequisites)); $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse IN (" . $prerequisites . ") AND idUser = "******" " . " AND status = " . _CUS_END; list($control) = sql_fetch_row(sql_query($query)); if ($control < $num_prerequisites) { $unlock = false; } } } if ($course_info['status'] != _CUS_END && $unlock) { $query_control_info = "SELECT c.idCourse, c.course_type, c.idCategory, c.code, c.name, c.description, c.difficult, c.status AS course_status, c.course_edition, " . "\tc.max_num_subscribe, c.create_date, " . "\tc.direct_play, c.img_othermaterial, c.course_demo, c.use_logo_in_courselist, c.img_course, c.lang_code, " . "\tc.course_vote, " . "\tc.date_begin, c.date_end, c.valid_time, c.show_result, c.userStatusOp," . "\tcu.status AS user_status, cu.level, cu.date_inscr, cu.date_first_access, cu.date_complete, cu.waiting" . " FROM %lms_course AS c " . " JOIN %lms_courseuser AS cu ON (c.idCourse = cu.idCourse) " . " WHERE c.idCourse = " . $id_course . " AND idUser = "******"coursepath_action"><span class="expand_path_info"> | ' . Lang::t('_CURRENT_ACTIVITY', 'coursepath') . ' : </span>' . ($course_access['can'] ? '<a class="std_link" href="index.php?modname=course&op=aula&idCourse=' . $course_info['idCourse'] . '">' : '') . $course_info['name'] . ($course_access['can'] ? '</a>' : '') . '</div>'; break; } } reset($coursepath_courses[$id_path]); echo '<div id="courses_' . $id_path . '" style="display:none;clear:both;" class="coursepath_details">';
public function getCourseList($type = '', $page = 1) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt()); switch ($type) { case 'elearning': $filter = " AND course_type = '" . $type . "'"; $base_link = 'index.php?r=catalog/elearningCourse&page=' . $page; if (count($user_catalogue) > 0) { $courses = array(); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat); $courses = array_merge($courses, $catalogue_course); } $filter .= " AND idCourse IN (" . implode(',', $courses) . ")"; } break; case 'classroom': $filter = " AND course_type = '" . $type . "'"; $base_link = 'index.php?r=catalog/classroomCourse&page=' . $page; if (count($user_catalogue) > 0) { $courses = array(); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat); $courses = array_merge($courses, $catalogue_course); } $filter .= " AND idCourse IN (" . implode(',', $courses) . ")"; } break; case 'new': $filter = " AND create_date >= '" . date('Y-m-d', mktime(0, 0, 0, date('m'), (int) date('d') - 7, date('Y'))) . "'"; $base_link = 'index.php?r=catalog/newCourse&page=' . $page; if (count($user_catalogue) > 0) { $courses = array(); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat); $courses = array_merge($courses, $catalogue_course); } $filter .= " AND idCourse IN (" . implode(',', $courses) . ")"; } break; case 'catalogue': $id_catalogue = Get::req('id_cata', DOTY_INT, '0'); $base_link = 'index.php?r=catalog/catalogueCourse&id_cat=' . $id_catalogue . '&page=' . $page; $catalogue_course =& $cat_man->getCatalogueCourse($id_catalogue); $filter = " AND idCourse IN (" . implode(',', $catalogue_course) . ")"; break; default: $filter = ''; $base_link = 'index.php?r=catalog/allCourse&page=' . $page; if (count($user_catalogue) > 0) { $courses = array(); foreach ($user_catalogue as $id_cat) { $catalogue_course =& $cat_man->getCatalogueCourse($id_cat); $courses = array_merge($courses, $catalogue_course); } $filter .= " AND idCourse IN (" . implode(',', $courses) . ")"; } break; } if (count($user_catalogue) == 0 && Get::sett('on_catalogue_empty', 'off') == 'off') { $filter = " AND 0 "; //query won't return any results with this setting } $limit = ($page - 1) * Get::sett('visuItem'); $id_cat = Get::req('id_cat', DOTY_INT, 0); $query = "SELECT *" . " FROM %lms_course" . " WHERE status NOT IN (" . CST_PREPARATION . ", " . CST_CONCLUDED . ", " . CST_CANCELLED . ")" . " AND course_type <> 'assessment'" . " AND ( \n\t\t\t\t\t\t(can_subscribe=2 AND (sub_end_date = '0000-00-00' OR sub_end_date >= '" . date('Y-m-d') . "') AND (sub_start_date = '0000-00-00' OR '" . date('Y-m-d') . "' >= sub_start_date)) OR\n (can_subscribe=1)\n\t\t\t\t\t) " . $filter . ($id_cat > 0 ? " AND idCategory = " . (int) $id_cat : '') . " ORDER BY name" . " LIMIT " . $limit . ", " . Get::sett('visuItem'); $result = sql_query($query); $html = ''; $path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/'; while ($row = sql_fetch_assoc($result)) { $action = ''; if ($row['course_type'] === 'classroom') { $additional_info = ''; $classrooms = $this->classroom_man->getCourseDate($row['idCourse'], false); $action = '<div class="catalog_action" id="action_' . $row['idCourse'] . '">'; if (count($classrooms) == 0) { $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_EDITIONS', 'catalogue') . '</p>'; } else { //Controllo che l'utente non sia iscritto a tutte le edizioni future $date_id = array(); $user_classroom = $this->classroom_man->getUserDates(Docebo::user()->getIdSt()); $classroom_full = $this->classroom_man->getFullDateForCourse($row['idCourse']); $classroom_not_confirmed = $this->classroom_man->getNotConfirmetDateForCourse($row['idCourse']); $overbooking_classroom = $this->classroom_man->getOverbookingDateForCourse($row['idCourse']); foreach ($classrooms as $classroom_info) { $date_id[] = $classroom_info['id_date']; } reset($classrooms); // for all the dates we will remove the one in which the user is subscribed and the classroom not confirmed $control = array_diff($date_id, $user_classroom, $classroom_not_confirmed); if (count($control) == 0) { if (!empty($overbooking_classroom)) { $_text = $row['selling'] == 0 ? Lang::t('_SUBSCRIBE', 'catalogue') : Lang::t('_ADD_TO_CART', 'catalogue'); $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'' . ($row['selling'] == 0 ? '0' : '1') . '\')" ' . ' title="' . $_text . '"><p class="can_subscribe">' . $_text . '<br />' . '(' . Lang::t('_SUBSCRIBE_WITH_OVERBOOKING', 'catalogue') . ': ' . count($overbooking_classroom) . ')</p>' . '</a>'; } else { //$action .= '<p class="cannot_subscribe">'.Lang::t('_NO_EDITIONS', 'catalogue').'</p>'; /* FORMA - INSERITO BOTTONE ENTRA if (count($user_classroom) > 0) { $action .= '<p class="subscribed">'.Lang::t('_USER_STATUS_SUBS', 'catalogue').'</p>'; } else { $action .= '<p class="cannot_subscribe">'.Lang::t('_NO_AVAILABLE_EDITIONS', 'catalogue').'</p>'; } */ if (count($user_classroom) > 0) { $action .= '<a href="index.php?modname=course&op=aula&idCourse=' . $row['idCourse'] . ' "' . ' title="' . $_text . '"><p class="subscribed">' . Lang::t('_USER_STATUS_ENTER', 'catalogue') . '</p>' . '</a>'; } else { $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_AVAILABLE_EDITIONS', 'catalogue') . '</p>'; } } } else { if ($row['selling'] == 0) { switch ($row['subscribe_method']) { case 2: // free $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>'; break; case 1: // moderate $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_COURSE_S_MODERATE', 'catalogue') . '</p></a>'; break; case 0: // only admin $action .= '<p class="cannot_subscribe">' . Lang::t('_COURSE_S_GODADMIN', 'catalogue') . '</p>'; break; } } else { $classroom_in_chart = array(); if (isset($_SESSION['lms_cart'][$row['idCourse']]['classroom'])) { $classroom_in_chart = $_SESSION['lms_cart'][$row['idCourse']]['classroom']; } $control = array_diff($control, $classroom_in_chart); if (count($control) == 0) { $action .= '<p class="subscribed">' . Lang::t('_ALL_EDITION_BUYED', 'catalogue') . '</p>'; } else { $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>'; } } } } $action .= '</div>'; } elseif ($row['course_edition'] == 1) { $additional_info = ''; $editions = $this->edition_man->getEditionAvailableForCourse(Docebo::user()->getIdSt(), $row['idCourse']); $action = '<div class="catalog_action" id="action_' . $row['idCourse'] . '">'; if (count($editions) == 0) { $action .= '<p class="cannot_subscribe">' . Lang::t('_NO_EDITIONS', 'catalogue') . '</p>'; } else { if ($row['selling'] == 0) { $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>'; } else { $edition_in_chart = array(); if (isset($_SESSION['lms_cart'][$row['idCourse']]['editions'])) { $edition_in_chart = $_SESSION['lms_cart'][$row['idCourse']]['editions']; } $editions = array_diff($editions, $edition_in_chart); if (count($editions) == 0) { $action .= '<p class="subscribed">' . Lang::t('_ALL_EDITION_BUYED', 'catalogue') . '</p>'; } else { $action .= '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>'; } } } $action .= '</div>'; } else { // standard elearning course without editions $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = '" . $row['idCourse'] . "'"; list($enrolled) = sql_fetch_row(sql_query($query)); $row['enrolled'] = $enrolled; $row['create_date'] = Format::date($row['create_date'], 'date'); $additional_info = '<p class="course_support_info">' . Lang::t('_COURSE_INTRO', 'course', array('[course_type]' => $row['course_type'], '[create_date]' => $row['create_date'], '[enrolled]' => $row['enrolled'], '[course_status]' => Lang::t($this->cstatus[$row['status']], 'course'))) . '</p>'; $query = "SELECT status, waiting, level" . " FROM %lms_courseuser" . " WHERE idCourse = " . $row['idCourse'] . " AND idUser = "******"catalog_action" id="action_' . $row['idCourse'] . '">'; if (sql_num_rows($result_control) > 0) { // the user is enrolled in some way list($status, $waiting, $level) = sql_fetch_row($result_control); if ($waiting) { $action .= '<p class="subscribed">' . Lang::t('_WAITING', 'catalogue') . '</p>'; } else { // #1995 Grifo multimedia LR $query_lo = "select org.idOrg, org.idCourse, org.objectType from (SELECT o.idOrg, o.idCourse, o.objectType \n \tFROM %lms_organization AS o WHERE o.objectType != '' AND o.idCourse IN (" . $row['idCourse'] . ") ORDER BY o.path) as org \n \tGROUP BY org.idCourse"; $result_lo = sql_query($query_lo); list($id_org, $id_course, $obj_type) = sql_fetch_row($result_lo); $str_rel = ""; if ($obj_type == "scormorg" && $level <= 3 && $row['direct_play'] == 1) { $str_rel = " rel='lightbox'"; } $action .= '<a href="index.php?modname=course&op=aula&idCourse=' . $row['idCourse'] . ' "' . ' title="' . $_text . '" ' . $str_rel . '><p class="subscribed">' . Lang::t('_USER_STATUS_ENTER', 'catalogue') . '</p>' . '</a><br>'; } } else { // course is not enrolled $course_full = false; if ($row['max_num_subscribe'] != 0) { $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = " . $row['idCourse']; list($control) = sql_fetch_row(sql_query($query)); if ($control >= $row['max_num_subscribe']) { // the course have reached the maximum number of subscription $action .= '<p class="cannot_subscribe">' . Lang::t('_MAX_NUM_SUBSCRIBE', 'catalogue') . ' - ' . $row['max_num_subscribe'] . '</p>'; $course_full = true; } } if (!$course_full) { if ($row['selling'] == 0) { switch ($row['subscribe_method']) { case 2: // free $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'0\')" title="' . Lang::t('_SUBSCRIBE', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SUBSCRIBE', 'catalogue') . '</p></a>'; break; case 1: // moderate $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'0\')" title="' . Lang::t('_COURSE_S_MODERATE', 'course') . '"><p class="can_subscribe">' . Lang::t('_COURSE_S_MODERATE', 'catalogue') . '</p></a>'; break; case 0: // only admin $action .= '<p class="cannot_subscribe">' . Lang::t('_COURSE_S_GODADMIN', 'catalogue') . '</p>'; break; } } else { $date_in_chart = array(); if (isset($_SESSION['lms_cart'][$row['idCourse']])) { $action .= '<p class="subscribed">' . Lang::t('_COURSE_IN_CART', 'catalogue') . '</p>'; } else { $action .= '<a href="javascript:;" onclick="subscriptionPopUp(\'' . $row['idCourse'] . '\', \'0\', \'0\', \'1\')" title="' . Lang::t('_ADD_TO_CART', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_ADD_TO_CART', 'catalogue') . '</p></a>'; } } } } $action .= '</div>'; } $html .= '<div class="dash-course">' . ($row['use_logo_in_courselist'] && $row['img_course'] ? '<div class="logo_container"><img class="clogo" src="' . $path_course . $row['img_course'] . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . ($row['use_logo_in_courselist'] && !$row['img_course'] ? '<div class="logo_container"><img class="clogo cnologo" src="' . Get::tmpl_path() . 'images/course/course_nologo.png' . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . '<div class="info_container">' . '<h2>' . ($row['lang_code'] != 'none' ? Get::img('language/' . strtolower($row['lang_code']) . '.png', $row['lang_code']) . ' ' : '') . $row['name'] . '</h2>' . $additional_info . '<p class="course_support_info">' . $row['description'] . '</p>' . '<p class="course_support_info">' . ($row['course_demo'] ? '<a href="index.php?r=catalog/downloadDemoMaterial&course_id=' . $row['idCourse'] . '" class="ico-wt-sprite subs_download"><span>' . Lang::t('_COURSE_DEMO', 'course') . '</span></a>' : '') . '</p>' . '<p class="course_support_info">' . ($row['code'] ? '<i style="font-size:.88em">[' . $row['code'] . ']</i>' : '') . '</p>' . $action . '<div class="nofloat"></div>' . '</div>' . '</div>'; } if (sql_num_rows($result) <= 0) { $html = '<p>' . Lang::t('_NO_CONTENT', 'standard') . '</p>'; } return $html; }
public function getPresenceTable() { $user = $this->classroom_man->getUserForPresence($this->id_date); $day = $this->getDateDay($this->id_date); $test_type = $this->getTestType(); $user_presence = $this->classroom_man->getUserPresenceForDate($this->id_date); $tb = new Table(0, Lang::t('_ATTENDANCE', 'course'), Lang::t('_ATTENDANCE', 'course')); $cont_h = array(Lang::t('_USERNAME', 'course'), Lang::t('_FULLNAME', 'course')); $type_h = array('', ''); foreach ($day as $id_day => $day_info) { $cont_h[] = Format::date($day_info['date_begin'], 'date') . '<br />' . '<a href="javascript:;" onClick="checkAllDay(' . $id_day . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_DAY', 'presence') . '</a>') . ' ' . '<a href="javascript:;" onClick="unCheckAllDay(' . $id_day . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_DAY', 'presence') . '</a>'); $type_h[] = 'img-cell'; } $cont_h[] = ''; $type_h[] = 'img-cell'; if ($test_type == _DATE_TEST_TYPE_PAPER) { $cont_h[] = Lang::t('_SCORE', 'course'); $type_h[] = 'img-cell'; } $cont_h[] = Lang::t('_NOTES', 'course'); $type_h[] = 'img-cell'; $tb->setColsStyle($type_h); $tb->addHead($cont_h); $array_user_id = array(); foreach ($user as $id_user => $user_info) { reset($day); $array_user_id[] = $id_user; $cont = array(); $cont[] = $user_info['userid']; $cont[] = $user_info['lastname'] . ' ' . $user_info['firstname']; foreach ($day as $id_day => $day_info) { if (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 1) { $presence = true; } elseif (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 0) { $presence = false; } else { $presence = false; } $cont[] = Form::getInputCheckbox('date_' . $id_day . '_' . $id_user, 'date_' . $id_day . '_' . $id_user, 1, $presence, false); } $cont[] = '<a href="javascript:;" onClick="checkAllUser(' . $id_user . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_USER', 'presence') . '</a>') . '<br />' . '<a href="javascript:;" onClick="unCheckAllUser(' . $id_user . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_USER', 'presence') . '</a>'); if ($test_type == _DATE_TEST_TYPE_PAPER) { if (isset($user_presence[$id_user]['0000-00-00']) && $user_presence[$id_user]['0000-00-00']['presence'] == 1) { $passed = true; } else { $passed = false; } //$cont[] = Form::getTextfield('', 'score_'.$id_user, 'score_'.$id_user, 255, (isset($user_presence[$id_user]['0000-00-00']['score']) ? $user_presence[$id_user]['0000-00-00']['score'] : '0')); $cont[] = Form::getInputTextfield('', 'score_' . $id_user, 'score_' . $id_user, isset($user_presence[$id_user]['0000-00-00']['score']) ? $user_presence[$id_user]['0000-00-00']['score'] : '0', Lang::t('_SCORE', 'course'), 255, ''); } //$cont[] = Form::getSimpleTextarea('', 'note_'.$id_user, 'note_'.$id_user, (isset($user_presence[$id_user]['0000-00-00']['note']) ? $user_presence[$id_user]['0000-00-00']['note'] : ''), false, false, false, 2); $cont[] = Form::getInputTextarea('note_' . $id_user, 'note_' . $id_user, isset($user_presence[$id_user]['0000-00-00']['note']) ? $user_presence[$id_user]['0000-00-00']['note'] : '', '', 5, 22); $tb->addBody($cont); } return $tb->getTable(); }
public function social_login() { $res = ''; $social = new Social(); if (!$social->enabled()) { // we don't show the box if there is nothing enabled.. return $res; } $res .= '<div id="social_login">'; $res .= Form::openForm('social_form', Get::rel_path('lms') . '/index.php?modname=login&op=social') . '<span>' . Lang::t('_LOGIN_WITH', 'login') . ' </span>'; if ($social->isActive('facebook')) { $res .= '<a href="index.php?modname=login&op=facebook_login">' . Get::img('social/facebook-24.png') . '</a>'; } if ($social->isActive('twitter')) { $res .= '<a href="index.php?modname=login&op=twitter_login">' . Get::img('social/twitter-24.png') . '</a>'; } if ($social->isActive('linkedin')) { $res .= '<a href="index.php?modname=login&op=linkedin_login">' . Get::img('social/linkedin-24.png') . '</a>'; } if ($social->isActive('google')) { $res .= '<a href="index.php?modname=login&op=google_login">' . Get::img('social/google-24.png') . '</a>'; } $res .= Form::closeForm(); $res .= '</div>'; return $res; }
function presence() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; YuiLib::load(); Util::get_js(Get::rel_path('lms') . '/admin/views/classroom/classroom.js', true, true); $id_date = Get::req('id_date', DOTY_INT, 0); $lang =& DoceboLanguage::CreateInstance('admin_date', 'lms'); $date_man = new DateManager(); $user_date = $date_man->getUserDateForCourse(getLogUserId(), $_SESSION['idCourse']); $date_info = $date_man->getDateInfoForPublicPresence($user_date); foreach ($date_info as $info_date) { $date_for_dropdown[$info_date['id_date']] = $info_date['code'] . ' - ' . $info_date['name'] . ' (' . Format::date($info_date['date_begin'], 'date') . ')'; } if ($id_date == 0) { $id_date = isset($date_info[0]['id_date']) ? $date_info[0]['id_date'] : 0; } cout(getTitleArea(Lang::t('_ATTENDANCE')) . '<div class="std_block">', 'content'); if (isset($_POST['save'])) { require_once $GLOBALS['where_lms'] . '/lib/lib.date.php'; $date_man = new DateManager(); $id_date = Get::req('id_date', DOTY_INT, 0); $score_min = Get::req('score_min', DOTY_INT, 0); $user = $date_man->getUserForPresence($id_date); $day = $date_man->getDateDay($id_date); $test_type = $date_man->getTestType($id_date); foreach ($user as $id_user => $user_info) { $user[$id_user]['score'] = Get::req('score_' . $id_user, DOTY_INT, 0); $user[$id_user]['note'] = Get::req('note_' . $id_user, DOTY_MIXED, ''); $user[$id_user]['day_presence'] = array(); for ($i = 0; $i < count($day); $i++) { $user[$id_user]['day_presence'][$day[$i]['id_day']] = Get::req('date_' . $day[$i]['id_day'] . '_' . $id_user, DOTY_INT, 0); } } if ($date_man->insDatePresence($_SESSION['id_course_date'], $id_date, $user, $day, $score_min)) { UIFeedback::info(Lang::t('_ATTENDANCE_SAVED', 'admin_date')); } else { UIFeedback::error(Lang::t('_ATTENDANCE_SAVED_ERROR', 'admin_date')); } } if ($id_date == 0) { cout(Lang::t('_NO_CONTENT', 'admin_date'), 'content'); } else { $user = $date_man->getUserForPresence($id_date); $day = $date_man->getDateDay($id_date); $test_type = $date_man->getTestType($id_date); $user_presence = $date_man->getUserPresenceForDate($id_date); $tb = new Table(0, Lang::t('_ATTENDANCE', 'admin_date'), Lang::t('_ATTENDANCE', 'admin_date')); $cont_h = array(Lang::t('_USERNAME', 'admin_date'), Lang::t('_FULLNAME', 'admin_date')); $type_h = array('', ''); foreach ($day as $id_day => $day_info) { $cont_h[] = Format::date($day_info['date_begin'], 'date') . '<br />' . '<a href="javascript:;" onClick="checkAllDay(' . $id_day . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_DAY', 'presence') . '</a>') . ' ' . '<a href="javascript:;" onClick="unCheckAllDay(' . $id_day . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_DAY', 'presence') . '</a>'); $type_h[] = 'align_center'; } $cont_h[] = ''; $type_h[] = 'img-cell'; if ($test_type == _DATE_TEST_TYPE_PAPER) { $cont_h[] = Lang::t('_SCORE', 'admin_date'); $type_h[] = 'align_center'; } $cont_h[] = Lang::t('_NOTES', 'admin_date'); $type_h[] = 'align_center'; $tb->setColsStyle($type_h); $tb->addHead($cont_h); cout(Form::openForm('presence_form', 'index.php?modname=presence&op=presence') . Form::openElementSpace() . Form::getDropdown(Lang::t('_SELECT_EDITION', 'admin_date'), 'id_date', 'id_date', $date_for_dropdown, $id_date) . Form::closeElementSpace() . Form::openElementSpace() . ($test_type == 1 ? Form::getTextfield(Lang::t('_MIN_SCORE', 'admin_date'), 'score_min', 'score_min', 255, '') : ''), 'content'); $array_user_id = array(); foreach ($user as $id_user => $user_info) { reset($day); $array_user_id[] = $id_user; $cont = array(); $cont[] = $user_info['userid']; $cont[] = $user_info['lastname'] . ' ' . $user_info['firstname']; foreach ($day as $id_day => $day_info) { if (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 1) { $presence = true; } elseif (isset($user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]) && $user_presence[$id_user][substr($day_info['date_begin'], 0, 10)]['presence'] == 0) { $presence = false; } else { $presence = false; } $cont[] = Form::getInputCheckbox('date_' . $id_day . '_' . $id_user, 'date_' . $id_day . '_' . $id_user, 1, $presence, false); } $cont[] = '<a href="javascript:;" onClick="checkAllUser(' . $id_user . ')">' . Get::img('standard/checkall.png', Lang::t('_CHECK_ALL_USER', 'presence') . '</a>') . '<br />' . '<a href="javascript:;" onClick="unCheckAllUser(' . $id_user . ')">' . Get::img('standard/uncheckall.png', Lang::t('_UNCHECK_ALL_USER', 'presence') . '</a>'); if ($test_type == _DATE_TEST_TYPE_PAPER) { if (isset($user_presence[$id_user]['0000-00-00']) && $user_presence[$id_user]['0000-00-00']['presence'] == 1) { $passed = true; } else { $passed = false; } $cont[] = Form::getTextfield('', 'score_' . $id_user, 'score_' . $id_user, 255, isset($user_presence[$id_user]['0000-00-00']['score']) ? $user_presence[$id_user]['0000-00-00']['score'] : '0'); } $cont[] = Form::getSimpleTextarea('', 'note_' . $id_user, 'note_' . $id_user, isset($user_presence[$id_user]['0000-00-00']['note']) ? $user_presence[$id_user]['0000-00-00']['note'] : '', false, false, false, 2); $tb->addBody($cont); } cout($tb->getTable() . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'admin_date')) . Form::closeElementSpace() . Form::closeForm() . '</div>', 'content'); cout('<script type="text/javascript">' . 'var _MIN_SCORE_NOT_SET = "' . Lang::t('_MIN_SCORE_NOT_SET', 'admin_date') . '";' . 'YAHOO.util.Event.addListener("save", "click", controlMinScore);' . 'YAHOO.util.Event.addListener("id_date", "change", formSubmit);' . 'function checkAllDay(id_day) { var days = YAHOO.util.Selector.query(\'input[id*=_\' + id_day + \'_]\'); var i; for(i = 0; i < days.length; i++) days[i].checked = true; } function unCheckAllDay(id_day) { var days = YAHOO.util.Selector.query(\'input[id*=_\' + id_day + \'_]\'); var i; for(i = 0; i < days.length; i++) days[i].checked = false; } function checkAllUser(id_user) { var days = YAHOO.util.Selector.query(\'input[id*=_\' + id_user + \']\'); var i; for(i = 0; i < days.length; i++) days[i].checked = true; } function unCheckAllUser(id_user) { var days = YAHOO.util.Selector.query(\'input[id*=_\' + id_user + \']\'); var i; for(i = 0; i < days.length; i++) days[i].checked = false; }' . '</script>', 'content'); } cout('</div>', 'content'); }
public function getCourseList($type = '', $page = 1) { require_once _lms_ . '/lib/lib.catalogue.php'; $cat_man = new Catalogue_Manager(); $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt()); $filter = ''; switch ($type) { case 'elearning': $filter = " AND course_type = '" . $type . "'"; break; case 'classroom': $filter = " AND course_type = '" . $type . "'"; break; case 'edition': $filter = " AND course_edition = 1"; break; case 'new': $filter = " AND create_date >= '" . date('Y-m-d', mktime(0, 0, 0, date('m'), (int) date('d') - 7, date('Y'))) . "'"; break; case 'catalogue': $id_catalogue = Get::req('id_cata', DOTY_INT, '0'); $catalogue_course =& $cat_man->getCatalogueCourse($id_catalogue); $filter = " AND idCourse IN (" . implode(',', $catalogue_course) . ")"; break; default: break; } $filter .= " AND show_rules = 0"; $login_link = '<a href="index.php">' . Lang::t('_LOG_IN', 'login') . '</a>'; $signin_link = '<a href="index.php?modname=login&op=register">' . Lang::t('_SIGN_IN', 'login') . '</a>'; require_once _lib_ . '/lib.usermanager.php'; $option = new UserManagerOption(); $register_type = $option->getOption('register_type'); $limit = ($page - 1) * Get::sett('visuItem'); $id_cat = Get::req('id_cat', DOTY_INT, 0); $query = "SELECT *" . " FROM %lms_course" . " WHERE status NOT IN (" . CST_PREPARATION . ", " . CST_CONCLUDED . ", " . CST_CANCELLED . ")" . " AND course_type <> 'assessment'" . " AND (" . " date_end = '0000-00-00'" . " OR date_end > '" . date('Y-m-d') . "'" . " )" . $filter . ($id_cat > 0 ? " AND idCategory = " . (int) $id_cat : '') . " ORDER BY name" . " LIMIT " . $limit . ", " . Get::sett('visuItem'); $result = sql_query($query); $html = ''; $path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/'; while ($row = sql_fetch_assoc($result)) { $action = ''; if ($row['course_type'] === 'classroom') { $additional_info = ''; $classrooms = $this->classroom_man->getCourseDate($row['idCourse'], false); if (count($classrooms) > 0) { $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '</p></a>' . '</div>'; } } elseif ($row['course_edition'] == 1) { $additional_info = ''; $editions = $this->edition_man->getEditionAvailableForCourse(Docebo::user()->getIdSt(), $row['idCourse']); if (count($editions) > 0) { $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<a href="javascript:;" onclick="courseSelection(\'' . $row['idCourse'] . '\', \'0\')" title="' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '"><p class="can_subscribe">' . Lang::t('_SHOW_EDITIONS', 'catalogue') . '</p></a>' . '</div>'; } } else { // standard elearning course without editions $query = "SELECT COUNT(*)" . " FROM %lms_courseuser" . " WHERE idCourse = '" . $row['idCourse'] . "'"; list($enrolled) = sql_fetch_row(sql_query($query)); $row['enrolled'] = $enrolled; $row['create_date'] = Format::date($row['create_date'], 'date'); $additional_info = '<p class="course_support_info">' . Lang::t('_COURSE_INTRO', 'course', array('[course_type]' => $row['course_type'], '[create_date]' => $row['create_date'], '[enrolled]' => $row['enrolled'], '[course_status]' => Lang::t($this->cstatus[$row['status']], 'course'))) . '</p>'; $action = '<div class="catalog_action" style="top:5px;" id="action_' . $row['idCourse'] . '">' . '<p class="can_subscribe">' . str_replace(array('[login]', '[signin]'), array($login_link, $signin_link), $register_type === 'self' || $register_type === 'self_optin' || $register_type === 'moderate' ? Lang::t('_REGISTER_FOR_COURSE', 'login') : Lang::t('_REGISTER_FOR_COURSE_NO_REG', 'login')) . '</p>' . '</div>'; } $html .= '<div class="dash-course">' . ($row['use_logo_in_courselist'] && $row['img_course'] ? '<div class="logo_container"><img class="clogo" src="' . $path_course . $row['img_course'] . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . ($row['use_logo_in_courselist'] && !$row['img_course'] ? '<div class="logo_container"><img class="clogo cnologo" src="' . Get::tmpl_path() . 'images/course/course_nologo.png' . '" alt="' . Util::purge($row['name']) . '" /></div>' : '') . '<div class="info_container">' . '<h2>' . ($row['lang_code'] != 'none' ? Get::img('language/' . strtolower($row['lang_code']) . '.png', $row['lang_code']) : '') . $row['name'] . '</h2>' . $additional_info . '<p class="course_support_info">' . $row['description'] . '</p>' . '<p class="course_support_info">' . ($row['course_demo'] ? '<a href="index.php?r=homecatalogue/downloadDemoMaterial&course_id=' . $row['idCourse'] . '" class="ico-wt-sprite subs_download"><span>' . Lang::t('_COURSE_DEMO', 'course') . '</span></a>' : '') . '</p>' . '<p class="course_support_info">' . ($row['code'] ? '<i style="font-size:.88em">[' . $row['code'] . ']</i>' : '') . '</p>' . $action . '<div class="nofloat"></div>' . '</div>' . '</div>'; } if (sql_num_rows($result) <= 0) { $html = '<p>' . Lang::t('_NO_CONTENT', 'standard') . '</p>'; } return $html; }
function homeUserProfile($picture = false, $viewer = false, $intest = false) { $this->loadUserData($this->getViewer()); $acl_man =& Docebo::user()->getAclManager(); list($class_picture, $this->max_dim_avatar) = $this->getPhotoLimit($picture); $html = '<div class="up_dashboard"><div class="content">'; $html .= '<p class="logo">' . ($this->user_info[ACL_INFO_AVATAR] != "" ? $this->getPASrc($this->user_info[ACL_INFO_AVATAR], $this->_lang->def('_AVATAR'), 'boxed') : '<img class="boxed" src="' . getPathImage() . 'standard/user.png" alt="' . $this->_lang->def('_NOAVATAR') . '" />') . '</p>'; $html .= '' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_USERNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_LASTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_LASTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_FIRSTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_FIRSTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_EMAIL') . '</b><br/> ' . ($this->user_info[ACL_INFO_EMAIL] !== false ? '<a href="mailto:' . $this->user_info[ACL_INFO_EMAIL] . '">' . $this->user_info[ACL_INFO_EMAIL] . '</a>' : $this->_lang->def('_HIDDEN')) . '</p>' . '<div class="nofloat"></div>'; $social = new Social(); if ($social->enabled()) { if (!$social->allConnected()) { $html .= '<b class="social-accounts-title">' . Lang::t('_CONNECT_YOUR_ACCOUNT_WITH', 'social') . '</b>'; $html .= '<ul class="social-accounts">'; if ($social->isActive('facebook') && !$social->connectedToUser('facebook')) { $social = new Social(); $social->includeFacebookLib(); $client_id = Get::sett('social_fb_api'); $client_secret = Get::sett('social_fb_secret'); $redirect_uri = Get::sett('url') . 'index.php?modname=login&op=facebook_login'; $serviceFactory = new \OAuth\ServiceFactory(); $storage = new Session(); $credentials = new Credentials($client_id, $client_secret, $redirect_uri); $facebookService = $serviceFactory->createService('facebook', $credentials, $storage, array()); //, 'userinfo_profile' $loginUrl = $facebookService->getAuthorizationUri(); $html .= '<li><a href="' . $loginUrl . '" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>'; } if ($social->isActive('twitter') && !$social->connectedToUser('twitter')) { $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=twitter_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>'; } if ($social->isActive('linkedin') && !$social->connectedToUser('linkedin')) { $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=linkedin_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>'; } if ($social->isActive('google') && !$social->connectedToUser('google')) { $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=google_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>'; } $html .= '</ul><br/>'; } if ($social->someConnected()) { $html .= '<b class="social-accounts-title">' . Lang::t('_CONNECTED_ACCOUNTS', 'social') . '</b>'; $html .= '<ul class="social-accounts">'; if ($social->connectedToUser('facebook')) { $html .= '<li><a id="disconnect_facebook" href="index.php?r=SocialConnect/disconnect&network=facebook" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>'; } if ($social->connectedToUser('twitter')) { $html .= '<li><a id="disconnect_twitter" href="index.php?r=SocialConnect/disconnect&network=twitter" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>'; } if ($social->connectedToUser('linkedin')) { $html .= '<li><a id="disconnect_linkedin" href="index.php?r=SocialConnect/disconnect&network=linkedin" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>'; } if ($social->connectedToUser('google')) { $html .= '<li><a id="disconnect_google" href="index.php?r=SocialConnect/disconnect&network=google" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>'; } $html .= '</ul>'; } /* $html.=Util::widget('dialog', array( 'id' => 'confirm_disconnect', 'dynamicContent' => false, 'body'=>'mm', 'directSubmit'=>true, 'ajaxUrl' => '"ajax.adm_server.php?r=alms/enrollrules/add"', 'dynamicAjaxUrl' => true, 'callback' => 'function() { this.destroy(); }', 'callEvents' => array( array('caller' => 'disconnect_facebook', 'event' => 'click'), array('caller' => 'disconnect_twitter', 'event' => 'click'), array('caller' => 'disconnect_linkedin', 'event' => 'click'), array('caller' => 'disconnect_google', 'event' => 'click'), ) ), true); */ } $html .= '</div></div>'; // box carriera require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php'; require_once $GLOBALS['where_lms'] . '/modules/course/course.php'; $ma = new Man_MiddleArea(); $access_career = $ma->currentCanAccessObj('career'); //if($this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) == 'alberto' && $access_career) { if ($access_career) { $url = $this->_url_man; $course_stats = userCourseList($url, false, false); //TODO: review this call . use course list to compute carreer $base_url = 'index.php?r=' . _after_login_ . '&filter='; $end = 0; if (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0) { $end = $course_stats['with_ustatus'][_CUS_END]; } $html .= '<div class="inline_block">' . '<h2 class="heading">' . $this->_lang->def('_CAREER') . '</h2>' . '<div class="content">' . '<div class="course_stat">' . '<table summary="">' . '<tr><th scope="row">' . $this->_lang->def('_TOTAL_COURSE') . ' :</th><td>' . ($course_stats['total'] - $end) . '</td></tr>' . (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_END') . ' :</th><td>' . $course_stats['with_ustatus'][_CUS_END] . '</td></tr>' : '') . (isset($course_stats['expiring']) && $course_stats['expiring'] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_EXPIRING') . ' :</th><td>' . $course_stats['expiring'] . '</td></tr>' : ''); if (count($course_stats['with_ulevel']) > 1) { require_once $GLOBALS['where_lms'] . '/lib/lib.levels.php'; $lvl = CourseLevel::getLevels(); foreach ($course_stats['with_ulevel'] as $lvl_num => $quantity) { $html .= '' . '<tr><th scope="row">' . str_replace('[level]', $lvl[$lvl_num], $this->_lang->def('_COURSE_AS')) . ' :</th><td>' . $quantity . '</td></tr>'; } //end foreach } $query = "SELECT c.idMetaCertificate, m.idCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as c" . " JOIN " . $GLOBALS['prefix_lms'] . "_certificate_meta as m ON c.idMetaCertificate = m.idMetaCertificate" . " WHERE c.idUser = '******'" . " GROUP BY c.idMetaCertificate" . " ORDER BY m.title, m.description"; $result = sql_query($query); $num_meta_cert = mysql_num_rows($result); while (list($id_meta, $id_certificate) = sql_fetch_row($result)) { $query_released = "SELECT on_date" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'"; $result_released = sql_query($query_released); $query = "SELECT user_release" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE id_certificate = '" . $id_certificate . "'"; list($user_release) = sql_fetch_row(sql_query($query)); if (mysql_num_rows($result_released)) { } elseif ($user_release == 0) { $num_meta_cert--; } else { $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'"; $result_int = sql_query($query); $control = true; while (list($id_course) = sql_fetch_row($result_int)) { $query = "SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE idCourse = '" . $id_course . "'" . " AND idUser = '******'" . " AND status = '" . _CUS_END . "'"; list($number) = sql_fetch_row(sql_query($query)); if (!$number) { $control = false; } } if (!$control) { $num_meta_cert--; } } } $tot_cert = $num_meta_cert + $course_stats['cert_relesable']; $html .= '' . (isset($course_stats['cert_relesable']) && $tot_cert != 0 ? '<tr><th scope="row">' . $this->_lang->def('_CERT_RELESABLE') . ' :</th><td><a href="index.php?modname=mycertificate&op=mycertificate">' . $tot_cert . '</a></td></tr>' : '') . ($pendent != 0 ? '<tr><th scope="row">' . $this->_lang->def('_FRIEND_PENDENT') . ' :</th><td><a href="index.php?modname=myfriends&op=myfriends">' . $pendent . '</a></td></tr>' : '') . '</table>' . '</div>' . '</div>' . '</div>'; } /* $html = '<div class="user_presentation">'."\n" .( $intest ? '<div class="mini_block">'."\n\t" .'<h1>'."\n\t\t" .$this->_lang->def('_WELCOME').'<br/>'."\n\t\t" .'<span>'.$this->resolveUsername().'</span>'."\n\t" .'</h1>'."\n\t" .'<div class="spacer"></div>'."\n\t" .'</div>'."\n" : '' ); if($this->_user_profile->useAvatar()) { $html .= '<div class="mini_block avatar_photo">'."\n\t"; } if($this->_user_profile->useAvatar()) { $html .= '<p>'."\n\t" .( ($this->user_info[ACL_INFO_AVATAR] != "") ? $this->getPASrc($this->user_info[ACL_INFO_AVATAR], $this->_lang->def('_AVATAR'), 'boxed') : '<img class="boxed" src="'.getPathImage().'standard/user.png" alt="'.$this->_lang->def('_NOAVATAR').'" />' )."\n\t\t" .'<br />'."\n\t\t" .$this->_lang->def('_AVATAR')."\n\t\t" .'</p>'."\n\t"; } if($this->_user_profile->useAvatar()) { $html .= '<div class="nofloat"></div>'."\n\t" .'<div class="spacer"></div>'."\n" .'</div>'."\n"; } $html .= '<div class="mini_block">'."\n\t" .'<p class="userinfo">'."\n\t\t" .'<b>'.$this->_lang->def('_USERNAME').':</b> '.$this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) .'</p>'."\n\t" .'<p class="userinfo">'."\n\t\t" .'<b>'.$this->_lang->def('_EMAIL').':</b> ' .( $this->user_info[ACL_INFO_EMAIL] !== false ? '<a href="mailto:'.$this->user_info[ACL_INFO_EMAIL].'">'.$this->user_info[ACL_INFO_EMAIL].'</a>' : $this->_lang->def('_HIDDEN') )."\n\t" .'</p>'."\n\t" .'</div>'."\n" .'</div>'."\n"; */ return $html; }
public function getCourseEdition($id_course, $start_index = false, $results = false, $sort = false, $dir = false, $ed_arr = false) { if ($ed_arr !== false && is_array($ed_arr) && empty($ed_arr)) { $ed_arr[] = 0; } $query = "SELECT dt.id_date, dt.code, dt.name, dt.status, MIN(dy.date_begin) AS date_begin, MAX(dy.date_end) AS date_end, COUNT(dy.id_day) as num_day, COUNT(DISTINCT du.id_user) as user_subscribed, dt.unsubscribe_date_limit" . " FROM " . $this->date_table . " as dt" . " JOIN " . $this->day_date_table . " as dy ON dy.id_date = dt.id_date" . " LEFT JOIN " . $this->user_date_table . " as du ON du.id_date = dt.id_date" . " LEFT JOIN " . $this->user_table . " AS u ON u.idst = du.id_user" . " WHERE dt.id_course = " . $id_course . (!empty($ed_arr) && is_array($ed_arr) ? " AND dt.id_date IN (" . implode(",", $ed_arr) . ") " : "") . " GROUP BY dt.id_date"; switch ($sort) { case 'code': $query .= " ORDER BY dt.code " . $dir . ", dt.name " . $dir . ", date_begin " . $dir; break; case 'name': $query .= " ORDER BY dt.name " . $dir . ", date_begin " . $dir; break; case 'status': $query .= " ORDER BY dt.status " . $dir . ", dt.code " . $dir . ", dt.name " . $dir . ", date_begin " . $dir; break; case 'date_begin': $query .= " ORDER BY date_begin " . $dir . ", dt.code " . $dir . ", dt.name " . $dir; break; case 'date_end': $query .= " ORDER BY date_end " . $dir . ", date_begin " . $dir . ", dt.code " . $dir . ", dt.name " . $dir; break; } $start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results); $result = sql_query($query); $res = array(); while (list($id_date, $code, $name, $status, $date_begin, $date_end, $num_day, $user_subscribed, $unsubscribe_date_limit) = sql_fetch_row($result)) { if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) { require_once _base_ . '/lib/lib.preference.php'; $adminManager = new AdminPreference(); $query = "SELECT COUNT(*)" . " FROM " . $this->user_date_table . " WHERE id_date = '" . $id_date . "'" . " AND " . $adminManager->getAdminUsersQuery(Docebo::user()->getIdSt(), 'id_user'); list($user_subscribed) = sql_fetch_row(sql_query($query)); $query = "SELECT COUNT(*) FROM %lms_courseuser AS cu JOIN %lms_course_date AS cd JOIN %lms_course_date_user AS cdu " . " ON (cd.id_date = cdu.id_date AND cd.id_course = cu.idCourse AND cu.idUser = cdu.id_user) " . " WHERE cd.id_date = " . (int) $id_date . " AND cu.level = 3" . " AND " . $adminManager->getAdminUsersQuery(Docebo::user()->getIdSt(), 'u.id_user'); list($num_student) = sql_fetch_row(sql_query($query)); } else { $query = "SELECT COUNT(*) FROM %lms_courseuser AS cu JOIN %lms_course_date AS cd JOIN %lms_course_date_user AS cdu " . " ON (cd.id_date = cdu.id_date AND cd.id_course = cu.idCourse AND cu.idUser = cdu.id_user) " . " WHERE cd.id_date = " . (int) $id_date . " AND cu.level = 3"; list($num_student) = sql_fetch_row(sql_query($query)); } $res[] = array('id_date' => $id_date, 'code' => $code, 'name' => $name, 'status' => $status, 'date_begin' => Format::date($date_begin, 'date'), 'date_end' => Format::date($date_end, 'date'), 'classroom' => $this->getDateClassrooms($id_date, true), 'students' => $num_student, 'num_subscribe' => $user_subscribed, 'subscription' => '<a href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'subscription/show&id_course=' . $id_course . '&id_date=' . $id_date . '" title="' . Lang::t('_SUBSCRIPTION', 'course') . '">' . ($user_subscribed ? $user_subscribed : 0) . ' <span class="ico-sprite subs_' . ($user_subscribed > 0 ? 'users' : 'notice') . '"><span>' . Lang::t('_USER_STATUS_SUBS') . '</span></span></a>', 'presence' => '<a href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'classroom/presence&id_course=' . $id_course . '&id_date=' . $id_date . '">' . Lang::t('_ATTENDANCE', 'course') . '</a>', 'num_day' => $num_day, 'user_subscribed' => $user_subscribed, 'mod' => '<a href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'classroom/modclassroom&id_course=' . $id_course . '&id_date=' . $id_date . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'course')) . '</a>', 'del' => 'ajax.adm_server.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'classroom/delclassroom&id_course=' . $id_course . '&id_date=' . $id_date, 'unsubscribe_date_limit' => $unsubscribe_date_limit); } return $res; }
function socialConnectLogin($uid = false, $network_code = false) { require_once _base_ . '/lib/lib.usermanager.php'; $res = ''; $lang = DoceboLanguage::createInstance('login'); $user_manager = new UserManager(); if (!empty($uid) && !empty($network_code)) { session_regenerate_id(); $_SESSION['connect_social']['uid'] = $uid; $_SESSION['connect_social']['network_code'] = $network_code; } $can_connect = false; if (isset($_SESSION['connect_social']) && isset($_SESSION['connect_social']['uid']) && !empty($_SESSION['connect_social']['uid'])) { // read data from session, in case we are on the second step (login attempt) $uid = $_SESSION['connect_social']['uid']; $network_code = $_SESSION['connect_social']['network_code']; $can_connect = true; } // check form submission: if (isset($_POST['undo'])) { // go back to index Util::jump_to('index.php'); } else { if (isset($_POST['login']) && !$can_connect) { // we don't have the social uid to be connected with user account.. Util::jump_to('index.php?modname=login&op=social_connect_login&err=2'); } else { if (isset($_POST['login'])) { // login and connect account $user = DoceboUser::createDoceboUserFromLogin(Get::pReq('login_userid', DOTY_STRING), Get::pReq('login_pwd', DOTY_STRING), 'public_area'); if ($user) { DoceboUser::setupUser($user); $social = new Social(); $social->connectAccount($network_code, $uid); unset($_SESSION['connect_social']); Util::jump_to('index.php?r=lms/elearning/show'); } else { Util::jump_to('index.php?modname=login&op=social_connect_login&err=1'); } } } } switch (Get::gReq('err', DOTY_INT, 0)) { case 1: $res .= UIFeedback::error(Lang::t('_NOACCESS', 'login'), true); break; case 2: $res .= UIFeedback::error(Lang::t('_NO_SOCIAL_ACCOUNT_TO_CONNECT', 'login') . ' <a href="index.php">' . Lang::t('_TRY_AGAIN', 'login') . '</a>', true); break; } $GLOBALS['page']->add(getTitleArea($lang->def('_LOGIN'), 'login') . '<div class="std_block">' . getBackUi('index.php', $lang->def('_BACK')), 'content'); if ($can_connect) { $res .= Get::img('social/' . $network_code . '-24.png') . ' '; $res .= str_replace('[network_code]', Lang::t($network_code, 'social'), Lang::t('_YOU_ARE_CONNECTING_SOCIAL_ACCOUNT', 'social')) . " <b>" . $uid . "</b>"; } $res .= Form::openForm('scl_form', 'index.php?modname=login&op=social_connect_login') . Form::openElementSpace() . Form::getTextfield(Lang::t('_USERNAME', 'login'), 'login_userid', 'login_userid', 255) . Form::getPassword(Lang::t('_PASSWORD', 'login'), 'login_pwd', 'login_pwd', 255) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('login', 'login', Lang::t('_LOGIN', 'login')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'login')) . Form::closeButtonSpace() . Form::closeForm(); $GLOBALS['page']->add($res, 'content'); // std_block $GLOBALS['page']->add('</div>', 'content'); // std_block }
public static function lang_flag() { $lang_sel = Lang::get(); $langs_var = Docebo::langManager()->getAllLanguages(); if (count($langs_var) <= 1) { return ''; } $html = '<ul id="language_selection">'; foreach ($langs_var as $k => $v) { $html .= '<li><a ' . ($v[0] == $lang_sel ? 'class="current" ' : '') . 'href="' . (isset($args['redirect_on']) ? $args['redirect_on'] : 'index.php') . '?special=changelang&new_lang=' . rawurlencode($v[0]) . '" title="' . $v[1] . '">' . Get::img('language/' . rawurlencode($v[0]) . '.png', $v[0]) . '</a></li>'; } $html .= '</ul>'; return $html; }
function view_report_certificate() { checkPerm('view'); require_once _lms_ . '/lib/lib.certificate.php'; require_once _lms_ . '/lib/lib.course.php'; $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $deletion = importVar('deletion', true, 0); if ($deletion) { switch ($deletion) { case 1: $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); break; case 2: $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; case 3: $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; } } $certificate = new Certificate(); $id_certificate = importVar('id_certificate', true, 0); $id_course = importVar('id_course', true, 0); $selection = importVar('selection', false, array()); //all possible selected values $selected = importVar('selected', false, array()); //effectively selected values with checkbox $sel = importVar('old_selection', false, ''); //selected values from previous table pages if ($sel != '') { $total_selection = explode(',', $sel); } else { $total_selection = array(); } //update total selection foreach ($selection as $key => $val) { if (in_array($val, $selected)) { if (!in_array($val, $total_selection)) { $total_selection[] = $val; } } else { $index = array_search($val, $total_selection); if ($index !== false) { array_splice($total_selection, $index, 1); } } } $search_filter = importVar('filter', false, ''); $only_released = importVar('only_released', true, 0); //which command? if (importVar('search_button', false, false) !== false) { } if (importVar('reset_button', false, false) !== false) { $search_filter = ''; $only_released = 0; } if (importVar('print_button', false, false) !== false) { } $numtablerows = Get::sett('visuItem', 25); $tb = new Table($numtablerows, $lang->def('_CERTIFICATE_VIEW_CAPTION'), $lang->def('_CERTIFICATE_VIEW_CAPTION')); $tb->initNavBar('ini', 'button'); $ini = $tb->getSelectedElement(); $ini_param = Get::req('ini', DOTY_MIXED, array()); //floor($ini / Get::sett('visuItem', 25)); if (empty($ini_param)) { $ini_param = 1; } else { list($ini_param) = each($ini_param); } $tca = $GLOBALS['prefix_lms'] . "_certificate_assign as ca"; $tcc = $GLOBALS['prefix_lms'] . "_certificate_course as cc"; $tcu = $GLOBALS['prefix_lms'] . "_courseuser as cu"; $tu = $GLOBALS['prefix_fw'] . "_user as u"; $where = ""; if ($search_filter != '') { $where .= " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') "; } if ($only_released > 0) { $where = " AND ca.on_date " . ($only_released == 1 ? "IS NOT" : "IS") . " NULL "; } //$where .= " AND ".$aval_status." ".($only_released==1 ? "<" : ">=")." cu.status "; list($aval_status) = sql_fetch_row(sql_query("SELECT available_for_status FROM " . $tcc . " " . " WHERE id_certificate='" . (int) $id_certificate . "' AND id_course='" . (int) $id_course . "'")); switch ($aval_status) { case AVS_ASSIGN_FOR_ALL_STATUS: $aval_status = " 1 "; break; case AVS_ASSIGN_FOR_STATUS_INCOURSE: $aval_status = " cu.status = " . _CUS_BEGIN . " "; break; case AVS_ASSIGN_FOR_STATUS_COMPLETED: $aval_status = " cu.status = " . _CUS_END . " "; break; } list($totalrows) = sql_fetch_row(sql_query("SELECT COUNT(*) " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where)); $query = "SELECT u.userid, u.firstname, u.lastname, cu.date_complete, ca.on_date, cu.idUser as id_user, cu.status " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where . " ORDER BY u.userid LIMIT " . $ini . ", " . $numtablerows; //cout('<pre>'.print_r($_POST, true).'</pre>'); //cout($query); $res = sql_query($query); $from = Get::req('from', DOTY_MIXED, ''); if ($from === 'course') { $back_ui = getBackUi('index.php?r=alms/course/certificate&id_course=' . (int) $id_course, $lang->def('_BACK')); $out->add(getTitleArea(array('index.php?r=alms/course/certificate&id_course=' . (int) $id_course => $lang->def('_CERTIFICATE_ASSIGN_STATUS', 'course'), $lang->def('_COURSES')), 'certificate')); } else { $back_ui = getBackUi('index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate, $lang->def('_BACK')); $out->add(getTitleArea(array('index.php?modname=certificate&op=certificate' => $lang->def('_TITLE_CERTIFICATE'), 'index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate => $lang->def('_COURSES'), $lang->def('_CERTIFICATE_VIEW_CAPTION')), 'certificate')); } $out->add('<div class="std_block">' . $back_ui); $numrows = sql_num_rows($res); $downloadables = array(); if ($numrows > 0) { $clang =& DoceboLanguage::CreateInstance('course', 'lms'); $type_h = array('image', '', '', '', '', '', '', 'image', 'image'); $cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::sprite('subs_pdf', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::sprite('subs_del', Lang::t('_DEL', 'certificate'))); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $acl_man =& $GLOBALS['current_user']->getAclManager(); $arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND')); //foreach($report_info as $info_report) while ($info = sql_fetch_assoc($res)) { $cont = array(); $can_assign = (bool) ($info['on_date'] == ''); $input_id = $info['id_user']; $sel_cell_content = ''; $label_open = ''; $label_close = ''; if ($can_assign) { $input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> '; if (in_array($input_id, $total_selection)) { $checked = ' checked="checked"'; } else { $checked = ''; } $sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>'; $label_open = '<label for="selected_' . $input_id . '">'; $label_close = '</label>'; } $userid = $acl_man->relativeId($info['userid']); $cont[] = $sel_cell_content; $cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close; $cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close; $cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close; $cont[] = $arr_status[$info['status']]; $cont[] = $info['date_complete']; $cont[] = $info['on_date']; $url = 'index.php?modname=certificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $info['id_user']; $dl_url = $url . "&op=send_certificate"; if ($can_assign) { $downloadables[] = 'dl_single_' . $input_id; } $cont[] = $can_assign ? '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="javascript:;" title="' . $lang->def('_GENERATE') . '"><span>' . $lang->def('_GENERATE') . '</span></a>' : '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="' . $dl_url . '" title="' . $lang->def('_DOWNLOAD') . '"><span>' . $lang->def('_DOWNLOAD') . '</span></a>'; $cont[] = $can_assign ? '' : Get::sprite_link('subs_del', $url . '&op=del_report_certificate', Lang::t('_DEL', 'certificate')); $tb->addBody($cont); } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=del_report_certificate]'); //search filter ... $release_options = array($lang->def('_ALL') => 0, $lang->def('_RELEASED') => 1, $lang->def('_TO_RELEASE') => 2); //search and store all non-available certificates $all_selection = array(); $query = "SELECT cu.idUser as id_user " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . ($search_filter != '' ? " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') " : "") . " AND ca.on_date IS NULL "; $res = sql_query($query); while (list($id_user) = sql_fetch_row($res)) { $all_selection[] = $id_user; } //--- $form = new Form(); $submit_url = "index.php?modname=certificate&op=view_report_certificate&id_certificate=" . (int) $id_certificate . "&id_course=" . (int) $id_course; $out->add($form->openForm("certificates_emission", $submit_url) . $form->getHidden('old_selection', 'old_selection', implode(',', $total_selection)) . $form->getHidden('all_selection', 'all_selection', implode(',', $all_selection)) . $form->getHidden('active_text_filter', 'active_text_filter', $search_filter) . $form->getHidden('active_only_released', 'active_only_released', $only_released) . $form->getHidden('active_ini', 'active_ini', $ini_param) . '<div class="quick_search_form">' . '<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '</div>' . '<a id="advanced_search" class="advanced_search" href="javascript:;">' . Lang::t("_ADVANCED_SEARCH", 'standard') . '</a>' . '<div id="certificate_release_as" class="advanced_search_options" style="display: ' . ($only_released != 0 ? 'block' : 'none') . '">' . Form::getRadioHoriz(Lang::t('_FILTER', 'certificate'), 'only_released', 'only_released', $release_options, $only_released) . '</div>' . '</div>' . '<script type="text/javascript">' . 'YAHOO.util.Event.addListener("advanced_search", "click", function(e){ var el = YAHOO.util.Dom.get("certificate_release_as"); if (el.style.display != \'block\') el.style.display = \'block\'; else el.style.display = \'none\'; });' . '</script>', 'content'); $delgen_url = 'index.php?modname=certificate&op=del_gen_certificate' . '&id_certificate=' . (int) $id_certificate . '&id_course=' . (int) $id_course; $delgen_txt = Lang::t('_DELETE_ALL_GENERATED', 'certificate'); $print_button_1 = '<div>' . '<a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>'; $print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>'; $print_button_1 .= Lang::t('_SELECT', 'directory') . ': '; $print_button_2 .= Lang::t('_SELECT', 'directory') . ': '; /* $print_button_1 .= ' <a href="javascript:;" id="select_page_1">'.Lang::t('_SELECT_PAGE', 'standard').'</a>'; $print_button_2 .= ' <a href="javascript:;" id="select_page_2">'.Lang::t('_SELECT_PAGE', 'standard').'</a>'; $print_button_1 .= ' <a href="javascript:;" id="unselect_page_1">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>'; $print_button_2 .= ' <a href="javascript:;" id="unselect_page_2">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>'; */ $print_button_1 .= ' <a href="javascript:;" id="select_all_1">' . Lang::t('_ALL_PAGES', 'directory') . '</a>'; $print_button_2 .= ' <a href="javascript:;" id="select_all_2">' . Lang::t('_ALL_PAGES', 'directory') . '</a>'; $print_button_1 .= ' <a href="javascript:;" id="unselect_all_1">' . Lang::t('_NONE', 'directory') . '</a>'; $print_button_2 .= ' <a href="javascript:;" id="unselect_all_2">' . Lang::t('_NONE', 'directory') . '</a>'; $navbar = $tb->getNavBar($ini, $totalrows); $out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2); $out->add($form->closeForm()); } else { $out->add($lang->def('_NO_CONTENT')); } $out->add($back_ui . '</div>'); addCss('style_menu', 'lms'); Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true); Util::get_js(Get::rel_path('lms') . '/admin/modules/certificate/certificate.js?rnd=' . time(), true, true); //addJs($GLOBALS['where_lms_relative'].'/admin/modules/certificate/', 'certificate.js'); $script = 'var ajax_url="ajax.adm_server.php?plf=lms&mn=certificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&', '&', isset($submit_url) ? $submit_url : '') . '", ' . '_ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '", ' . '_AREYOUSURE="' . Lang::t('_AREYOUSURE', 'standard') . '";'; $out->add('<script type="text/javascript">' . $script . '</script>', 'page_head'); }
function view_report_certificate() { checkPerm('view'); require_once _lms_ . '/lib/lib.certificate.php'; require_once _lms_ . '/lib/lib.course.php'; $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $deletion = importVar('deletion', true, 0); if ($deletion) { switch ($deletion) { case 1: $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); break; case 2: $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; case 3: $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; } } $certificate = new Certificate(); $id_certificate = importVar('id_certificate', true, 0); $id_course = importVar('id_course', true, 0); $selection = importVar('selection', false, array()); //all possible selected values $selected = importVar('selected', false, array()); //effectively selected values with checkbox $sel = importVar('old_selection', false, ''); //selected values from previous table pages if ($sel != '') { $total_selection = explode(',', $sel); } else { $total_selection = array(); } //update total selection foreach ($selection as $key => $val) { if (in_array($val, $selected)) { if (!in_array($val, $total_selection)) { $total_selection[] = $val; } } else { $index = array_search($val, $total_selection); if ($index !== false) { array_splice($total_selection, $index, 1); } } } $search_filter = importVar('filter', false, ''); $only_released = importVar('only_released', true, 0); //which command? if (importVar('search_button', false, false) !== false) { } if (importVar('reset_button', false, false) !== false) { $search_filter = ''; $only_released = 0; } if (importVar('print_button', false, false) !== false) { } $numtablerows = $GLOBALS['framework']['visuItem']; $tb = new Table($numtablerows, $lang->def('_CERTIFICATE_VIEW_CAPTION'), $lang->def('_CERTIFICATE_VIEW_CAPTION')); $tb->initNavBar('ini', 'button'); $ini = $tb->getSelectedElement(); $tca = $GLOBALS['prefix_lms'] . "_certificate_assign as ca"; $tcc = $GLOBALS['prefix_lms'] . "_certificate_course as cc"; $tcu = $GLOBALS['prefix_lms'] . "_courseuser as cu"; $tu = $GLOBALS['prefix_fw'] . "_user as u"; $where = ""; if ($search_filter != '') { $where .= " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') "; } if ($only_released > 0) { $where = " AND ca.on_date " . ($only_released == 1 ? "IS NOT" : "IS") . " NULL "; } //$where .= " AND ".$aval_status." ".($only_released==1 ? "<" : ">=")." cu.status "; list($aval_status) = sql_fetch_row(sql_query("SELECT available_for_status FROM " . $tcc . " " . " WHERE id_certificate='" . (int) $id_certificate . "' AND id_course='" . (int) $id_course . "'")); switch ($aval_status) { case AVS_ASSIGN_FOR_ALL_STATUS: $aval_status = " 1 "; break; case AVS_ASSIGN_FOR_STATUS_INCOURSE: $aval_status = " cu.status = " . _CUS_BEGIN . " "; break; case AVS_ASSIGN_FOR_STATUS_COMPLETED: $aval_status = " cu.status = " . _CUS_END . " "; break; } list($totalrows) = sql_fetch_row(sql_query("SELECT COUNT(*) " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where)); $query = "SELECT u.userid, u.firstname, u.lastname, cu.date_complete, ca.on_date, cu.idUser as id_user, cu.status " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where . " ORDER BY u.userid LIMIT " . $ini . ", " . $numtablerows; $res = sql_query($query); $from = Get::req('from', DOTY_MIXED, ''); $back_ui = getBackUi('index.php?r=lms/pcourse/certificate&id_course=' . (int) $id_course, $lang->def('_BACK')); $out->add(getTitleArea(array('index.php?r=lms/pcourse/certificate&id_course=' . (int) $id_course => $lang->def('_CERTIFICATE_ASSIGN_STATUS', 'course'), $lang->def('_CERTIFICATE_REPORT_COURSE_CERT')), 'certificate')); $out->add('<div class="std_block">' . $back_ui); $numrows = sql_num_rows($res); $downloadables = array(); if ($numrows > 0) { $clang =& DoceboLanguage::CreateInstance('course', 'lms'); $type_h = array('image', '', '', '', '', '', '', 'image', 'image'); $cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::img('course/certificate.png', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::img('standard/delete.png', Lang::t('_DEL', 'certificate'))); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $acl_man =& $GLOBALS['current_user']->getAclManager(); $arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND')); //foreach($report_info as $info_report) while ($info = sql_fetch_assoc($res)) { $cont = array(); $can_assign = (bool) ($info['on_date'] == ''); $input_id = $info['id_user']; $sel_cell_content = ''; $label_open = ''; $label_close = ''; if ($can_assign) { $input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> '; if (in_array($input_id, $total_selection)) { $checked = ' checked="checked"'; } else { $checked = ''; } $sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>'; $label_open = '<label for="selected_' . $input_id . '">'; $label_close = '</label>'; } $userid = $acl_man->relativeId($info['userid']); $cont[] = $sel_cell_content; $cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close; $cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close; $cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close; $cont[] = $arr_status[$info['status']]; $cont[] = $info['date_complete']; $cont[] = $info['on_date']; $url = 'index.php?modname=pcertificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $info['id_user']; $dl_url = $url . "&op=send_certificate"; if ($can_assign) { $downloadables[] = 'dl_single_' . $input_id; } $cont[] = '<a href="' . ($can_assign ? "javascript:;" : $dl_url) . '" id="dl_single_' . $input_id . '">' . Get::img('course/certificate.png', Lang::t('_TITLE_VIEW_CERT', 'certificate')) . ($can_assign ? $lang->def('_GENERATE') : $lang->def('_DOWNLOAD')) . '</a>'; $cont[] = $can_assign ? "" : '<a href="' . $url . '&op=del_report_certificate">' . Get::img('standard/delete.png', Lang::t('_DEL', 'certificate')) . '</a>'; $tb->addBody($cont); } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=del_report_certificate]'); $form = new Form(); $form_url = "index.php?modname=pcertificate&op=view_report_certificate&id_certificate=" . (int) $id_certificate . "&id_course=" . (int) $id_course; $out->add($form->openForm("certificates_emission", $form_url)); $out->add($form->getHidden('old_selection', 'old_selection', implode(',', $total_selection))); //search filter ... $release_options = array($lang->def('_ALL') => 0, $lang->def('_ONLY_RELEASED') => 1, $lang->def('_ONLY_TO_RELEASE') => 2); /* $out->add($form->getOpenFieldset($lang->def('_SEARCH_FILTER'))); $out->add($form->getTextfield($lang->def('_FILTER'), "filter", "filter", 255, $search_filter)); $out->add($form->getRadioSet($lang->def('_RELEASE_OPTIONS'), 'only_released', 'only_released', $release_options, $only_released).'<div class="no_float"></div>'); $out->add($form->openButtonSpace()); $out->add($form->getButton("search_button", "search_button", $lang->def('_SEARCH'))); $out->add($form->getButton("reset_button", "reset_button", $lang->def('_UNDO'))); $out->add($form->closeButtonSpace()); $out->add($form->getCloseFieldset()); */ $print_button_1 = '<div><a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a></div>'; $print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a></div>'; cout('<div class="quick_search_form">' . Form::getInputTextfield("_FILTER", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '<br />' . '<br />' . $lang->def('_RELEASE_OPTIONS') . ': ' . Form::getInputRadio('only_released_0', 'only_released', '0', $only_released == 0, '') . ' <label class="label_normal" for="only_released_0">' . Lang::t('_ALL', 'certificate') . '</label>' . ' ' . Form::getInputRadio('only_released_1', 'only_released', '1', $only_released == 1, '') . ' <label class="label_normal" for="only_released_1">' . Lang::t('_ONLY_RELEASED', 'certificate') . '</label>' . ' ' . Form::getInputRadio('only_released_2', 'only_released', '2', $only_released == 2, '') . ' <label class="label_normal" for="only_released_2">' . Lang::t('_ONLY_TO_RELEASE', 'certificate') . '</label>' . Form::closeForm() . '</div>', 'content'); $navbar = $tb->getNavBar($ini, $totalrows); $out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2); $out->add($form->closeForm()); } else { $out->add($lang->def('_NO_USER_FOR_CERTIFICATE')); } $out->add($back_ui . '</div>'); addCss('style_menu', 'lms'); Util::get_js(Get::rel_path('lms') . '/modules/pcertificate/pcertificate.js', true, true); $script = 'var ajax_url="ajax.server.php?plf=lms&mn=pcertificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&', '&', isset($form_url) ? $form_url : '') . '", _ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '";'; $out->add('<script type="text/javascript">' . $script . '</script>', 'page_head'); }
public function getEdition($id_course, $start_index = false, $results = false, $sort = false, $dir = false) { $query = "SELECT e.id_edition, e.code, e.name, e.status, e.date_begin, e.date_end" . " FROM " . $this->edition_table . " AS e " . " WHERE e.id_course = '" . $id_course . "' "; switch ($sort) { case 'code': $query .= " ORDER BY e." . $sort . " " . $dir . ", e.name " . $dir . ", e.date_begin " . $dir; break; case 'name': $query .= " ORDER BY e." . $sort . " " . $dir . ", e.code " . $dir . ", e.date_begin " . $dir; break; case 'status': $query .= " ORDER BY e." . $sort . " " . $dir . ", e.code " . $dir . ", e.name " . $dir . ", e.date_begin " . $dir; break; case 'date_begin': $query .= " ORDER BY e." . $sort . " " . $dir . ", e.code " . $dir . ", e.name " . $dir; break; case 'date_end': $query .= " ORDER BY e." . $sort . " " . $dir . ", e.date_begin " . $dir . ", e.code " . $dir . ", e.name " . $dir; break; } $start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results); $result = sql_query($query); $res = array(); while (list($id_edition, $code, $name, $status, $date_begin, $date_end) = sql_fetch_row($result)) { $num_subscription = $this->getTotalUserSubscribed($id_course, $id_edition); $num_student = $this->getTotalStudentsSubscribed($id_course, $id_edition); $res[] = array('id_course' => $id_course, 'id_edition' => $id_edition, 'code' => $code, 'name' => $name, 'status' => $status, 'status_tr' => $this->status_list[$status], 'date_begin' => $date_begin, 'date_end' => $date_end, 'students' => $num_student, 'num_subscription' => $num_subscription, 'subscription' => '<a class="nounder" href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'subscription/show&id_course=' . $id_course . '&id_edition=' . $id_edition . '">' . $num_subscription . ' ' . Get::img('course/subscribe.png', Lang::t('_SUBSCRIPTION', 'course')) . '</a>', 'edit' => '<a href="index.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'edition/edit&id_course=' . $id_course . '&id_edition=' . $id_edition . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'course')) . '</a>', 'del' => 'ajax.adm_server.php?r=' . (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN ? 'lms/p' : 'alms/') . 'edition/del&id_course=' . $id_course . '&id_edition=' . $id_edition); } return $res; }
<?php echo getTitleArea(Lang::t('_TRANSACTION', 'transaction')) . '<div class="std_block">'; $this->widget('table', array('id' => 'transaction_table', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/transaction/getTransactionData', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'date_creation', 'dir' => 'desc', 'columns' => array(array('key' => 'userid', 'label' => Lang::t('_USERNAME', 'transaction'), 'sortable' => true), array('key' => 'firstname', 'label' => Lang::t('_FIRSTNAME', 'transaction'), 'sortable' => true), array('key' => 'lastname', 'label' => Lang::t('_LASTNAME', 'transaction'), 'sortable' => true), array('key' => 'date_creation', 'label' => Lang::t('_DATE', 'transaction'), 'sortable' => true), array('key' => 'date_activated', 'label' => Lang::t('_ACTIVE', 'transaction'), 'sortable' => true), array('key' => 'price', 'label' => Lang::t('_PRICE', 'transaction')), array('key' => 'paid', 'label' => '', 'className' => 'img-cell'), array('key' => 'edit', 'label' => Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')), 'className' => 'img-cell')), 'fields' => array('id_trans', 'userid', 'firstname', 'lastname', 'date_creation', 'date_activated', 'price', 'paid', 'edit'), 'show' => 'table', 'delDisplayField' => 'name', 'rel_actions' => '')); ?> </div>