function showpageTracking($id, $option, &$rows, &$lists)
    {
        $JLMS_CONFIG =& JLMSFactory::getConfig();
        $JLMS_SESSION =& JLMSFactory::getSession();
        $Itemid = $JLMS_CONFIG->get('Itemid');
        global $my;
        JLMS_TMPL::OpenMT();
        $hparams = array();
        $page_13_stats_shown = false;
        $page_12_stats_shown = false;
        $page_14_stats_shown = false;
        if ($lists['page'] == 12) {
            $hparams['second_tb_header'] = _JLMS_TRACKING_DOCUMENTS_STATISTICS;
        } elseif ($lists['page'] == 13) {
            $hparams['second_tb_header'] = _JLMS_TRACKING_LPATHS_STATISTICS;
        } elseif ($lists['page'] == 14) {
            $hparams['second_tb_header'] = _JLMS_TRACKING_LATEST_COURSE_ACTIVITIES_REPORT;
        } else {
            $hparams['second_tb_header'] = _JLMS_TRACK_TITLE_ACCESS . JLMS_TRACKING_getTitle($lists['page']);
        }
        $toolbar = array();
        $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=tracking&id={$id}"));
        JLMS_TMPL::ShowHeader('tracking', _JLMS_TRACK_TITLE, $hparams, $toolbar);
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}");
        ?>
" method="post" name="adminForm">
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
				<tr>
					<td align="right" style="text-align:right ">
						<div align="right" style="white-space:nowrap ">
						<?php 
        if ($lists['page'] == 12 || $lists['page'] == 13 || $lists['page'] == 14) {
            //only group and user filters
            if (isset($lists['filter_lpath']) && $lists['page'] == 13) {
                echo $lists['filter_lpath'] . '<br />';
            }
            if (isset($lists['filter2'])) {
                echo $lists['filter2'] . '<br />';
            }
            if (isset($lists['filter3'])) {
                echo $lists['filter3'] . '<br />';
            }
            echo $lists['filter_stu'] . '<br />';
        } else {
            echo $lists['filter_pages'] . $lists['filter'] . $lists['filter_month'] . $lists['filter_day'];
            ?>
<br />
							<?php 
            /*if(isset($lists['filter_lpath'])){
            			echo $lists['filter_lpath'].'<br />';
            		}*/
            if (isset($lists['filter2'])) {
                echo $lists['filter2'] . '<br />';
            }
            if (isset($lists['filter3'])) {
                echo $lists['filter3'] . '<br />';
            }
            echo $lists['filter_stu'] . '<br />';
        }
        ?>
						</div>
					</td>
				</tr>
			</table>
<?php 
        if ($lists['page'] == 12 || $lists['page'] == 13 || $lists['page'] == 14) {
            //do nothing
        } else {
            //show hits statistics
            ?>
	<?php 
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=tracking&amp;id={$id}";
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_TRACK_TBL_H_STU;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
            $rr = array();
            if ($lists['is_day']) {
                foreach ($lists['months'] as $ma) {
                    echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" align="center">' . JLMS_dateToDisplay(mktime(0, 0, 0, $ma->month, $ma->day, $ma->year), true) . '</' . JLMSCSS::tableheadertag() . '>';
                    $rr[] = $ma->month;
                }
            } else {
                foreach ($lists['months'] as $ma) {
                    echo '<' . JLMSCSS::tableheadertag() . ' class="' . JLMSCSS::_('sectiontableheader') . '" align="center">' . month_lang(strftime('%m', mktime(0, 0, 0, $ma->month + 1, 0, 0)), 0, 2) . ', ' . $ma->year . '</' . JLMSCSS::tableheadertag() . '>';
                    $rr[] = $ma->month;
                }
            }
            ?>
				</tr>
			<?php 
            $k = 1;
            $i = 0;
            $total_counts = array();
            for ($j = 0; $j < count($lists['months']); $j++) {
                $total_counts[$j] = 0;
            }
            while ($i < count($rows)) {
                $row = $rows[$i];
                $link = '';
                $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=tracking&amp;id={$id}&amp;filter_stu=" . $row->user_id . "&amp;page=" . $lists['page'];
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td align="left" valign="middle" style="vertical-align:middle ">
						<a href="<?php 
                echo sefRelToAbs($link);
                ?>
" title="<?php 
                echo _JLMS_VIEW_DETAILS;
                ?>
">
							<?php 
                echo $row->username;
                ?>
						</a>
					</td>
					<?php 
                #$j = $lists['month']-1;
                $e = 0;
                $user = $rows[$i]->user_id;
                #$month = $rows[$i]->month;
                #$year = $rows[$i]->year;
                do {
                    if ($lists['is_day']) {
                        while (($lists['months'][$e]->day != $rows[$i]->day || $lists['months'][$e]->month != $rows[$i]->month || $lists['months'][$e]->year != $rows[$i]->year) && $e < count($lists['months'])) {
                            echo '<td align="center">0</td>';
                            $e++;
                        }
                        if ($rows[$i]->user_id == $user && $rows[$i]->day == $lists['months'][$e]->day && $rows[$i]->month == $lists['months'][$e]->month && $rows[$i]->year == $lists['months'][$e]->year) {
                            echo '<td align="center">' . $rows[$i]->count_hits . '</td>';
                            $total_counts[$e] = $total_counts[$e] + $rows[$i]->count_hits;
                        }
                    } else {
                        while (($lists['months'][$e]->month != $rows[$i]->month || $lists['months'][$e]->year != $rows[$i]->year) && $e < count($lists['months'])) {
                            echo '<td align="center">0</td>';
                            $e++;
                        }
                        if ($rows[$i]->user_id == $user && $rows[$i]->month == $lists['months'][$e]->month && $rows[$i]->year == $lists['months'][$e]->year) {
                            echo '<td align="center">' . $rows[$i]->count_hits . '</td>';
                            $total_counts[$e] = $total_counts[$e] + $rows[$i]->count_hits;
                        }
                    }
                    #$j ++;
                    $e++;
                    $i++;
                } while ($i < count($rows) && $rows[$i]->user_id == $user);
                while ($e < count($lists['months'])) {
                    echo '<td align="center">0</td>';
                    $e++;
                }
                if (isset($rows[$i]->user_id) && $rows[$i]->user_id != $user) {
                    $i--;
                }
                ?>
				</tr>
				<?php 
                $k = 3 - $k;
                $i++;
            }
            ?>
				<tr class="<?php 
            echo JLMSCSS::_('sectiontableentry' . $k);
            ?>
">
					<td align="left" valign="middle" style="vertical-align:middle "><?php 
            echo _JLMS_TOTAL;
            ?>
</td>
					<?php 
            for ($j = 0; $j < count($lists['months']); $j++) {
                echo '<td align="center"><strong>' . $total_counts[$j] . '</strong></td>';
            }
            ?>
				</tr>
			</table>
			<br /><br />
<?php 
        }
        ?>
		<?php 
        if ($lists['page'] == 14 && isset($lists['page14_stats']) && !empty($lists['page14_stats'])) {
            $page_14_stats_shown = true;
            ?>
		
			<script type="text/javascript">
				function submitbutton(pressbutton){
					var form = document.adminForm;
					form.view.value = pressbutton;
					form.submit();
				}
			</script>
		
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="20">#</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">
					<?php 
            echo _JLMS_TRACK_TBL_H_STU;
            ?>
					</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">
					&nbsp;
					</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">
					<?php 
            echo _JLMS_TRACK_TBL_H_ACTIVITY;
            ?>
					</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">
					<?php 
            echo _JLMS_TRACK_TBL_H_TIME;
            ?>
					</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $limit = intval(mosGetParam($_GET, 'limit', $JLMS_SESSION->get('list_limit', $JLMS_CONFIG->getCfg('list_limit'))));
            $JLMS_SESSION->set('list_limit', $limit);
            $limitstart = intval(mosGetParam($_GET, 'limitstart', 0));
            $total = count($lists['page14_stats']);
            require_once _JOOMLMS_FRONT_HOME . DS . "includes" . DS . "classes" . DS . "lms.pagination.php";
            $pageNav = new JLMSPageNav($total, $limitstart, $limit);
            $k = 1;
            $count_activities = 0;
            $items_counter = 0;
            foreach ($lists['page14_stats'] as $latest_activity) {
                if ($count_activities >= $pageNav->limitstart && $count_activities < $pageNav->limitstart + $pageNav->limit) {
                    echo '<tr class="' . JLMSCSS::_('sectiontableentry' . $k) . '">';
                    echo '<td>';
                    echo $pageNav->limitstart + $items_counter + 1;
                    echo '</td>';
                    echo '<td>' . $latest_activity->user . '</td>';
                    echo '<td width="16"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/' . $latest_activity->icon . '" alt="i" width="16" height="16" border="0" /></td>';
                    echo '<td>' . $latest_activity->activity . '</td>';
                    echo '<td>' . JLMS_dateToDisplay($latest_activity->time, true, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s') . '</td>';
                    echo '</tr>';
                    $k = 3 - $k;
                    $items_counter++;
                }
                $count_activities++;
            }
            ?>
			<tr>
				<td colspan="5" align="center"class="<?php 
            echo JLMSCSS::_('jlmslist-footer_td');
            ?>
">
					<div align="center">
					<?php 
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=tracking&amp;id={$id}&amp;page=14";
            echo $pageNav->writePagesLinks($link);
            ?>
					</div>
				</td>
			</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" class="jlms_table_no_borders">
			<tr>
				<td align="center">
					<?php 
            $controls = array();
            $controls[] = array('href' => "javascript:submitbutton('csv');", 'title' => 'CSV', 'img' => 'csv');
            $controls[] = array('href' => "javascript:submitbutton('xls');", 'title' => 'XLS', 'img' => 'xls');
            JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':');
            ?>
	
				</td>
			</tr>
			</table>
		<?php 
        } elseif ($lists['page'] == 14 && !$page_14_stats_shown) {
            echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>';
        } elseif ($lists['page'] == 12 && $lists['filter_stu_val'] && isset($lists['page12_stats']) && !empty($lists['page12_stats'])) {
            $page_12_stats_shown = true;
            $max_tree_width = 0;
            if (isset($lists['page12_stats'][0])) {
                $max_tree_width = $lists['page12_stats'][0]->tree_max_width;
            }
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="<?php 
            echo 16 * ($max_tree_width + 1);
            ?>
" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" colspan="<?php 
            echo $max_tree_width + 1;
            ?>
">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="45%"><?php 
            echo _JLMS_TRACK_TBL_DOC_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_TRACK_TBL_DOC_DOWNS;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_TRACK_TBL_DOC_LAST;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            $tree_modes = array();
            for ($i = 0, $n = count($lists['page12_stats']); $i < $n; $i++) {
                $row_doc = $lists['page12_stats'][$i];
                $max_tree_width = $row_doc->tree_max_width;
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<?php 
                $add_img = '';
                if ($row_doc->tree_mode_num) {
                    $g = 0;
                    $tree_modes[$row_doc->tree_mode_num - 1] = $row_doc->tree_mode;
                    while ($g < $row_doc->tree_mode_num - 1) {
                        $pref = '';
                        if (isset($tree_modes[$g]) && $tree_modes[$g] == 2) {
                            $pref = 'empty_';
                        }
                        $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/" . $pref . "line.png\" width='16' height='16' /></td>";
                        $g++;
                    }
                    $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/sub" . $row_doc->tree_mode . ".png\" width='16' height='16' /></td>";
                    $max_tree_width = $max_tree_width - $g - 1;
                }
                echo $add_img;
                ?>
					<td align="center" valign="middle" style="vertical-align:middle " width='16'>
					<?php 
                if ($row_doc->folder_flag == 1) {
                    echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/folder.png\" width='16' height='16' alt='Folder' /></span>";
                } else {
                    echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row_doc->file_icon . ".png\" width='16' height='16' alt='File' /></span>";
                }
                ?>
					</td>
					<td align="left" valign="middle" <?php 
                if ($max_tree_width > 0) {
                    echo "colspan='" . ($max_tree_width + 1) . "'";
                }
                ?>
 width="35%">
					<?php 
                if ($row_doc->folder_flag || !$row_doc->folder_flag && !$row_doc->file_id) {
                    echo '<strong>' . $row_doc->doc_name . '</strong>';
                } else {
                    echo $row_doc->doc_name;
                }
                ?>
					</td>
					<td valign="middle" align="center">
						<?php 
                echo $row_doc->downloads;
                ?>
					</td>
					<td valign="middle" align="center">
						<?php 
                echo JLMS_dateToDisplay($row_doc->last_access, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s');
                ?>
					</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        } elseif ($lists['page'] == 12 && !$lists['filter_stu_val'] && isset($lists['page12_stats']) && !empty($lists['page12_stats'])) {
            $page_12_stats_shown = true;
            $max_tree_width = 0;
            if (isset($lists['page12_stats'][0])) {
                $max_tree_width = $lists['page12_stats'][0]->tree_max_width;
            }
            ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
var block_stats = 0;
var tID = '';
var url_prefix = '<?php 
            echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}";
            ?>
';
function jlms_MakeRequest(url) {
	var http_request = false;
	if (window.ActiveXObject) { // IE
		try { http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try { http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	} else if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	if (!http_request) {
		return false;
	}
	http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); };
	http_request.open('GET', url_prefix + url, true);
	http_request.send(null);
}
function jlms_AnalizeRequest(http_request) {
	if (http_request.readyState == 4) {
		if ((http_request.status == 200)) {
			block_stats = 0;
			if(http_request.responseXML.documentElement == null){
				try {
					http_request.responseXML.loadXML(http_request.responseText)
				} catch (e) {
					/*alert("Can't load");*/
				}
			}
			response  = http_request.responseXML.documentElement;
			var task = response.getElementsByTagName('task')[0].firstChild.data;
			switch (task) {
				case 'doc_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					var sec_indx = gl_el.parentNode.sectionRowIndex;
					var table = gl_el.parentNode.parentNode;
					var row = table.insertRow(sec_indx + 1);
					var cell1 = document.createElement("td");
					cell1.align = 'left';
					cell1.colSpan = "<?php 
            echo $max_tree_width + 5;
            ?>
";
					cell1.style.padding = '0px';
					cell1.style.margin = '0px';
					cell1.innerHTML = response_data;
					row.appendChild(cell1);
					gl_el.innerHTML = "<img class='JLMS_png' src='<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />";
				break;
			}
		} else {
		}
	}
}
var gl_el = '';
function jlms_RequestDOCS_stats( doc_id, element ) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = element.parentNode;
		jlms_MakeRequest('&task=get_docs_stats&doc_id='+doc_id+'&colspan=<?php 
            echo $max_tree_width + 2;
            ?>
');
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}
JLMS_preloadImages('<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
', '<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png');
//--><!]]> 
</script>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="<?php 
            echo 16 * ($max_tree_width + 1);
            ?>
" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" colspan="<?php 
            echo $max_tree_width + 1;
            ?>
">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="45%"><?php 
            echo _JLMS_TRACK_TBL_DOC_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="100" align="center"><?php 
            echo _JLMS_TRACK_TBL_DOC_DOWNS;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="100" align="center"><?php 
            echo _JLMS_TRACK_TBL_DOC_LAST;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            $tree_modes = array();
            for ($i = 0, $n = count($lists['page12_stats']); $i < $n; $i++) {
                $row_doc = $lists['page12_stats'][$i];
                $max_tree_width = $row_doc->tree_max_width;
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td valign="middle" align="center">
					<?php 
                if ($row_doc->folder_flag != 1) {
                    ?>
						<span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestDOCS_stats(<?php 
                    echo $row_doc->id;
                    ?>
, this);">
							<img class='JLMS_png' src="<?php 
                    echo $JLMS_CONFIG->get('live_site');
                    ?>
/components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php 
                    echo _JLMS_TRACK_VIEW_DETAILS;
                    ?>
" title="<?php 
                    echo _JLMS_TRACK_VIEW_DETAILS;
                    ?>
" />
						</span>
					<?php 
                } else {
                    echo '&nbsp;';
                }
                ?>
					</td>
					<?php 
                $add_img = '';
                if ($row_doc->tree_mode_num) {
                    $g = 0;
                    $tree_modes[$row_doc->tree_mode_num - 1] = $row_doc->tree_mode;
                    while ($g < $row_doc->tree_mode_num - 1) {
                        $pref = '';
                        if (isset($tree_modes[$g]) && $tree_modes[$g] == 2) {
                            $pref = 'empty_';
                        }
                        $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/" . $pref . "line.png\" width='16' height='16' alt='line' /></td>";
                        $g++;
                    }
                    $add_img .= "<td width='16' valign='middle'><img src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/treeview/sub" . $row_doc->tree_mode . ".png\" width='16' height='16' alt='sub' /></td>";
                    $max_tree_width = $max_tree_width - $g - 1;
                }
                echo $add_img;
                ?>
					<td align="center" valign="middle" style="vertical-align:middle " width='16'>
					<?php 
                if ($row_doc->folder_flag == 1) {
                    echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/folder.png\" width='16' height='16' alt='Folder' /></span>";
                } else {
                    echo "<span style='alignment:center; font-weight:bold; vertical-align:middle;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row_doc->file_icon . ".png\" width='16' height='16' alt='File' /></span>";
                }
                ?>
					</td>
					<td align="left" valign="middle" <?php 
                if ($max_tree_width > 0) {
                    echo "colspan='" . ($max_tree_width + 1) . "'";
                }
                ?>
 width="35%">
					<?php 
                if ($row_doc->folder_flag || !$row_doc->folder_flag && !$row_doc->file_id) {
                    echo '<strong>' . $row_doc->doc_name . '</strong>';
                } else {
                    echo $row_doc->doc_name;
                }
                ?>
					</td>
					<td valign="middle" align="center">
						<?php 
                echo $row_doc->downloads;
                ?>
					</td>
					<td valign="middle" align="center">
						<?php 
                echo JLMS_dateToDisplay($row_doc->last_access, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s');
                ?>
					</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        } elseif ($lists['page'] == 12 && !$page_12_stats_shown) {
            echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>';
        } elseif ($lists['page'] == 13 && $lists['filter_stu_val'] && isset($lists['page13_stats']) && !empty($lists['page13_stats'])) {
            $page_13_stats_shown = true;
            ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--

function submitbutton(pressbutton){
	var form = document.adminForm;
	form.view.value = pressbutton;
	form.submit();
}

var block_stats = 0;
var tID = '';
var url_prefix = '<?php 
            echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}";
            ?>
';
function jlms_MakeRequest(url) {
	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try { http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try { http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		return false;
	}
	http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); };
	http_request.open('GET', url_prefix + url, true);
	http_request.send(null);
}
function jlms_AnalizeRequest(http_request) {
	if (http_request.readyState == 4) {
		if ((http_request.status == 200)) {
			block_stats = 0;
			if(http_request.responseXML.documentElement == null){
				try {
					http_request.responseXML.loadXML(http_request.responseText)
				} catch (e) {
					/*alert("Can't load");*/
				}
			}
			response  = http_request.responseXML.documentElement;
			var task = response.getElementsByTagName('task')[0].firstChild.data;
			switch (task) {
				case 'lpath_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						var sec_indx = gl_el.parentNode.sectionRowIndex;
						var table = gl_el.parentNode.parentNode;
						var row = table.insertRow(sec_indx + 1);
						var cell1 = document.createElement("td");
						cell1.align = 'left';
						cell1.colSpan = "3";
						cell1.style.padding = '0px';
						cell1.style.margin = '0px';
						cell1.innerHTML = response_data;
						row.appendChild(cell1);
					}
					gl_el.innerHTML = "<img class='JLMS_png' src='<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />";
				break;
				case 'scorm_progress_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					var res_user = response.getElementsByTagName('user_id')[0].firstChild.data;
					var res_lpsc = response.getElementsByTagName('lpath_id')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						gl_el_res = document.getElementById('sc_progress_td_'+res_user+'_'+res_lpsc);
						if (gl_el_res) {
							gl_el_res.innerHTML = response_data;
						}
					}
				break;
			}
		} else {
		}
	}
}
var gl_el = '';
function jlms_RequestLP_stats( lp_id, element ) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = element.parentNode;
		jlms_MakeRequest('&task=get_lp_stats&lpath_id='+lp_id);
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}
function ChangeScormProgress( user_id, sc_id, new_stat, element) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = document.getElementById('sc_progress_td_'+user_id+'_'+sc_id);
		jlms_MakeRequest('&task=get_lp_stats&mode=scormstatus&user_id='+user_id+'&nstat='+new_stat+'&lpath_id='+sc_id);
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}
JLMS_preloadImages('<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
', '<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png', '<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png');
//--><!]]> 
</script>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_LPATH_TBL_HEAD_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="1" colspan="3">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_LPATH_TBL_TIME_SPENT;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_LPATH_TBL_STARTING;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center"><?php 
            echo _JLMS_LPATH_TBL_ENDING;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            for ($i = 0, $n = count($lists['page13_stats']); $i < $n; $i++) {
                $row_path = $lists['page13_stats'][$i];
                $icon_img = "toolbar/tlb_lpath";
                $icon_alt = "learnpath";
                if ($row_path->item_id) {
                    $icon_img = "toolbar/tlb_scorm";
                    $icon_alt = "scorm";
                }
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td valign="middle" align="center">
						&nbsp;
					</td>
					<td valign="middle" align="left">
						<?php 
                if ($lists['f_lpath']) {
                    echo JLMS_tracking_html::Echo_userinfo($row_path->u_name, $row_path->username, $row_path->email, 'javascript:void(0);');
                } else {
                    echo $row_path->lpath_name;
                }
                ?>
					</td>
					<?php 
                if ($lists['f_lpath']) {
                    ?>
						<td width="1%" style="white-space: nowrap;"><?php 
                    echo JLMS_getLpathProgress($row_path, $row_path->user_id ? $row_path->user_id : 0);
                    ?>
</td>
					<?php 
                } else {
                    ?>
						<td width="1%" style="white-space: nowrap;"><?php 
                    echo JLMS_getLpathProgress($row_path, $lists['filter_stu_val']);
                    ?>
</td>
					<?php 
                }
                ?>
				<?php 
                $r_img = 'btn_cancel';
                $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED;
                $time_spent = $row_path->time_spent;
                $r_start = '-';
                $r_end = '-';
                $new_s_status = '1';
                if (!$row_path->item_id) {
                    if (isset($row_path->r_status) && $row_path->r_status == 1) {
                        $r_img = 'btn_accept';
                        $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                        $r_start = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                        $r_end = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_end, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                    } elseif (isset($row_path->r_status) && $row_path->r_status == 0) {
                        $r_img = 'btn_pending_cur';
                        $r_start = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                    }
                } else {
                    if (isset($row_path->s_status) && $row_path->s_status == 1) {
                        $r_img = 'btn_accept';
                        $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                        $r_start = '-';
                        $r_end = '-';
                        $new_s_status = '0';
                    }
                    if ($row_path->lp_type == 1 || $row_path->lp_type == 2) {
                        $r_end = isset($row_path->r_end) && $row_path->r_end ? JLMS_dateToDisplay($row_path->r_end, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                        $r_start = isset($row_path->r_start) && $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, true, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                    }
                }
                ?>
					<?php 
                if ($row_path->item_id) {
                    ?>
					<td valign="middle" align="center" width="16" id="sc_progress_td_<?php 
                    echo $lists['filter_stu_val'] . "_" . $row_path->item_id;
                    ?>
">
						<a class="jlms_img_link" id="sc_progress_a_<?php 
                    echo $lists['filter_stu_val'] . "_" . $row_path->item_id;
                    ?>
" href="javascript:ChangeScormProgress(<?php 
                    echo $lists['filter_stu_val'];
                    ?>
,<?php 
                    echo $row_path->item_id;
                    ?>
,<?php 
                    echo $new_s_status;
                    ?>
,this);"><img id="sc_progress_img_<?php 
                    echo $lists['filter_stu_val'] . "_" . $row_path->item_id;
                    ?>
" align="absmiddle" class="JLMS_png" src="<?php 
                    echo $JLMS_CONFIG->get('live_site');
                    ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                    echo $r_img;
                    ?>
.png" width="16" height="16" border="0" alt="<?php 
                    echo $r_sta;
                    ?>
" title="<?php 
                    echo $r_sta;
                    ?>
" /></a>
					<?php 
                } else {
                    ?>
					<td valign="middle" align="center" width="16">
						<img class='JLMS_png' src='<?php 
                    echo $JLMS_CONFIG->get('live_site');
                    ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                    echo $r_img;
                    ?>
.png' width='16' height='16' alt="<?php 
                    echo $r_sta;
                    ?>
" title="<?php 
                    echo $r_sta;
                    ?>
" />
					<?php 
                }
                ?>
					</td>
					<td valign="middle" align="center" nowrap="nowrap">
						<?php 
                echo $row_path->item_id ? isset($row_path->s_score) ? $row_path->s_score . _JLMS_GB_POINTS : '&nbsp;' : '&nbsp;';
                ?>
					</td>
					<td valign="middle" align="center" nowrap="nowrap"><?php 
                echo $time_spent;
                ?>
</td>
					<td valign="middle" align="center" nowrap="nowrap"><?php 
                echo $r_start;
                ?>
</td>
					<td valign="middle" align="center" nowrap="nowrap"><?php 
                echo $r_end;
                ?>
</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0" class="jlms_table_no_borders">
				<tr>
					<td align="center">
						<?php 
            $controls = array();
            $controls[] = array('href' => "javascript:submitbutton('csv');", 'title' => 'CSV', 'img' => 'csv');
            $controls[] = array('href' => "javascript:submitbutton('xls');", 'title' => 'XLS', 'img' => 'xls');
            JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':');
            ?>
	
					</td>
				</tr>
			</table>
		<?php 
        } elseif ($lists['page'] == 13 && !$lists['filter_stu_val'] && isset($lists['page13_stats']) && !empty($lists['page13_stats'])) {
            $page_13_stats_shown = true;
            ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
var block_stats = 0;
var tID = '';
var url_prefix = '<?php 
            echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}";
            ?>
';
function jlms_MakeRequest(url) {
	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try { http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try { http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		return false;
	}
	http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); };
	http_request.open('GET', url_prefix + url, true);
	http_request.send(null);
}
function jlms_AnalizeRequest(http_request) {
	if (http_request.readyState == 4) {
		if ((http_request.status == 200)) {
			block_stats = 0;
			if(http_request.responseXML.documentElement == null){
				try {
					http_request.responseXML.loadXML(http_request.responseText)
				} catch (e) {
					/*alert("Can't load");*/
				}
			}
			response  = http_request.responseXML.documentElement;
			var task = response.getElementsByTagName('task')[0].firstChild.data;
			switch (task) {
				case 'lpath_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						var sec_indx = gl_el.parentNode.sectionRowIndex;
						var table = gl_el.parentNode.parentNode;
						var row = table.insertRow(sec_indx + 1);
						var cell1 = document.createElement("td");
						cell1.align = 'left';
						cell1.colSpan = "3";
						cell1.style.padding = '0px';
						cell1.style.margin = '0px';
						cell1.innerHTML = response_data;
						row.appendChild(cell1);
					}
					gl_el.innerHTML = "<img class='JLMS_png' src='<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />";
				break;
				case 'scorm_progress_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					var res_user = response.getElementsByTagName('user_id')[0].firstChild.data;
					var res_lpsc = response.getElementsByTagName('lpath_id')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						gl_el_res = document.getElementById('sc_progress_td_'+res_user+'_'+res_lpsc);
						if (gl_el_res) {
							gl_el_res.innerHTML = response_data;
						}
					}
				break;
			}
		} else {
		}
	}
}
var gl_el = '';
function jlms_RequestLP_stats( lp_id, element ) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = element.parentNode;
		jlms_MakeRequest('&task=get_lp_stats&lpath_id='+lp_id);
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}
function ChangeScormProgress( user_id, sc_id, new_stat, element) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = document.getElementById('sc_progress_td_'+user_id+'_'+sc_id);
		jlms_MakeRequest('&task=get_lp_stats&mode=scormstatus&user_id='+user_id+'&nstat='+new_stat+'&lpath_id='+sc_id);
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}
JLMS_preloadImages('<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
', '<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png');
//--><!]]> 
</script>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="100%"><?php 
            echo _JLMS_LPATH_TBL_HEAD_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            for ($i = 0, $n = count($lists['page13_stats']); $i < $n; $i++) {
                $row_path = $lists['page13_stats'][$i];
                $icon_img = "toolbar/tlb_lpath";
                $icon_alt = "learnpath";
                if ($row_path->item_id) {
                    $icon_img = "toolbar/tlb_scorm";
                    $icon_alt = "scorm";
                }
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td valign="middle" align="center">
					<?php 
                if (!isset($row_path->is_link)) {
                    ?>
						<span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestLP_stats(<?php 
                    echo $row_path->id;
                    ?>
, this);">
							<img class='JLMS_png' src="<?php 
                    echo $JLMS_CONFIG->get('live_site');
                    ?>
/components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php 
                    echo _JLMS_TRACK_VIEW_DETAILS;
                    ?>
" title="<?php 
                    echo _JLMS_TRACK_VIEW_DETAILS;
                    ?>
" />
						</span>	
					<?php 
                }
                ?>
	
					</td>
					<td valign="middle" align="center">
						<span style="alignment:center; vertical-align:middle">
							<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/<?php 
                echo $icon_img;
                ?>
.png" width='16' height='16' alt="<?php 
                echo $icon_alt;
                ?>
" />
						</span>
					</td>
					<td valign="middle" align="left">
						<?php 
                echo $row_path->lpath_name;
                ?>
					</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        } elseif ($lists['page'] == 13 && !$page_13_stats_shown) {
            echo '<div class="joomlalms_user_message">' . _JLMS_TRACKING_NO_STATISTICS . '</div>';
        } elseif ($lists['page'] == 5 && $lists['filter_stu_val'] && isset($lists['page5_stats'])) {
            ?>
			<br /><br />
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">#</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="30%"><?php 
            echo _JLMS_HW_TBL_HEAD_HW;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_HW_TBL_HEAD_DATE;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_HW_TBL_HEAD_ENDDATE;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="1">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            for ($i = 0, $n = count($lists['page5_stats']); $i < $n; $i++) {
                $row_hw = $lists['page5_stats'][$i];
                $alt = $row_hw->hw_status ? _JLMS_HW_STATUS_COMPLETED : _JLMS_HW_STATUS_INCOMPLETED;
                $image = $row_hw->hw_status ? 'btn_accept.png' : 'btn_cancel.png';
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td align="center"><?php 
                echo $i + 1;
                ?>
</td>
					<td align="left" valign="middle" style="vertical-align:middle ">
						<?php 
                echo $row_hw->hw_name;
                ?>
					</td>
					<td valign="middle" style="vertical-align:middle ">
						<?php 
                echo $row_hw->post_date;
                ?>
					</td>
					<td valign="middle" style="vertical-align:middle ">
						<?php 
                echo $row_hw->end_date;
                ?>
					</td>
					<td align="left" valign="middle" style="vertical-align:middle; text-align:left; white-space:nowrap " nowrap="nowrap">
						<?php 
                echo '<img align="absmiddle" class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                if ($row_hw->hw_status) {
                    echo '&nbsp;&nbsp;' . JLMS_dateToDisplay($row_hw->hw_date, false, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s');
                }
                ?>
					</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        } elseif ($lists['page'] == 11 && $lists['filter_stu_val'] && isset($lists['page11_stats']) && !empty($lists['page11_stats'])) {
            ?>
			<br /><br />
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
"><?php 
            echo _JLMS_LPATH_TBL_HEAD_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="1" colspan="2">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					
				</tr>
			<?php 
            $k = 1;
            for ($i = 0, $n = count($lists['page11_stats']); $i < $n; $i++) {
                $row_path = $lists['page11_stats'][$i];
                $icon_img = "toolbar/tlb_lpath";
                $icon_alt = "learnpath";
                if ($row_path->c_id) {
                    $icon_img = "toolbar/tlb_scorm";
                    $icon_alt = "scorm";
                }
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td valign="middle" align="center">
						<span style="alignment:center; vertical-align:middle">
							<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/<?php 
                echo $icon_img;
                ?>
.png" width='16' height='16' alt="<?php 
                echo $icon_alt;
                ?>
" />
						</span>
					</td>
					<td valign="middle" align="left">
							<?php 
                echo $row_path->c_title;
                ?>
					</td>
					
				<?php 
                $r_img = 'btn_cancel';
                $r_sta = _JLMS_LPATH_STU_LPSTATUS_NOTCOMPLETED;
                $r_start = '-';
                $r_end = '-';
                if (!$row_path->c_id) {
                    if (isset($row_path->published) && $row_path->published == 1) {
                        $r_img = 'btn_accept';
                        $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                        $r_start = $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                        $r_end = $row_path->r_start ? JLMS_dateToDisplay($row_path->r_end, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                    } elseif (isset($row_path->published) && $row_path->published == 0) {
                        $r_img = 'btn_pending_cur';
                        $r_start = $row_path->r_start ? JLMS_dateToDisplay($row_path->r_start, false, $JLMS_CONFIG->get('offset') * 60 * 60, '\\<\\b\\r \\/>H:i:s') : '-';
                    }
                } else {
                    if (isset($row_path->published) && $row_path->published == 1) {
                        $r_img = 'btn_accept';
                        $r_sta = _JLMS_LPATH_STU_LPSTATUS_COMPLETED;
                        $r_start = '-';
                        $r_end = '-';
                    }
                }
                ?>
					<td valign="middle" align="center">
					<a style="border:0px;" href="<?php 
                echo sefRelToAbs("index.php?option=" . $option . "&task=quizzes&id=" . $id . "&page=reports&quiz_id=" . $row_path->c_id . "");
                ?>
"><img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php 
                echo 'Report';
                ?>
" title="<?php 
                echo 'Report';
                ?>
" border="0" /></a>
					</td>
					<td valign="middle" align="center" width="16">
						<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                echo $r_img;
                ?>
.png" width='16' height='16' alt="<?php 
                echo $r_sta;
                ?>
" title="<?php 
                echo $r_sta;
                ?>
" />
					</td>
					<td valign="middle" align="center" nowrap="nowrap">
						<?php 
                echo $row_path->c_id ? isset($row_path->s_score) ? $row_path->s_score . _JLMS_GB_POINTS : '&nbsp;' : '&nbsp;';
                ?>
					</td>
					
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        } elseif ($lists['page'] == 11 && !$lists['filter_stu_val'] && isset($lists['page11_stats']) && !empty($lists['page11_stats'])) {
            ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
var block_stats = 0;
var tID = '';
var url_prefix = '<?php 
            echo $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&Itemid={$Itemid}&id={$id}";
            ?>
';
function jlms_MakeRequest(url) {
	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try { http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try { http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		return false;
	}
	http_request.onreadystatechange = function() { jlms_AnalizeRequest(http_request); };
	http_request.open('GET', url_prefix + url, true);
	http_request.send(null);
}
function jlms_AnalizeRequest(http_request) {
	if (http_request.readyState == 4) {
		if ((http_request.status == 200)) {
			block_stats = 0;
			if(http_request.responseXML.documentElement == null){
				try {
					http_request.responseXML.loadXML(http_request.responseText)
				} catch (e) {
					/*alert("Can't load");*/
				}
			}
			response  = http_request.responseXML.documentElement;
			var task = response.getElementsByTagName('task')[0].firstChild.data;
			switch (task) {
				case 'lpath_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						var sec_indx = gl_el.parentNode.sectionRowIndex;
						var table = gl_el.parentNode.parentNode;
						var row = table.insertRow(sec_indx + 1);
						var cell1 = document.createElement("td");
						cell1.align = 'left';
						cell1.colSpan = "4";
						cell1.style.padding = '0px';
						cell1.style.margin = '0px';
						cell1.innerHTML = response_data;
						row.appendChild(cell1);
					}
					gl_el.innerHTML = "<img class='JLMS_png' src='<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png' width='16' height='16' alt=\"done\" title=\"done\" />";
				break;
				case 'scorm_progress_xml':
					var response_data = response.getElementsByTagName('stats_table')[0].firstChild.data;
					var res_user = response.getElementsByTagName('user_id')[0].firstChild.data;
					var res_lpsc = response.getElementsByTagName('quiz_id')[0].firstChild.data;
					if (response_data && response_data != '' && response_data != ' ') {
						gl_el_res = document.getElementById('quizid_'+res_lpsc);
						if (gl_el_res) {
							gl_el_res.innerHTML = response_data;
						}
					}
				break;
			}
		} else {
		}
	}
}
var gl_el = '';
function jlms_RequestQuiz_stats( lp_id, element ) {
	if (block_stats == 0) {
		block_stats = 1;
		gl_el = element.parentNode;
		jlms_MakeRequest('&task=get_quiz_stats&quiz_id='+lp_id);
		gl_el.innerHTML = "<img src='<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
' width='16' height='16' alt=\"loading\" title=\"loading\" />";
	}
}

JLMS_preloadImages('<?php 
            echo $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('ajax_settings_small_indicator');
            ?>
', '<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png', 'components/com_joomla_lms/lms_images/toolbar/btn_cancel.png');
//--><!]]> 
</script>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="16" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" ><?php 
            echo _JLMS_LPATH_TBL_HEAD_NAME;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
				</tr>
			<?php 
            $k = 1;
            for ($i = 0, $n = count($lists['page11_stats']); $i < $n; $i++) {
                $row_path = $lists['page11_stats'][$i];
                $icon_img = "toolbar/tlb_lpath";
                $icon_alt = "learnpath";
                if ($row_path->c_id) {
                    $icon_img = "toolbar/tlb_quiz";
                    $icon_alt = "scorm";
                }
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td valign="middle" align="center">
						<span style="alignment:center; vertical-align:middle; cursor:pointer" onclick="jlms_RequestQuiz_stats(<?php 
                echo $row_path->c_id;
                ?>
, this);">
							<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php 
                echo _JLMS_TRACK_VIEW_DETAILS;
                ?>
" title="<?php 
                echo _JLMS_TRACK_VIEW_DETAILS;
                ?>
" />
						</span>	
					</td>
					<td valign="middle" align="center">
						<span style="alignment:center; vertical-align:middle">
							<img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/<?php 
                echo $icon_img;
                ?>
.png" width='16' height='16' alt="<?php 
                echo $icon_alt;
                ?>
" />
						</span>
					</td>
					<td valign="middle" align="left">
						<?php 
                echo $row_path->c_title;
                ?>
					</td>
					<td valign="middle" align="center">
					<a class="jlms_img_link" style="border:0px;" href="<?php 
                echo sefRelToAbs("index.php?option=" . $option . "&task=quizzes&id=" . $id . "&page=reports&quiz_id=" . $row_path->c_id . "");
                ?>
"><img class='JLMS_png' src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/toolbar/btn_pending_cur.png" width='16' height='16' alt="<?php 
                echo 'Report';
                ?>
" title="<?php 
                echo 'Report';
                ?>
" border="0" /></a>
					</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
		<?php 
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="tracking" />
			<input type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
			
			<input type="hidden" name="page" value="<?php 
        echo $lists['page'];
        ?>
" />
			<input type="hidden" name="view" value="" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
    function JLMS_sreportScorm($option, &$rows, $start_date, $end_date, &$pageNav, &$lists, $levels, $filt_cat, $filt_group, $is_full)
    {
        global $JLMS_CONFIG;
        $Itemid = $JLMS_CONFIG->get('Itemid');
        //FLMS multicat
        $multicat = array();
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            $multicat = array();
            $i = 0;
            foreach ($lists as $key => $item) {
                if (substr($key, 0, 7) == 'filter_') {
                    $multicat[] = $lists['filter_' . $i];
                    $i++;
                }
            }
        }
        JLMS_TMPL::OpenMT();
        $lists['user_id'] = isset($lists['user_id']) ? $lists['user_id'] : 0;
        if ($is_full) {
            $hparams = array('show_menu' => false);
        } else {
            $hparams = array('simple_menu' => true);
        }
        $toolbar = array();
        JLMS_TMPL::ShowHeader('tracking', _JLMS_REPORTS_SCORM . ' ' . date("Y-m-d H:i:s"), $hparams, $toolbar);
        JLMS_TMPL::OpenTS();
        ?>
		<script language="javascript" type="text/javascript">
		<!--//--><![CDATA[//><!--
			function pickup_date(){
				var form = document.adminForm;
				form.end_date.value = form.pick_date.value;
				form.start_date.value = form.pick_to_date.value;
				var is_cor = 1;
				if(form.start_date.value.length == 10 && form.end_date.value.length == 10)
				{
					if("<?php 
        echo $JLMS_CONFIG->get('date_format', "Y-m-d");
        ?>
" == "d-m-Y"){
						if(form.end_date.value.substring(5)<form.start_date.value.substring(5)){
							is_cor = 0;
						} else if( form.end_date.value.substring(2,5)<form.start_date.value.substring(2,5)){
							is_cor = 0;
						} else if( form.end_date.value.substring(0,2)<form.start_date.value.substring(0,2)){
							is_cor = 0;
						}
					} else {	
						if(form.end_date.value.substring(0,4)<form.start_date.value.substring(0,4)){
							is_cor = 0;
						} else if ( form.end_date.value.substring(5,7)<form.start_date.value.substring(5,7)){
							is_cor = 0;
						} else if ( form.end_date.value.substring(8,10)<form.start_date.value.substring(8,10)){
							is_cor = 0;
						}
					}
				}
				if(!is_cor){
					alert("<?php 
        echo _JLMS_REPORTS_SELECT_DATE;
        ?>
");
				} else {
					form.view.value = '';	
					form.submit();	
				}
			}
			function pickup_date_reset(){
				var form = document.adminForm;
				form.pick_date.value = '-';
				form.pick_to_date.value = '-';
				form.end_date.value = form.pick_date.value;
				form.start_date.value = form.pick_to_date.value;
				form.view.value = '';	
				form.submit();	
			}
		
			var old_filters = new Array();
			function read_filter(){
				var form = document.adminForm;
				var count_levels = '<?php 
        echo count($levels);
        ?>
';
				for(var i=0;i<parseInt(count_levels);i++){
					if(form['filter_id_'+i] != null){
						old_filters[i] = form['filter_id_'+i].value;
					}
				}
			}
			function write_filter(){
				var form = document.adminForm;
				var count_levels = '<?php 
        echo count($levels);
        ?>
';
				var j;
				for(var i=0;i<parseInt(count_levels);i++){
					if(form['filter_id_'+i+''] != null && form['filter_id_'+i+''].value != old_filters[i]){
						j = i;
					}
					if(i > j){
						if(form['filter_id_'+i] != null){
							form['filter_id_'+i].value = 0;	
						}
					}
				}
			}
			
			function submitFormView(view){
				var form = document.adminForm;
				form.view.value = view;
				form.task.value='report_scorm';
				form.submit();
			}
		//--><!]]>
		</script>
		<?php 
        $action_url = $is_full ? $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&amp;Itemid={$Itemid}" : sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}");
        ?>
		<form action="<?php 
        echo $action_url;
        ?>
" method="post" name="adminForm">
			<table cellpadding="0" cellspacing="0" border="0" id="TheTable" <?php 
        echo $is_full ? "" : 'width="100%"';
        ?>
>
				<?php 
        if (!$is_full) {
            ?>
				<tr>
					<td align="<?php 
            echo $is_full ? "left" : "right";
            ?>
" <?php 
            echo !$is_full ? 'colspan="4"' : '';
            ?>
>
						<table <?php 
            echo $is_full ? '' : 'width="30%"';
            ?>
>
							<tr>
								<td valign="top" <?php 
            echo $is_full ? 'width="400"' : 'width="40%"';
            ?>
>
									<table width="100%" border="0">
										<tr>
											<td <?php 
            echo $is_full ? 'width="100"' : 'width="20%"';
            ?>
 nowrap="nowrap">
												Report Type:
											</td>
											<td>
												<?php 
            echo JLMS_switchType($option);
            ?>
											</td>
										</tr>
									</table>		
								</td>
							</tr>
						</table>	
					</td>
				</tr>
				<?php 
        }
        ?>
				<tr>
					<td align="left">
						<table <?php 
        echo $is_full ? '' : 'width="100%"';
        ?>
>
							<tr>
								<td valign="top" <?php 
        echo $is_full ? 'width="400"' : 'width="40%"';
        ?>
>
									<table width="100%" border="0">
										<?php 
        if ($is_full) {
            ?>
										<tr>
											<td <?php 
            echo $is_full ? 'width="100"' : 'width="20%"';
            ?>
 nowrap="nowrap">
												Report Type:
											</td>
											<td>
												<?php 
            echo JLMS_switchType($option);
            ?>
											</td>
										</tr>
										<?php 
        }
        ?>
										<tr>
											<td <?php 
        echo $is_full ? 'width="100"' : 'width="20%"';
        ?>
 nowrap="nowrap">
												<?php 
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            echo isset($levels[0]->cat_name) && $levels[0]->cat_name != '' ? $levels[0]->cat_name : _JLMS_COURSES_COURSES_GROUPS;
        } else {
            echo _JLMS_COURSES_COURSES_GROUPS;
        }
        ?>
											</td>
											<td>
												<?php 
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            echo $lists['filter_0'];
        } else {
            echo $lists['jlms_course_cats'];
        }
        ?>
											</td>
										</tr>
										<?php 
        if (count($multicat)) {
            for ($i = 0; $i < count($multicat); $i++) {
                if ($i > 0) {
                    ?>
													<tr>
														<td <?php 
                    echo $is_full ? 'width="100"' : 'width="20%"';
                    ?>
 nowrap="nowrap">
															<?php 
                    echo isset($levels[$i]->cat_name) && $levels[$i]->cat_name != '' ? $levels[$i]->cat_name : _JLMS_COURSES_COURSES_GROUPS;
                    ?>
														</td>
														<td>
															<?php 
                    echo $lists['filter_' . $i];
                    ?>
														</td>
													</tr>
													<?php 
                }
            }
        }
        ?>
										<tr>
											<td <?php 
        echo $is_full ? 'width="100"' : 'width="20%"';
        ?>
 nowrap="nowrap">
												Courses:
											</td>
											<td>
												<?php 
        echo $lists['filt_course'];
        ?>
											</td>
										</tr>
									</table>
								</td>
								<td valign="top" <?php 
        echo $is_full ? 'width="400"' : 'width="40%"';
        ?>
>
									<table width="100%" border="0">
										<?php 
        if ($is_full) {
            ?>
										<tr>
											<td colspan="2">
												&nbsp;
											</td>
										</tr>
										<?php 
        }
        if ($JLMS_CONFIG->get('use_global_groups', 1)) {
            ?>
										<tr>
											<td style="padding-left: 5px;" <?php 
            echo $is_full ? 'width="100"' : 'width="20%"';
            ?>
 nowrap="nowrap">
												<?php 
            echo _JLMS_USER_GROUP_INFO;
            ?>
											</td>
											<td>
												<?php 
            echo $lists['filt_group'];
            ?>
											</td>
										</tr>
										<?php 
        }
        ?>
										<tr>
											<td colspan="2">
												<table width="100%" border="0">
													<tr>
														<td style="padding:0px 10px;" width="30">From</td>
														<td valign="middle" align="center">
															<?php 
        echo JLMS_HTML::_('calendar.calendar', $start_date, 'pick_to', 'pick_to', null, null, 'statictext');
        ?>
														</td>
														<td style="padding:0px 10px;" width="30">To</td>
														<td valign="middle" align="center">
															<?php 
        echo JLMS_HTML::_('calendar.calendar', $end_date, 'pick', 'pick', null, null, 'statictext');
        ?>
														</td>
														<td valign="middle" align="center" width="18" style="vertical-align:middle ">
															<a href="javascript:pickup_date_reset();" title="">
																<img class="JLMS_png" src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/toolbar/btn_publish_hidden.png" alt="" title="Disabled filter date" border="0" width="16" height="16" />
															</a>
														</td>
														<td valign="middle" align="center" width="18" style="vertical-align:middle ">
															<a href="javascript:pickup_date();" title="">
																<img class="JLMS_png" src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/toolbar/btn_accept.png" alt="" title="Enabled filter date" border="0" width="16" height="16" />
															</a>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
								<?php 
        if (!$is_full) {
            ?>
								<td style="padding-left:15px; white-space: nowrap;" align="right">
									<?php 
            $link = $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option=" . $option . "&amp;Itemid={$Itemid}&amp;task=report_scorm&amp;is_full=1";
            $link .= $filt_group ? "&amp;filt_group=" . $filt_group : "";
            $link .= $start_date != "-" ? "&amp;start_date=" . JLMS_dateToDisplay($start_date) : "";
            $link .= $end_date != "-" ? "&amp;end_date=" . JLMS_dateToDisplay($end_date) : "";
            ?>
									<a href="<?php 
            echo $link;
            ?>
" target="_blank" title="<?php 
            echo _JLMS_FULL_VIEW_BUTTON;
            ?>
"><?php 
            echo _JLMS_FULL_VIEW_BUTTON;
            ?>
</a>
								</td>
								<?php 
        }
        ?>
							</tr>
						</table>			
					</td>
				</tr>
			</table>
					
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<thead>
					<tr>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Username
						</td>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Name
						</td>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Email
						</td>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Course Name
						</td>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Course ID
						</td>
						<td class="sectiontableheader" style="white-space: nowrap;">
							Date
						</td>
						<td class="sectiontableheader" style="text-align: center; white-space: nowrap;">
							Score
						</td>
						<td class="sectiontableheader" style="text-align: center; white-space: nowrap;">
							Course Status
						</td>
					</tr>
				</thead>
				<tbody>
					<?php 
        $k = 1;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            ?>
						<tr class="<?php 
            echo "sectiontableentry{$k}";
            ?>
">
							<td>
								<?php 
            echo $row->username;
            ?>
							</td>
							<td>
								<?php 
            echo $row->name;
            ?>
							</td>
							<td>
								<?php 
            echo $row->email;
            ?>
							</td>
							<td>
								<?php 
            echo $row->course_name;
            ?>
							</td>
							<td>
								<?php 
            echo $row->lpath_name;
            ?>
							</td>
							<td>
								<?php 
            if (isset($row->scorm_data) && $row->scorm_data->status) {
                if ($row->scorm_data->end) {
                    $date_end = date("Y-m-d H:i:s", $row->scorm_data->end);
                    echo JLMS_dateToDisplay($date_end);
                }
            }
            ?>
							</td>
							<td align="center">
								<?php 
            if (isset($row->scorm_data)) {
                echo $row->scorm_data->score;
            }
            ?>
							</td>
							<td align="center">
								<?php 
            $image = $row->course_status ? 'btn_accept.png' : 'btn_cancel.png';
            $alt = $row->course_status ? 'btn_accept' : 'btn_cancel';
            $alt .= '" align="top';
            echo JLMS_reports_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false);
            ?>
							</td>
						</tr>
						<?php 
            $k = 3 - $k;
        }
        ?>
				</tbody>
			</table>
			<?php 
        if ($lists['user_id'] && !$is_full && count($rows)) {
            if ($JLMS_CONFIG->get('new_lms_features', 1)) {
                $controls = array();
                $controls[] = array('href' => "javascript:submitFormView('csv');", 'title' => 'CSV', 'img' => 'csv');
                JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':');
            }
        }
        ?>
	
			<?php 
        if ($lists['user_id'] && !$is_full) {
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td align="center">
					<?php 
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=report_scorm&amp;filt_group={$filt_group}&amp;filt_cat={$filt_cat}";
            $link .= strlen($start_date) ? "&amp;start_date=" . JLMS_dateToDisplay($start_date) : "";
            $link .= strlen($end_date) ? "&amp;end_date=" . JLMS_dateToDisplay($end_date) : "";
            echo $pageNav->writePagesLinks($link);
            ?>
 
					</td>
				</tr>
				<tr>
					<td align="center">
						<?php 
            echo _JLMS_PN_DISPLAY_NUM . $pageNav->getLimitBox($link) . '&nbsp;' . $pageNav->getPagesCounter();
            ?>
					</td>
				</tr>
			</table>
			<?php 
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="report_scorm" />
			<input type="hidden" name="view" value="" />
			<input type="hidden" name="start_date" value="<?php 
        echo $start_date;
        ?>
" />
			<input type="hidden" name="end_date" value="<?php 
        echo $end_date;
        ?>
" />
			<input type="hidden" name="state" value="0" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="is_full" value="<?php 
        echo $is_full;
        ?>
" />
		</form>

		<?php 
        $action_url = $is_full ? $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&option={$option}&amp;Itemid={$Itemid}" : sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}");
        ?>
		<form action="<?php 
        echo $action_url;
        ?>
" method="post" name="adminFormCsv">
				<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
				<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
				<input type="hidden" name="task" value="report_scorm" />
				<input type="hidden" name="is_full" value="1" />
				<input type="hidden" name="view" value="" />
		</form>	
		<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
    function JQ_view_quizReport(&$rows, &$pageNav, $option, $page, $course_id, &$lists)
    {
        global $Itemid, $JLMS_CONFIG;
        $toolbar = array();
        $toolbar[] = array('btn_type' => 'print', 'btn_txt' => _JLMS_QUIZ_CSV_REPORT_BTN, 'btn_js' => "javascript:submitbutton('csv_report');");
        $toolbar[] = array('btn_type' => 'del', 'btn_txt' => _JLMS_QUIZ_DEL_REPORT_BTN, 'btn_js' => "javascript:submitbutton('del_report');");
        JLMS_quiz_admin_html_class::showQuizHead($course_id, $option, _JLMS_QUIZ_REPORTS_TITLE, true, $toolbar);
        ?>
<script language="javascript" type="text/javascript">
<!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if ( (pressbutton == 'del_report') && (form.boxchecked.value == "0")) {
		alert('<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
');
	} else {
		form.page.value = pressbutton;
		form.submit();
	}
}
function submitview(pressbutton){
	var form = document.adminForm;
	if(form.user_id.value == 0){
		alert('Please select User');
	} else {
		form.view.value = pressbutton;
		form.submit();
	}
}
//-->
</script>
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}");
        ?>
" method="post" name="adminForm">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
			<tr>
				<td>
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
					<tr>
						<td align="right" style="text-align:right">
							<div align="right" style="white-space:nowrap">
							<?php 
        echo _JLMS_QUIZ_FILTER_BY . '&nbsp;&nbsp;' . $lists['quiz'] . ',&nbsp;' . $lists['user'];
        ?>
							</div>
						</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td width="100%">
				<?php 
        $reports_colspan = 10;
        ?>
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
" style="margin-top:0px; padding-top:0px; margin-bottom:0px; padding-bottom:0px;">
					<tr>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center">#</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_DATE_TIME;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_STUDENT;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_QUIZ;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_USER_SCORE;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_TOTAL_SCORE;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_PASS_SCORE;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_PASSED;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_QUIZ_TBL_SPEND_TIME;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					</tr>
				<?php 
        $k = 1;
        $p_img = $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_accept.png';
        $f_img = $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png';
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $link = sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=quizzes&amp;id={$course_id}&amp;page=stu_reportA&c_id=" . $row->c_id);
            $checked = mosHTML::idBox($i, $row->c_id);
            if (!$row->c_student_id) {
                $row->username = "******";
            }
            if (!$row->username) {
                $row->username = "******";
            }
            if (!$row->c_title) {
                $row->c_title = "Quiz not found";
            }
            ?>
					<tr class="<?php 
            echo JLMSCSS::_('sectiontableentry' . $k);
            ?>
">
						<td align="center"><?php 
            echo $pageNav->limitstart + $i + 1;
            ?>
</td>
						<td><?php 
            echo $checked;
            ?>
</td>
						<td align="left">
							<a href="<?php 
            echo $link;
            ?>
">
							<?php 
            echo JLMS_dateToDisplay(strtotime($row->c_date_time), true, $JLMS_CONFIG->get('offset') * 60 * 60, ' H:i:s');
            ?>
							</a>
						</td>
						<td align="left">
							<?php 
            echo $row->username . '<br />' . $row->name;
            ?>
						</td>
						<td align="left">
							<?php 
            echo $row->c_title;
            ?>
						</td>
						<td align="left">
							<?php 
            echo $row->c_total_score;
            ?>
						</td>
						<td align="left">
							<?php 
            echo $row->c_full_score . (in_array($row->cur_quiz_id, $lists['pool_quizzes']) ? '+' : '');
            ?>
						</td>
						<td align="left">
							<?php 
            if ($JLMS_CONFIG->get('global_quest_pool')) {
                $passed_score = ceil($row->c_full_score * $row->c_passing_score / 100) . (in_array($row->cur_quiz_id, $lists['pool_quizzes_gqp']) ? '+' : '');
            } else {
                $passed_score = ceil($row->c_full_score * $row->c_passing_score / 100) . (in_array($row->cur_quiz_id, $lists['pool_quizzes']) ? '+' : '');
            }
            echo $passed_score . (strlen($row->c_passing_score) ? " (" . $row->c_passing_score . "%)" : '');
            ?>
						</td>
						<td align="left">
							<img src="<?php 
            echo $row->c_passed ? $p_img : $f_img;
            ?>
" width="16" height="16" border="0" alt="<?php 
            echo $row->c_passed ? 'passed' : 'failed';
            ?>
" />
						</td>
						<td align="left">
							<?php 
            $tot_min = floor($row->c_total_time / 60);
            $tot_sec = $row->c_total_time - $tot_min * 60;
            echo str_pad($tot_min, 2, "0", STR_PAD_LEFT) . ":" . str_pad($tot_sec, 2, "0", STR_PAD_LEFT);
            ?>
						</td>
					</tr>
					<?php 
            $k = 3 - $k;
        }
        ?>
				<tr>
					<td align="center" colspan="<?php 
        echo $reports_colspan;
        ?>
" class="<?php 
        echo JLMSCSS::_('jlmslist-footer_td');
        ?>
">
						<div align="center" style="white-space: nowrap;">
						<?php 
        $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=quizzes&amp;id={$course_id}&amp;page={$page}";
        echo _JLMS_PN_DISPLAY_NUM . '&nbsp;' . $pageNav->getLimitBox($link) . '&nbsp;' . $pageNav->getPagesCounter();
        echo '<br />';
        echo $pageNav->writePagesLinks($link);
        ?>
 
						</div>
					</td>
				</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td align="center">
					<?php 
        $controls = array();
        $controls[] = array('href' => "javascript:submitview('xls');", 'title' => 'XLS', 'img' => 'xls');
        JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':');
        ?>
	
				</td>
			</tr>
		</table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
		<input type="hidden" name="task" value="quizzes" />
		<input type="hidden" name="id" value="<?php 
        echo $course_id;
        ?>
" />
		<input type="hidden" name="page" value="<?php 
        echo $page;
        ?>
" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="view" value="" />
		</form>
		<?php 
        JLMS_quiz_admin_html_class::showQuizFooter();
    }
    function showGradebook_CEO($id, $option, &$rows, &$lists)
    {
        global $Itemid, $JLMS_CONFIG;
        $is_full = $lists['is_full'];
        if (!$is_full) {
            ?>
			<script type="text/javascript" language="javascript">
			<!--//--><![CDATA[//><!--
			function submitFormView(view){
				var form = document.adminForm;
				form.view.value = view;
				form.task.value='gradebook';
				form.submit();
			}
			//--><!]]>
			</script>
			<?php 
            JLMS_TMPL::OpenMT();
            $hparams = array();
            JLMS_TMPL::ShowHeader('gradebook', _JLMS_GB_TITLE, $hparams);
        }
        JLMS_TMPL::OpenTS();
        $action_url = $is_full ? $JLMS_CONFIG->get('live_site') . "/index.php?tmpl=component&amp;option={$option}&amp;Itemid={$Itemid}" : sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}");
        ?>
		<form action="<?php 
        echo $action_url;
        ?>
" method="post" name="adminForm">
			<?php 
        if (!$is_full) {
            $link_full = $JLMS_CONFIG->get('live_site') . '/index.php?tmpl=component&amp;option=' . $option . '&amp;Itemid=' . $Itemid . '&amp;task=gradebook&amp;id=' . $id . '&amp;is_full=1';
            ?>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" id="TheTable" class="jlms_table_no_borders">
				<tr>
					<td>
						&nbsp;
					</td>
				</tr>
				<tr>
					<td align="right">
						<a target="_blank" href="<?php 
            echo $link_full;
            ?>
">
							<?php 
            echo _JLMS_FULL_VIEW_BUTTON;
            ?>
						</a>
					</td>
				</tr>
				<tr>
					<td>
						&nbsp;
					</td>
				</tr>
			</table>
			<?php 
            $domready = '
				$(\'pre_div\').setStyles({\'display\': \'none\'});
				$(\'vw_div\').setStyles({\'display\': \'block\'});
				var cur_height = $(\'vw_div\').getStyle(\'height\').toInt() + 18;
				$(\'vw_div\').setStyles({\'width\': $(\'TheTable\').offsetWidth+\'px\', \'height\': cur_height+\'px\'});
				';
            $JLMS_CONFIG->set('web20_domready_code', $JLMS_CONFIG->get('web20_domready_code', '') . $domready);
            ?>
			<div id="pre_div" style="display: block; width: 100%; text-align: center;">
				<br />
				Please wait. Gradebook is loading.<br /> If this message stays for over 1 minute, please click <a target="_blank" href="<?php 
            echo $link_full;
            ?>
">&lt;here&gt;</a> to open Gradebook in new window.
			</div>
			<div id="vw_div" style="overflow: auto; width: 200px; height: auto; display: none;">
			<?php 
        }
        ?>
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
">
					<tr>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center">#</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_GB_TBL_HEAD_STU;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_GB_TBL_HEAD_GROUP;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
						<?php 
        foreach ($lists['sc_rows'] as $sc_row) {
            if ($sc_row->show_in_gradebook) {
                $link = isset($sc_row->is_link) ? $sc_row->is_link : '';
                echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap="nowrap" class="' . JLMSCSS::_('sectiontableheader') . '">' . JLMS_gradebook_html::Echo_tbl_header($sc_row->lpath_name, $link) . '</' . JLMSCSS::tableheadertag() . '>';
            }
        }
        foreach ($lists['quiz_rows'] as $quiz_row) {
            echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap="nowrap" class="' . JLMSCSS::_('sectiontableheader') . '">' . JLMS_gradebook_html::Echo_tbl_header($quiz_row->c_title) . '</' . JLMSCSS::tableheadertag() . '>';
        }
        foreach ($lists['gb_rows'] as $gb_row) {
            echo '<' . JLMSCSS::tableheadertag() . ' align=\'center\' nowrap="nowrap" class="' . JLMSCSS::_('sectiontableheader') . '">' . JLMS_gradebook_html::Echo_tbl_header($gb_row->gbi_name) . '</' . JLMSCSS::tableheadertag() . '>';
        }
        ?>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center" nowrap="nowrap"><?php 
        echo _JLMS_COURSE_COMPLETION_TABLE;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					</tr>
				<?php 
        $k = 1;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $checked = mosHTML::idBox($i, $row->user_id);
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=gb_usergrade&amp;course_id={$id}&amp;id={$row->user_id}";
            ?>
					<tr class="<?php 
            echo JLMSCSS::_('sectiontableentry' . $k);
            ?>
">
						<td align="center" valign="middle"><?php 
            echo $i + 1;
            ?>
</td>
						<td align="center" valign="middle"><?php 
            echo $checked;
            ?>
</td>
						<td align="left" valign="middle">
							<a href="<?php 
            echo sefRelToAbs($link);
            ?>
" title="<?php 
            echo _JLMS_GB_VIEW_USER;
            ?>
">
								<?php 
            echo $row->username;
            ?>
							</a>
						</td>
						<td align="left" valign="middle">
							<?php 
            echo $row->ug_name;
            ?>
						</td>
						<?php 
            foreach ($lists['sc_rows'] as $sc_row) {
                if ($sc_row->show_in_gradebook) {
                    $j = 0;
                    while ($j < count($row->scorm_info)) {
                        if ($row->scorm_info[$j]->gbi_id == $sc_row->item_id) {
                            if ($row->scorm_info[$j]->user_status == -1) {
                                echo '<td align=\'center\' valign="middle" nowrap="nowrap">' . '-' . '</td>';
                            } else {
                                $image = $row->scorm_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png';
                                $alt = $row->scorm_info[$j]->user_status ? 'btn_accept' : 'btn_cancel';
                                $img = JLMS_gradebook_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false);
                                echo '<td align="center" valign="middle" nowrap="nowrap">' . $img . '&nbsp;<strong>' . $row->scorm_info[$j]->user_grade . "</strong> (" . $row->scorm_info[$j]->user_pts . _JLMS_GB_POINTS . ")" . '</td>';
                            }
                        }
                        $j++;
                    }
                }
            }
            foreach ($lists['quiz_rows'] as $quiz_row) {
                $j = 0;
                while ($j < count($row->quiz_info)) {
                    if ($row->quiz_info[$j]->gbi_id == $quiz_row->c_id) {
                        if ($row->quiz_info[$j]->user_status == -1) {
                            echo '<td align=\'center\' valign="middle" nowrap="nowrap">' . '-' . '</td>';
                        } else {
                            $image = $row->quiz_info[$j]->user_status ? 'btn_accept.png' : 'btn_cancel.png';
                            $alt = $row->quiz_info[$j]->user_status ? 'btn_accept' : 'btn_cancel';
                            $img = JLMS_gradebook_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false);
                            echo '<td align=\'center\' valign="middle" nowrap="nowrap">' . $img . '&nbsp;<strong>' . $row->quiz_info[$j]->user_grade . "</strong> (" . $row->quiz_info[$j]->user_pts_full . ")" . '</td>';
                        }
                    }
                    $j++;
                }
            }
            $j = 0;
            while ($j < count($row->grade_info)) {
                echo '<td align=\'center\' valign="middle"><strong>' . $row->grade_info[$j]->user_grade . '</strong></td>';
                $j++;
            }
            ?>
						<td align="center" valign="middle">
							<?php 
            $image = $row->user_certificate ? 'btn_accept.png' : 'btn_cancel.png';
            $alt = $row->user_certificate ? _JLMS_GB_USER_HAVE_CRT : _JLMS_GB_USER_HAVE_NO_CRT;
            if (!$is_full) {
                $state = $row->user_certificate ? 0 : 1;
                echo JLMS_gradebook_html::publishIcon(0, 0, 0, '', $alt, $image, $option, false);
            } else {
                echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
            }
            ?>
						</td>
					</tr>
					<?php 
            $k = 3 - $k;
        }
        ?>
				</table>
			<?php 
        if (!$is_full) {
            ?>
	
			</div>
			<?php 
            if ($JLMS_CONFIG->get('new_lms_features', 1)) {
                $controls = array();
                $controls[] = array('href' => "javascript:submitFormView('csv');", 'title' => 'CSV', 'img' => 'csv');
                $controls[] = array('href' => "javascript:submitFormView('xls');", 'title' => 'XLS', 'img' => 'xls');
                JLMS_TMPL::ShowControlsFooterC($controls, '', false, false, _JLMS_EXPORT_TO . ':');
            }
            ?>
	
			<?php 
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="gradebook" />
			<input type="hidden" name="state" value="0" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
			<input type="hidden" name="view" value="" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
Пример #5
0
    function showTopicsList($course_id, $topics, $links, $elements, $span = 1)
    {
        global $option, $Itemid, $max_lvl, $JLMS_CONFIG;
        //	echo '<pre>'; var_dump($elements);die;
        $usertype = $JLMS_CONFIG->get('current_usertype', 0);
        $date_format = $JLMS_CONFIG->get('date_format_fdow', 1);
        ?>
		<script language="javascript" type="text/javascript">
		<!--//--><![CDATA[//><!--
		function topicSubmit ($topic_id, $task) {
			var $form = document.forms['topicForm_'+$topic_id];
			$form.task.value = $task;
			$form.submit();
		}
		function topicDelete ($topic_id) {
			var $form = document.forms['topicForm_'+$topic_id];
			$form.task.value = 'delete_topic';
			$form.submit();
		}
		function topicAdd ($topic_id) {
			var $form = document.forms['topicForm_'+$topic_id];
			$form.task.value = 'add_topic_element';
			$form.submit();
		}
		function topicChange ($topic_id, $def) {
			var $form = document.forms['topicForm_'+$topic_id];
			$form.task.value = 'change_element';
			$form.state.value = $def;
			$form.submit();
		}
		//same for isChecked function but has FORM name param
		function isChecked_mod(isitchecked, $form_name){
			if (isitchecked == true){
				document.forms[$form_name].boxchecked.value++;
			}
			else {
				document.forms[$form_name].boxchecked.value--;
			}
		}
		function checkAll_mod( n, fldName, $form_name ) {
			if (!fldName) {
				fldName = 'cb';
			}
			var f = document.forms[$form_name];
			var c = f.toggle.checked;
			var n2 = 0;
			for (i=0; i < n; i++) {
				cb = eval( 'f.' + fldName + '' + i );
				if (cb) {
					cb.checked = c;
					n2++;
				}
			}
			if (c) {
				document.forms[$form_name].boxchecked.value = n2;
			} else {
				document.forms[$form_name].boxchecked.value = 0;
			}
		}
		//--><!]]>
		</script>
		<?php 
        $topics_count = count($topics);
        foreach ($topics as $topic) {
            $topic_publish = publishUtility($topic->published, -1, $topic->publish_start, $topic->publish_end, $topic->start_date, $topic->end_date);
            ?>
		<div id="topicmain_<?php 
            echo $topic->id;
            ?>
" class="topicmaindiv<?php 
            echo $usertype != 2 && $topic_publish->state == 1 ? 2 : '';
            ?>
">
			<a name="topic_<?php 
            echo $topic->id;
            ?>
"><!--x--></a>
			<?php 
            echo JLMSCSS::h2($topic->name);
            ?>
			
			<div class="contentmain">
				<form name="topicForm_<?php 
            echo $topic->id;
            ?>
" method="post" action="<?php 
            echo sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid);
            ?>
">
				<?php 
            if ($topic->publish_start || $topic->publish_end || $topic->description || isset($links[$topic->id]) && count($links[$topic->id])) {
                ?>
				
				<div class="topics">
					
					<?php 
                JLMS_TMPL::OpenMT();
                $_JLMS_PLUGINS =& JLMSFactory::getPlugins();
                $_JLMS_PLUGINS->loadBotGroup('system');
                $plugin_args = array();
                $plugin_args[] = $topic->id;
                $_JLMS_PLUGINS->trigger('onAboveTopicDescription', $plugin_args);
                JLMS_TMPL::CloseMT();
                ?>
	
					<?php 
                if ($topic->publish_start || $topic->publish_end) {
                    ?>
					<div class="topic_createdate">
						<?php 
                    //if ($topic->publish_start) echo _JLMS_TOPIC_T_STARTS_ON.date("Y-m-d",strtotime($topic->start_date));
                    //if ($topic->publish_end) echo _JLMS_TOPIC_T_ENDS_ON.date("Y-m-d",strtotime($topic->end_date));
                    // 06.12.2007 - (DEN)
                    if ($topic->publish_start) {
                        echo _JLMS_TOPIC_T_STARTS_ON . ' ' . JLMS_dateToDisplay($topic->start_date) . ($topic->publish_end ? '&nbsp;' : '');
                    }
                    if ($topic->publish_end) {
                        echo _JLMS_TOPIC_T_ENDS_ON . ' ' . JLMS_dateToDisplay($topic->end_date);
                    }
                    ?>
					</div>
					<?php 
                }
                ?>
					<?php 
                if ($topic->description && isset($links[$topic->id]) && count($links[$topic->id])) {
                    ?>
					<div class="topic_description">
						<?php 
                    echo JLMS_ShowText_WithFeatures($topic->description);
                    #echo JLMS_ShowText_WithFeatures('{readmore title="FIRST"}text{readmore}text{/readmore}'); //for test
                    ?>
						<?php 
                    if (isset($links[$topic->id]) && count($links[$topic->id])) {
                        echo '<br />';
                    }
                    ?>
						<div class="topic_elements">
							<?php 
                    echo JLMS_topic_html::showTopicElements($course_id, $topic, $links, $elements, $span);
                    ?>
						</div>
						<?php 
                    global $JLMS_topic_readmore_closeTag, $JLMS_count_begin_tags, $JLMS_count_end_tags;
                    if ($JLMS_topic_readmore_closeTag) {
                        if (isset($JLMS_count_begin_tags) && isset($JLMS_count_end_tags)) {
                            $stop = 0;
                            if ($JLMS_count_begin_tags > $JLMS_count_end_tags) {
                                $stop = $JLMS_count_begin_tags - $JLMS_count_end_tags;
                            }
                            $i = 0;
                            while ($i < $stop) {
                                echo '<div class="clr"><!-- --></div>' . "\n";
                                echo '</div>' . "\n";
                                $i++;
                            }
                        }
                    }
                    ?>
					</div>
					<?php 
                } else {
                    if (!$topic->description && isset($links[$topic->id]) && count($links[$topic->id])) {
                        ?>
						<div class="topic_elements">
							<?php 
                        //echo JLMS_topic_html::showTopicElements($course_id, $topic, $links, $elements, $span=1);
                        echo JLMS_topic_html::showTopicElements($course_id, $topic, $links, $elements, $span);
                        ?>
						</div>
					<?php 
                    } else {
                        if ($topic->description && (!isset($links[$topic->id]) || !count($links[$topic->id]))) {
                            ?>
						<div class="topic_description">
						<?php 
                            echo JLMS_ShowText_WithFeatures($topic->description);
                            ?>
						<?php 
                            if (isset($links[$topic->id]) && count($links[$topic->id])) {
                                echo '<br />';
                            }
                            ?>
						<?php 
                            global $JLMS_topic_readmore_closeTag, $JLMS_count_begin_tags, $JLMS_count_end_tags;
                            if ($JLMS_topic_readmore_closeTag) {
                                if (isset($JLMS_count_begin_tags) && isset($JLMS_count_end_tags)) {
                                    $stop = 0;
                                    if ($JLMS_count_begin_tags > $JLMS_count_end_tags) {
                                        $stop = $JLMS_count_begin_tags - $JLMS_count_end_tags;
                                    }
                                    $i = 0;
                                    while ($i < $stop) {
                                        echo '<div class="clr"><!-- --></div>' . "\n";
                                        echo '</div>' . "\n";
                                        $i++;
                                    }
                                }
                            }
                            ?>
					</div>
					<?php 
                        }
                    }
                }
                ?>
				</div>
				<?php 
            }
            ?>
				<input type="hidden" name="option" value="<?php 
            echo $option;
            ?>
" />
				<input type="hidden" name="Itemid" value="<?php 
            echo $Itemid;
            ?>
" />
				<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="task" value="" />
				<input type="hidden" name="id" value="<?php 
            echo $course_id;
            ?>
" />
				<input type="hidden" name="state" value="0" />
				<input type="hidden" name="topic_id" value="<?php 
            echo $topic->id;
            ?>
" />
				<input type="hidden" name="topic_ordering" value="<?php 
            echo $topic->ordering;
            ?>
" />
				<?php 
            $is_curtopic = intval(mosgetparam($_REQUEST, 't_id', 0));
            echo "<input type='hidden' name='t_id' value='" . $is_curtopic . "' />";
            ?>
	
				</form>			
				<?php 
            $controls = array();
            $controls[] = array('href' => "javascript:if(document.topicForm_{$topic->id}.boxchecked.value==0){alert('" . str_replace(' ', '%20', _JLMS_TOPIC_E_NO_ELEMENTS_CHOSEN) . "');}else{topicChange({$topic->id},0);}", 'title' => _JLMS_PUBLISH_ELEMENT, 'img' => 'publish');
            $controls[] = array('href' => "javascript:if(document.topicForm_{$topic->id}.boxchecked.value==0){alert('" . str_replace(' ', '%20', _JLMS_TOPIC_E_NO_ELEMENTS_CHOSEN) . "');}else{topicChange({$topic->id},1);}", 'title' => _JLMS_UNPUBLISH_ELEMENT, 'img' => 'unpublish');
            $controls[] = array('href' => "javascript:if(document.topicForm_{$topic->id}.boxchecked.value==0){alert('" . str_replace(' ', '%20', _JLMS_TOPIC_E_NO_ELEMENTS_CHOSEN) . "');}else{topicSubmit({$topic->id},'delete_topic_element');}", 'title' => _JLMS_DELETE_ELEMENT, 'img' => 'delete');
            $controls[] = array('href' => "javascript:topicAdd({$topic->id});", 'title' => _JLMS_ADD_ELEMENTS, 'img' => 'add');
            $controls[] = array('href' => 'spacer');
            $controls[] = array('href' => 'spacer');
            $publish_options = publishUtility_topic($topic->published, $topic->publish_start, $topic->publish_end, $topic->start_date, $topic->end_date);
            $controls[] = array('href' => JLMSRoute::_("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=publish_topic&amp;state=" . (1 - $publish_options->state) . "&amp;id=" . $course_id . "&amp;topic_id={$topic->id}"), 'title' => $publish_options->state == 1 ? _JLMS_TOPIC_PUBLISHED : _JLMS_TOPIC_UNPUBLISHED, 'img' => $publish_options->state == 1 ? 'publish' : 'unpublish');
            $controls[] = array('href' => "javascript:if(confirm('" . str_replace(' ', '%20', _JLMS_TOPIC_T_CONFIRM_DELETE) . "')){topicDelete({$topic->id});}", 'title' => _JLMS_TOPIC_T_DELETE, 'img' => 'delete');
            global $Itemid, $option;
            $course_id = intval(mosGetParam($_REQUEST, 'id', 0));
            $controls[] = array('href' => JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=edit_topic&amp;id={$course_id}&amp;topic_id={$topic->id}"), 'title' => _JLMS_TOPIC_T_EDIT, 'img' => 'edit');
            if ($topic->ordering > 0) {
                $controls[] = array('href' => "javascript:topicSubmit({$topic->id},'orderup_topic')", 'title' => _JLMS_TOPIC_T_MOVEUP, 'img' => 'up');
            }
            if ($topic->ordering < $topics_count - 1) {
                $controls[] = array('href' => "javascript:topicSubmit({$topic->id},'orderdown_topic')", 'title' => _JLMS_TOPIC_T_MOVEDOWN, 'img' => 'down');
            }
            if ($usertype == 2) {
                $controls = array();
            }
            JLMS_TMPL::ShowControlsFooterC($controls);
            ?>
			</div>
		</div>
			<?php 
        }
    }
Пример #6
0
 function ShowControlsFooter($controls, $back_link = '', $top_link = true, $full_path = false, $pretext = '')
 {
     global $JLMS_CONFIG;
     if (!empty($controls)) {
         JLMS_TMPL::OpenTS();
         JLMS_TMPL::ShowControlsFooterC($controls, $back_link, $top_link, $full_path, $pretext);
         JLMS_TMPL::CloseTS();
     }
 }