Ejemplo n.º 1
0
    function showListCourse(&$rows, &$pageNav, $option, &$lists)
    {
        ?>
	<script type="text/javascript">	
	<!--
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (form.course_id.options[form.course_id.selectedIndex].value == 0 || form.course_id.options[form.course_id.selectedIndex].value == '0') {
			alert('<?php 
        echo _JLMS_USERS_MSG_FLTR_BY_CRS;
        ?>
');
		} else {
			form.page.value = pressbutton;
			form.submit();
		}
	}
	<?php 
        if (JLMS_J16version()) {
            ?>
	Joomla.submitbutton = submitbutton;
	<?php 
        }
        ?>
	//-->
	</script>
<form action="index.php" method="post" name="adminForm">
<table width="100%" >
	<tr>
		<td valign="top" width="220px">
		<div>
			<?php 
        echo joomla_lms_adm_html::JLMS_menu();
        ?>
		</div>
		</td>
		<td valign="top">	
	<?php 
        if (!class_exists('JToolBarHelper')) {
            ?>
	
		<table class="adminheading">
		<tr>
			<th class="user">
			<?php 
            echo _JOOMLMS_COMP_NAME;
            ?>
: <small><?php 
            echo _JLMS_USERS_LIST;
            ?>
</small>
			</th>
			<td width="right">
				<?php 
            ALU_html::showFilterListCourse($lists);
            ?>
			</td>
		</tr>
		</table>
		<?php 
        } else {
            ALU_html::showFilterListCourse($lists, 1);
        }
        ?>
		
		<table width="100%" border="0">
			<tr>
				<td valign="top">
					<table class="adminlist">
					<thead>
						<tr>
							<th width="20">#</th>
							<th width="20" class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></th>
							<th class="title"><?php 
        echo _JLMS_USERNAME;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_NAME;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_EMAIL;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_ROLE;
        ?>
</th>
							<th class="title"><?php 
        echo _JLMS_COURSE;
        ?>
</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="7">
							<?php 
        echo $pageNav->getListFooter();
        ?>
							</td>
						</tr>
					</tfoot>
					<tbody>
					<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $checked = mosHTML::idBox($i, $row->id);
            ?>
						<tr class="<?php 
            echo "row{$k}";
            ?>
">
							<td><?php 
            echo $pageNav->rowNumber($i);
            ?>
</td>
							<td><?php 
            echo $checked;
            ?>
</td>
							<?php 
            if (!$row->username || !$row->username) {
                ?>
							<td align="left" colspan="3">
								<?php 
                echo _JLMS_USERS_USR_WAS_REMOVED;
                ?>
							</td>
							<?php 
            } else {
                ?>
							<td align="left">
								<?php 
                echo $row->username;
                ?>
							</td>
							<td align="left">
								<?php 
                echo $row->name;
                ?>
							</td>
							<td align="left">
								<?php 
                echo $row->email;
                ?>
							</td>
							<?php 
            }
            ?>
							<td align="left">
								<?php 
            echo $row->lms_usertype;
            ?>
							</td>
							<td align="left"><?php 
            echo $row->course_name . " (ID: " . $row->course_id . ")";
            ?>
</td>
						</tr>
						<?php 
            $k = 1 - $k;
        }
        ?>
					</tbody>
					</table>
				</td>
			</tr>
		</table>	
	</td></tr></table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="lms_users" />
		<input type="hidden" name="page" value="" />
		
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />		
		</form>
		<?php 
    }
Ejemplo n.º 2
0
function ALU_editItem($id, $option)
{
    $db =& JFactory::GetDbo();
    $cid = mosGetParam($_POST, 'cid', mosGetParam($_GET, 'cid', array(0)));
    if (!is_array($cid)) {
        $cid = array(0);
    }
    $group_id = intval($cid[0]);
    if (!$group_id) {
        $group_id = mosGetParam($_REQUEST, 'filt_groups');
    }
    $redirect = mosGetParam($_REQUEST, 'page');
    $id = mosGetParam($_REQUEST, 'cid', array(0));
    $rows_groups = array();
    $row->user_id = 0;
    if ($id[0]) {
        $one_elem = explode('_', $id[0]);
        $X = isset($one_elem[0]) ? intval($one_elem[0]) : 0;
        $Y = isset($one_elem[1]) ? intval($one_elem[1]) : 0;
        if ($X && $Y) {
            $query = "SELECT a.*,b.* FROM #__lms_user_assign_groups as a, #__users as b WHERE a.user_id = {$X} AND a.group_id = {$Y} AND b.id = a.user_id";
            $db->setQuery($query);
            $row = $db->LoadObject();
            $group_id = $row->group_id;
            $query = "SELECT b.ug_name FROM #__lms_user_assign_groups as a, #__lms_usergroups as b WHERE a.user_id = {$X} AND a.group_id = b.id ORDER BY b.ug_name";
            $db->setQuery($query);
            $rows_groups = $db->LoadObjectList();
        }
    }
    $lists = array();
    $query = "SELECT id as value, ug_name as text FROM #__lms_usergroups WHERE course_id = 0 AND parent_id = 0 ORDER by ug_name";
    $db->setQuery($query);
    $ug_names = $db->loadObjectList();
    $list_ug_names = array();
    $list_ug_names[] = mosHTML::makeOption('0', _JLMS_USERS_SLCT_USR_GR_);
    $list_ug_names = array_merge($list_ug_names, $ug_names);
    $lists['ug_names'] = mosHTML::selectList($list_ug_names, 'group_id', 'class="text_area" size="1" style="width:266px"', 'value', 'text', $group_id);
    $query = "SELECT a.id as value, a.name as text FROM #__users AS a, #__lms_users AS b WHERE a.id = b.user_id ORDER BY name";
    $db->SetQuery($query);
    $list_users = array();
    $list_users[] = mosHTML::makeOption('0', _JLMS_USERS_NAME_);
    $pr = $db->loadObjectList();
    $list_users = array_merge($list_users, $pr);
    $lists['users_names'] = mosHTML::selectList($list_users, 'user_id', 'class="text_area" style="width:266px" size="1"', 'value', 'text', $row->user_id);
    ALU_html::editItem($row, $lists, $option, $redirect, $rows_groups);
}