本文整理汇总了PHP中DoceboLanguage::CreateInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP DoceboLanguage::CreateInstance方法的具体用法?PHP DoceboLanguage::CreateInstance怎么用?PHP DoceboLanguage::CreateInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoceboLanguage
的用法示例。
在下文中一共展示了DoceboLanguage::CreateInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNodeOptions
function getNodeOptions($id_category, $is_leaf)
{
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$node_options = array();
$node_options[] = array('id' => 'mod_' . $id_category, 'command' => 'modify', 'icon' => 'standard/edit.png', 'alt' => $lang->def('_MOD'));
if ($is_leaf) {
$node_options[] = array('id' => 'del_' . $id_category, 'command' => 'delete', 'icon' => 'standard/delete.png', 'alt' => $lang->def('_DEL'));
} else {
$node_options[] = array('id' => 'del_' . $id_category, 'command' => false, 'icon' => 'blank.png');
}
return $node_options;
}
示例2: __construct
public function __construct()
{
$this->course_table = $GLOBALS['prefix_lms'] . '_course';
$this->subscribe_table = $GLOBALS['prefix_lms'] . '_courseuser';
$this->user_table = $GLOBALS['prefix_fw'] . '_user';
$this->db = DbConn::getInstance();
$this->acl_man = $acl_man =& Docebo::user()->getAclManager();
$this->lang =& DoceboLanguage::CreateInstance('levels', 'lms');
$this->lang =& DoceboLanguage::CreateInstance('subscribe', 'lms');
$this->array_user_status = array(_CUS_WAITING_LIST => $this->lang->def('_WAITING_USERS'), _CUS_CONFIRMED => $this->lang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $this->lang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $this->lang->def('_USER_STATUS_BEGIN'), _CUS_END => $this->lang->def('_USER_STATUS_END'), _CUS_SUSPEND => $this->lang->def('_USER_STATUS_SUSPEND'), _CUS_OVERBOOKING => $this->lang->def('_USER_STATUS_OVERBOOKING'));
$this->array_user_level = array(1 => $this->lang->def('_LEVEL_1', 'levels', 'lms'), 2 => $this->lang->def('_LEVEL_2', 'levels', 'lms'), 3 => $this->lang->def('_LEVEL_3', 'levels', 'lms'), 4 => $this->lang->def('_LEVEL_4', 'levels', 'lms'), 5 => $this->lang->def('_LEVEL_5', 'levels', 'lms'), 6 => $this->lang->def('_LEVEL_6', 'levels', 'lms'), 7 => $this->lang->def('_LEVEL_7', 'levels', 'lms'));
}
示例3: Report_Courses
function Report_Courses()
{
$this->lang =& DoceboLanguage::createInstance('report', 'framework');
$this->usestandardtitle_rows = true;
//$this->usestandardtitle_cols = false;
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$this->_set_columns_category(_RCS_CATEGORY_USERS, $this->lang->def('_RCS_CAT_USER'), 'get_user_filter', 'show_report_user', '_get_users_query', false);
$this->_set_columns_category(_RCS_CATEGORY_DOC_VAL, $this->lang->def('_RCS_CAT_DOC_VAL'), 'get_doc_val_filter', 'show_report_doc_val', '_get_doc_val_query', false);
$this->_set_columns_category(_RCS_CATEGORY_COURSE_VAL, $this->lang->def('_RCS_CAT_COURSE_VAL'), 'get_course_val_filter', 'show_report_course_val', '_get_course_val_query', false);
$this->status_c = array(CST_PREPARATION => $lang->def('_CST_PREPARATION'), CST_AVAILABLE => $lang->def('_CST_AVAILABLE'), CST_EFFECTIVE => $lang->def('_CST_CONFIRMED'), CST_CONCLUDED => $lang->def('_CST_CONCLUDED'), CST_CANCELLED => $lang->def('_CST_CANCELLED'));
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$this->status_u = array(_CUS_CONFIRMED => $lang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $lang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $lang->def('_USER_STATUS_BEGIN'), _CUS_END => $lang->def('_USER_STATUS_END'), _CUS_SUSPEND => $lang->def('_USER_STATUS_SUSPEND'));
}
示例4: __construct
public function __construct()
{
require_once _lms_ . '/lib/lib.subscribe.php';
$this->date_table = $GLOBALS['prefix_lms'] . '_course_date';
$this->day_date_table = $GLOBALS['prefix_lms'] . '_course_date_day';
$this->user_date_table = $GLOBALS['prefix_lms'] . '_course_date_user';
$this->presence_date_table = $GLOBALS['prefix_lms'] . '_course_date_presence';
$this->classroom_table = $GLOBALS['prefix_lms'] . '_classroom';
$this->location_table = $GLOBALS['prefix_lms'] . '_class_location';
$this->course_table = $GLOBALS['prefix_lms'] . '_course';
$this->courseuser_table = $GLOBALS['prefix_lms'] . '_courseuser';
$this->user_table = $GLOBALS['prefix_fw'] . '_user';
$this->lang =& DoceboLanguage::CreateInstance('admin_date', 'lms');
$this->acl_man = $acl_man =& Docebo::user()->getAclManager();
$this->subscribe_man = new CourseSubscribe_Manager();
}
示例5: __construct
public function __construct($id, $initFromSession = false)
{
parent::__construct($id);
$this->jsClassName = 'CourseFolderTree';
$this->serverUrl = 'ajax.adm_server.php?plf=lms&file=category_tree&sf=folder_tree';
Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
require_once _base_ . '/lib/lib.dialog.php';
initDialogs();
$initialShowedNodes = array();
if ($initFromSession) {
if (isset($_SESSION['course_category']['tree_status'])) {
$tree_status =& $_SESSION['course_category']['tree_status'];
//if (isset($tree_status['showed_nodes'])) {}
}
if (isset($_SESSION['course_category']['filter_status'])) {
$filter_status =& $_SESSION['course_category']['filter_status'];
if (isset($filter_status['c_category'])) {
$this->setOption('initialSelectedNode', $filter_status['c_category']);
}
}
}
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
//$this->setOption('langs', array('_ROOT'=>def('_CATEGORY', 'course', 'lms')));
$this->addLangKey('_ROOT', $lang->def('_CATEGORY'));
$this->addLangKey('_YES', $lang->def('_CONFIRM'));
$this->addLangKey('_NO', $lang->def('_UNDO'));
$this->addLangKey('_NEW_FOLDER_NAME', $lang->def('_NEW_CATEGORY'));
$this->addLangKey('_MOD', $lang->def('_MOD'));
$this->addLangKey('_AREYOUSURE', $lang->def('_AREYOUSURE'));
$this->addLangKey('_NAME', $lang->def('_NAME'));
$this->addLangKey('_MOD', $lang->def('_MOD'));
$this->addLangKey('_DEL', $lang->def('_DEL'));
//$this->addLangKey('_', $lang->def(''));
//$selected_node = (isset($_SESSION['course_category']['filter_status']) ? $_SESSION['course_category']['filter_status']['c_category'] : 0); //0 = root node
$tree_status = $this->_getCourseTreeStatus();
//0 = root node
$this->setOption('iconPath', Get::tmpl_path() . 'images/');
$this->setOption('dragdrop', true);
//$this->setOption('initNodes', $initialShowedNodes);
$this->setOption('useCheckboxes', false);
$this->setOption('addFolderButton', 'add_folder_button');
//$this->setOption('initialTreeStatus', $tree_status);
//$this->setOption('options', '');
//$this->setOption('options', '');
}
示例6: login
function login()
{
die;
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.usermanager.php';
$lang =& DoceboLanguage::CreateInstance('login', 'framework');
$out =& $GLOBALS['page'];
$user_manager = new UserManager();
$out->setWorkingZone('content');
$extra = false;
if (isset($GLOBALS['logout'])) {
$extra = array('style' => 'logout_action', 'content' => $lang->def('_UNLOGGED'));
}
if (isset($GLOBALS['access_fail'])) {
$extra = array('style' => 'noaccess', 'content' => $lang->def('_NOACCESS'));
}
$out->add(Form::openForm('admin_box_login', 'index.php?modname=login&op=confirm') . $user_manager->getLoginMask('index.php?modname=login&op=login', $extra) . Form::closeForm());
}
示例7: getHistoryTable
function getHistoryTable($id_user, $id_org, $idscorm_item, $idReference)
{
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(Get::sett('visu_course'));
$lang = DoceboLanguage::CreateInstance('organization', 'lms');
$h_type = array('', '', '', '', '');
$h_content = array($lang->def('_ATTEMPT'), $lang->def('_STATUS'), $lang->def('_SCORE'), $lang->def('_DATE'), $lang->def('_TIME'));
$tb->setColsStyle($h_type);
$tb->addHead($h_content);
$qry = "SELECT t1.* FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking_history as t1 JOIN " . $GLOBALS['prefix_lms'] . "_scorm_tracking as t2 ON (t1.idscorm_tracking=t2.idscorm_tracking) " . " WHERE t2.idscorm_item={$idscorm_item} AND t2.idUser={$id_user} " . " ORDER BY t1.date_action ASC ";
$res = sql_query($qry);
$i = 1;
while ($row = mysql_fetch_assoc($res)) {
$line = array();
$line[] = $lang->def('_ATTEMPT') . ' ' . $i;
$line[] = $row['lesson_status'];
$line[] = $row['score_raw'];
$line[] = Format::date($row['date_action']);
$line[] = decodeSessionTime($row['session_time']);
$tb->addBody($line);
$i++;
}
//title
cout($tb->getTable(), 'content');
}
示例8: view_report_certificate
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');
//.........这里部分代码省略.........
示例9: printOut
//.........这里部分代码省略.........
$local_arr_fields_translation[$nat_id] = $this->lang->def('_DIRECTORY_FILTER_' . $nat_id);
}
$filter_to_show = $this->arr_fields_translation;
if (is_array($this->arr_fields_filter)) {
foreach ($this->arr_fields_filter as $filter_info) {
if (isset($filter_info['fieldname'])) {
unset($filter_to_show[$filter_info['fieldname']]);
} else {
unset($filter_to_show[$filter_info[0]]);
}
}
}
if (is_array($filter_to_show) && !empty($filter_to_show)) {
$out .= $filter->getInputDropdown('new_filter', $this->id . '_add_field_filter', $this->id . '[add_field_filter]', $filter_to_show, '', '');
$out .= $filter->getButton($this->id . '_add_filter', $this->id . '[add_filter]', $this->lang->def('_NEW_FILTER'), 'button_nowh');
}
$out .= $filter->getButton($this->id . '_del_filter', $this->id . '[del_filter]', $this->lang->def('_RESET'), 'button_nowh');
$out .= $filter->closeFormLine();
if (is_array($this->arr_fields_filter)) {
foreach ($this->arr_fields_filter as $field_id => $field_prop) {
if (!isset($field_prop['fieldname'])) {
// custom field
$arr_field_info = $this->field_list->getBaseFieldInfo($field_prop[FIELD_INFO_TYPE]);
require_once $GLOBALS['where_framework'] . '/modules/field/' . $arr_field_info[FIELD_BASEINFO_FILE];
$field_obj = new $arr_field_info[FIELD_BASEINFO_CLASS]($field_id);
$del_spot = '<input type="image" class="cancel_filter" ' . ' src="' . getPathImage('framework') . 'standard/cancel.png"' . ' id="' . $this->id . '_del_filter_' . $field_id . '"' . ' name="' . $this->id . '[del_filter][' . $field_id . ']"' . ' title="' . $this->lang->def('_DEL') . '"' . ' alt="' . $this->lang->def('_DEL') . '" />';
$out .= $field_obj->play_filter($field_id, isset($field_prop['value']) ? $field_prop['value'] : false, $field_prop[FIELD_INFO_TRANSLATION], $this->id, $del_spot, '', $field_prop[FIELD_INFO_ID]);
//play_filter( $id_field, $value = FALSE, $label = FALSE, $field_prefix = FALSE, $other_after = '', $other_before = '', $field_special = FALSE )
} else {
// base field
$arr_field_info = $this->field_list->getBaseFieldInfo($field_prop['field_type']);
require_once $GLOBALS['where_framework'] . '/modules/field/' . $arr_field_info[FIELD_BASEINFO_FILE];
$field_obj = new $arr_field_info[FIELD_BASEINFO_CLASS](0);
$del_spot = '<input type="image" class="cancel_filter" ' . ' src="' . getPathImage('framework') . 'standard/cancel.png"' . ' id="' . $this->id . '_del_filter_' . $field_id . '"' . ' name="' . $this->id . '[del_filter][' . $field_id . ']"' . ' title="' . $this->lang->def('_DEL') . '"' . ' alt="' . $this->lang->def('_DEL') . '" />';
$out .= $field_obj->play_filter($field_id, isset($field_prop['value']) ? $field_prop['value'] : false, $this->lang->def('_DIRECTORY_FILTER_' . $field_prop['fieldname']), $this->id, $del_spot, '', '');
}
}
}
$out .= $filter->openButtonSpace();
$out .= $filter->getButton('search', 'search', $this->lang->def('_SEARCH'));
$out .= $filter->closeButtonSpace();
}
// end else for filter
$out .= $filter->getCloseFieldset();
// ---------------------------------------------------------------------------------------
// set order rows
if (is_array($this->arr_fields_order)) {
foreach ($this->arr_fields_order as $ordFieldName => $isDesc) {
$this->data->setOrderCol($ordFieldName, $isDesc);
}
}
$this->getRows($this->_getStartRow(), $this->_getRowsPage());
$totRow = $this->getTotalRows();
if ($totRow == -1) {
$totRow = $this->getLoadedRows();
}
$colInfo = $this->_getCols();
$colData = $colInfo;
$this->rend->setCaption($this->_getTitle());
$type_h = array();
$cont_h = array();
while (list($key, $contentCell) = each($colInfo)) {
if ($contentCell['toDisplay']) {
$type_h[] = $contentCell['hClass'];
$cont_h[] = $contentCell['hLabel'];
}
}
reset($colInfo);
$this->rend->addHead($cont_h, $type_h);
while ($values = $this->fetchRecord()) {
$colData = array();
foreach ($colInfo as $key => $fieldInfo) {
$colData[] = $values[$colInfo[$key]['data']];
}
$this->rend->addBody($colData, false, false, 'user_row_' . $values['idst']);
if ($this->_expand_user == $values['idst']) {
// extra user info if requested
$this->rend->addBodyExpanded($this->userExtraData($this->_expand_user), 'user_more_info');
}
}
if ($this->insNew) {
$this->rend->addActionAdd('<input type="submit" class="transparent_add_button"' . ' id="' . $this->id . '_' . $this->_getOpCreateItemId() . '" ' . ' name="' . $this->id . '[' . $this->_getOpCreateItemId() . '][0]" ' . ' value="' . $this->lang->def('_ADD') . '"' . ' title="' . $this->_getCreateLabel() . '" ' . ' alt="' . $this->_getCreateAlt() . '" />');
}
$this->rend->initNavBar($this->_getIdInitRowId(), 'button');
$out .= $this->rend->getTable() . $this->rend->getNavBar($this->_getStartRow(), $totRow) . $this->printState();
//prepare delete confirm popups [id format: "usersmembersdirectory__listview_opdeleteitem__" ]
$lang =& DoceboLanguage::CreateInstance('standard');
require_once _base_ . '/lib/lib.dialog.php';
setupFormDialogBox('directory_org_chart', 'index.php?modname=directory&op=org_chart', 'input[name*=_listview_opdeleteitem_]', $lang->def('_AREYOUSURE'), $lang->def('_CONFIRM'), $lang->def('_UNDO'), 'function(o) { return o.title; }', 'usersmembersdirectory__listview_opdeleteitem__', 'idst', 'deleteperson');
//tree remove user from branch confirm popup
setupSimpleFormDialogBox('directory_org_chart', 'input[name*=_listview_opremoveitem_]');
// ---------------------------------------------------------------------------------------
if ($this->select_all) {
$arr_notPrint = array_diff($this->itemSelectedMulti, $this->printedItems);
foreach ($arr_notPrint as $id_notPrint) {
$out .= '<input type="checkbox" ' . ' id="' . DIRECTORY_ID . DIRECTORY_OP_SELECTITEM . '_' . $id_notPrint . '" ' . 'name="' . DIRECTORY_ID . '[' . DIRECTORY_OP_SELECTITEM . '][' . $id_notPrint . ']" ' . 'value="" checked="checked" style="display:none;" />';
}
}
return $out;
}
示例10: view_report_certificate
//.........这里部分代码省略.........
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'];
示例11: Categorytree
| License http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt |
| |
| from docebo 4.0.5 CE 2008-2012 (c) docebo |
| License http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt |
\ ======================================================================== */
require_once _lms_ . '/lib/category/class.categorytree.php';
$treecat = new Categorytree();
require_once _base_ . '/lib/lib.json.php';
$json = new Services_JSON();
//checkPerm('view', true, 'course', 'lms');
require_once _lms_ . '/lib/folder_tree/lib.category_tree.php';
// Resolve the requested action
$command = Get::req('command', DOTY_STRING, false);
switch ($command) {
case "expand":
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$node_id = Get::req('node_id', DOTY_INT, 0);
$initial = Get::req('initial', DOTY_INT, 0);
//$initial = 0;
$result = array();
if ($initial == 1) {
if (!isset($_SESSION['course_category']['filter_status']['c_category'])) {
$_SESSION['course_category']['filter_status']['c_category'] = 0;
}
$treestatus =& $_SESSION['course_category']['filter_status']['c_category'];
$result = array();
$folders = $treecat->getOpenedFolders($treestatus);
$ref =& $result;
foreach ($folders as $folder) {
if ($folder > 0) {
for ($i = 0; $i < count($ref); $i++) {
示例12: __construct
public function __construct($id)
{
parent::__construct($id);
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
if (Docebo::user()->getUserLevelId() == ADMIN_GROUP_PUBLICADMIN) {
$this->serverUrl = Get::rel_path('lms') . '/ajax.server.php?plf=lms&file=coursetableview&sf=table_view';
$this->addFormatter("man_subscr", 'courseFormatters.p_man_subscr');
} else {
$this->serverUrl = Get::rel_path('lms') . '/ajax.adm_server.php?plf=lms&file=coursetableview&sf=table_view';
$this->addFormatter("man_subscr", 'courseFormatters.man_subscr');
}
$this->addFormatter("classroom", 'courseFormatters.classroom');
$this->addFormatter("certificate", 'courseFormatters.certificate');
$this->addFormatter("competence", 'courseFormatters.competence');
$this->addFormatter("menu", 'courseFormatters.menu');
$this->addFormatter("mod", 'courseFormatters.mod');
$array_columns = array();
if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "code", "label" => $lang->def("_CODE"), "sortable" => true, "className" => 'min-cell', 'editor' => 'new YAHOO.widget.TextboxCellEditor({asyncSubmitter: saveData})');
$array_columns[] = array("key" => "name", "label" => $lang->def("_COURSE_NAME"), "sortable" => true, 'editor' => 'new YAHOO.widget.TextboxCellEditor({asyncSubmitter: saveData})');
} else {
$array_columns[] = array("key" => "code", "label" => $lang->def("_CODE"), "sortable" => true, "className" => 'min-cell');
$array_columns[] = array("key" => "name", "label" => $lang->def("_COURSE_NAME"), "sortable" => true);
}
//if(checkPerm('moderate', true, 'course', 'lms') || checkPerm('moderate', true, 'public_course_admin', 'lms'))
$array_columns[] = array("key" => "waiting", "label" => $lang->def("_WAITING_USERS"), "className" => 'img-cell');
if (checkPerm('subscribe', true, 'course', 'lms') || checkPerm('subscribe', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "subscriptions", "label" => Get::img('course/subscribe.png', $lang->def('_SUBSCRIBE')), "sortable" => true, "className" => 'img-cell', "formatter" => $this->getCellFormatter("man_subscr"));
}
if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "classroom", "label" => Get::img('course/classroom-cal.png', $lang->def('_CLASSROOM')), "className" => 'img-cell');
$array_columns[] = array("key" => "certificate", "label" => Get::img('course/certificate.png', Lang::t('_CERTIFICATE', 'certificate', 'lms')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("certificate"));
$array_columns[] = array("key" => "competence", "label" => Get::img('course/competences.png', Lang::t('_COMPETENCES', 'competences', 'lms')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("competence"));
$array_columns[] = array("key" => "menu", "label" => Get::img('course/menu.png', $lang->def('_ASSIGN_MENU')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("menu"));
}
if (checkPerm('add', true, 'course', 'lms') || checkPerm('add', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "dup", "label" => Get::img('standard/dup.png', $lang->def('_MAKE_A_COPY')), "className" => 'img-cell');
}
if (checkPerm('mod', true, 'course', 'lms') || checkPerm('mod', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "mod", "label" => Get::img('standard/edit.png', $lang->def('_MOD')), "className" => 'img-cell', "formatter" => $this->getCellFormatter("mod"));
}
if (checkPerm('del', true, 'course', 'lms') || checkPerm('del', true, 'public_course_admin', 'lms')) {
$array_columns[] = array("key" => "del", "label" => Get::img('standard/delete.png', $lang->def('_DEL')), "className" => 'img-cell', "formatter" => $this->getCellFormatter('delete'));
}
$this->columns = $array_columns;
$this->fields = array("idCourse", "code", "name", "status", "waiting", "subscriptions", "classroom", "certificate", "competence", "menu", "dup", "mod", "del");
$this->addOption('langs', array('_START' => $lang->def('_START'), '_PREV' => $lang->def('_PREV'), '_NEXT' => $lang->def('_NEXT'), '_END' => $lang->def('_END'), '_OF' => $lang->def('_OF'), 'MSG_EMPTY' => $lang->def('_EMPTY'), 'MSG_ERROR' => $lang->def('_SERVER_CONNECTION_ERROR'), 'MSG_LOADING' => $lang->def('_LOADING'), '_YES' => $lang->def('_CONFIRM'), '_NO' => $lang->def('_UNDO'), '_AREYOUSURE' => $lang->def('_AREYOUSURE'), '_DEL' => $lang->def('_DEL'), '_SERVER_CONNECTION_ERROR' => $lang->def('_SERVER_CONNECTION_ERROR')));
if (!isset($_SESSION['course_category']['filter_status'])) {
$_SESSION['course_category']['filter_status'] = array('c_category' => 0, 'c_filter' => '', 'c_flatview' => true, 'c_waiting' => false);
} else {
$filter =& $_SESSION['course_category']['filter_status'];
if (!isset($filter['c_category'])) {
$_SESSION['course_category']['filter_status']['c_category'] = 0;
}
if (!isset($filter['c_filter'])) {
$_SESSION['course_category']['filter_status']['c_filter'] = '';
}
if (!isset($filter['c_flatview'])) {
$_SESSION['course_category']['filter_status']['c_flatview'] = true;
}
if (!isset($filter['c_waiting'])) {
$_SESSION['course_category']['filter_status']['c_waiting'] = '';
}
}
$filter =& $_SESSION['course_category']['filter_status'];
$this->addOption('baseUrl', 'index.php');
$this->addOption('imageUrl', Get::tmpl_path('base') . 'images/');
$this->addOption('initialFilter', array('c_category' => array('operator' => '', 'value' => $filter['c_category']), 'c_filter' => array('operator' => '', 'value' => $filter['c_filter']), 'c_flatview' => array('operator' => '', 'value' => $filter['c_flatview']), 'c_waiting' => array('operator' => '', 'value' => $filter['c_waiting'])));
$this->addOption('deleteDialog', array('id' => 'idCourse', 'name' => 'name'));
}
示例13: getUserCourseStat
/**
* retrive the user statistic in the lms
*/
function getUserCourseStat($id_user)
{
require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
$stats = array();
$c_lang =& DoceboLanguage::CreateInstance('course', 'lms');
$lang =& DoceboLanguage::createInstance('course', 'lms');
$id_courses = array();
$query_course_user = "\r\n\t\tSELECT c.idCourse, c.code, c.name, c.status,\r\n\t\t\tcu.status, cu.date_inscr, cu.date_first_access, cu.date_complete\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_courseuser AS cu\r\n\t\t\tJOIN " . $GLOBALS['prefix_lms'] . "_course AS c\r\n\t\tWHERE cu.idCourse = c.idCourse\r\n\t\t\tAND cu.idUser = '" . $id_user . "'";
$re_course_user = sql_query($query_course_user);
while (list($id_c, $code, $name, $status, $status_user, $date_inscr, $date_first_access, $date_complete) = sql_fetch_row($re_course_user)) {
$id_courses[] = $id_c;
$stats[$id_c]['course_name'] = $name;
$stats[$id_c]['course_code'] = $code;
$course_status = array(CST_PREPARATION => $c_lang->def('_CST_PREPARATION', 'course', 'lms'), CST_AVAILABLE => $c_lang->def('_CST_AVAILABLE', 'course', 'lms'), CST_EFFECTIVE => $c_lang->def('_CST_CONFIRMED', 'course', 'lms'), CST_CONCLUDED => $c_lang->def('_CST_CONCLUDED', 'course', 'lms'), CST_CANCELLED => $c_lang->def('_CST_CANCELLED', 'course', 'lms'));
$stats[$id_c]['course_status'] = $course_status[$status];
$cman = new CourseSubscribe_Manager();
$arr_status = $cman->getUserStatus();
$stats[$id_c]['user_status'] = isset($arr_status[$status_user]) ? $arr_status[$status_user] : "";
$stats[$id_c]['date_inscr'] = $date_inscr;
$stats[$id_c]['date_first_access'] = $date_first_access;
$stats[$id_c]['date_complete'] = $date_complete;
$stats[$id_c]['score_init'] = '';
$stats[$id_c]['score_final'] = '';
$stats[$id_c]['access_count'] = '';
$stats[$id_c]['access_time'] = '';
$stats[$id_c]['access_last'] = '';
$stats[$id_c]['point_do'] = '';
}
//recover start and final score
require_once $GLOBALS['where_lms'] . '/lib/lib.orgchart.php';
$org_man = new OrganizationManagement(false);
require_once $GLOBALS['where_lms'] . '/lib/lib.coursereport.php';
$rep_man = new CourseReportManager();
$score_course = $rep_man->getUserFinalScore(array($id_user));
$score_start = $org_man->getStartObjectScore(array($id_user), $id_courses);
$score_final = $org_man->getFinalObjectScore(array($id_user), $id_courses);
while (list(, $id_c) = each($id_courses)) {
if (isset($stats[$id_c])) {
$stats[$id_c]['score_init'] = isset($score_start[$id_c][$id_user]) && $score_start[$id_c][$id_user]['max_score'] ? $score_start[$id_c][$id_user]['score'] . ' / ' . $score_start[$id_c][$id_user]['max_score'] : '';
$stats[$id_c]['score_final'] = isset($score_final[$id_c][$id_user]) && $score_final[$id_c][$id_user]['max_score'] ? $score_final[$id_c][$id_user]['score'] . ' / ' . $score_final[$id_c][$id_user]['max_score'] : '';
}
$point_do = isset($score_course[$id_user][$id_c]) ? $score_course[$id_user][$id_c]['score'] : '';
$point_max = isset($score_course[$id_user][$id_c]) ? $score_course[$id_user][$id_c]['max_score'] : '';
$stats[$id_c]['point_do'] = $point_do !== '' ? number_format($point_do, 2) . ' / ' . number_format($point_max, 2) : '';
}
$query = "\r\n\t\tSELECT idCourse, COUNT(*), SUM(UNIX_TIMESTAMP(lastTime) - UNIX_TIMESTAMP(enterTime)), MAX(lastTime)\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_tracksession\r\n\t\tWHERE idUser = '" . $id_user . "'\r\n\t\tGROUP BY idCourse ";
$re_time = sql_query($query);
while (list($id_c, $session_num, $time_num, $last_num) = sql_fetch_row($re_time)) {
if (isset($stats[$id_c])) {
$stats[$id_c]['access_count'] = $session_num;
$stats[$id_c]['access_time'] = $time_num;
$stats[$id_c]['access_last'] = $last_num;
}
}
return $stats;
}
示例14: presence
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;
//.........这里部分代码省略.........
示例15: classroomToEdition
function classroomToEdition()
{
require_once _base_ . '/lib/lib.form.php';
//require_once(_i18n_.'/lib.lang.php');
require_once _base_ . '/lib/lib.table.php';
require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
if (isset($_POST['classroom_to_edition'])) {
list($edition_id) = each($_POST['classroom_to_edition']);
} else {
$edition_id = importVar('edition_id', true, 0);
}
$of_loc = importVar('of_loc', false, '');
$of_name = importVar('of_name', false, '');
$form = new Form();
$query_course_name = "SELECT idCourse, name\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $edition_id . "'";
list($idCourse, $edition_name) = sql_fetch_row(sql_query($query_course_name));
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'));
$tb->initNavBar('ini', 'link');
$tb->setLink("index.php?modname=course&op=classroom_to_edition&edition_id={$edition_id}" . '&of_loc=' . $of_loc . '&of_name=' . $of_name);
$ini = $tb->getSelectedElement();
$checked_class = checkAvailableClass($idCourse, $edition_id);
$classroom_order = "l.location, c.name ";
if ($of_loc == 'loc') {
$classroom_order = "l.location, c.name ";
}
if ($of_loc == 'locd') {
$classroom_order = "l.location DESC, c.name ";
}
if ($of_name == 'name') {
$classroom_order = "c.name, l.location ";
}
if ($of_name == 'namec') {
$classroom_order = "c.name DESC, l.location ";
}
if ($of_loc == '' && $of_name == '') {
$of_loc = 'loc';
}
//search query of classrooms ---------------------------------
$query_classroom = "\r\n\tSELECT c.idClassroom, c.name, c.description, l.location\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom AS c\r\n\t\tJOIN " . $GLOBALS['prefix_lms'] . "_class_location AS l\r\n\tWHERE l.location_id = c.location_id\r\n\tORDER BY " . $classroom_order . "\r\n\tLIMIT {$ini}," . Get::sett('visuItem');
$re_classroom = sql_query($query_classroom);
// search classrooms assigned --------------------------------
$query_class_assigned = "\r\n\tSELECT classrooms\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\twhere idCourseEdition= " . $edition_id . "";
list($assigned_classroom) = sql_fetch_row(sql_query($query_class_assigned));
$query_classroom_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom ";
list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot));
// table intestation
$type_h = array('', '', '', 'image');
$cont_h = array('<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_loc=" . ($of_loc == 'loc' ? 'locd' : 'loc') . '">' . ($of_loc == 'loc' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_loc == 'locd' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_LOCATION') . '</a>', '<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_name=" . ($of_name == 'name' ? 'named' : 'name') . '">' . ($of_name == 'name' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_name == 'named' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_CLASSROOM', 'course') . '</a>', $lang->def('_STATUS'), $lang->def('_USETHIS'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$class_room_to_edition = array();
while (list($idClassroom, $name, $descr, $location) = sql_fetch_row($re_classroom)) {
$cont = array('<label for="class_room_to_edition_' . $idClassroom . '">' . $location . '</label>', '<label for="class_room_to_edition_' . $idClassroom . '">' . $name . '</label>');
if (isset($checked_class[$idClassroom])) {
$cont[] = $lang->def('_CLASSROOM_OCCUPATED_YES');
} else {
$cont[] = '';
}
$cont[] = $form->getRadio('', 'class_room_to_edition_' . $idClassroom . '', 'class_room_to_edition', $idClassroom, $assigned_classroom == $idClassroom);
$tb->addBody($cont);
}
$page_title = array('index.php?modname=course&op=course_list' => $lang->def('_CLASSROOM'), $edition_name);
$GLOBALS['page']->add(getTitleArea($page_title, 'classroomtocourse', $lang->def('_CLASSROOM')) . '<div class="std_block">' . ($checked_class !== false ? getResultUi($lang->def('_CLASSROOM_OCCUPATED')) : '') . getBackUi('index.php?modname=course&op=course_list', $lang->def('_BACK')) . $form->openForm('assignEditionClassroom', 'index.php?modname=course&op=assignEditionClassroom', false, false, 'multipart/form-data') . $form->getHidden('edition_id', 'edition_id', $edition_id) . $form->getHidden('idCourse', 'idCourse', $idCourse) . $tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . $form->openButtonSpace() . $form->getButton('assignEditionClassroom', 'assignEditionClassroom', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}