function Echo_userinfo($name, $username, $email, $link)
 {
     $ret_str = '';
     $title = JLMS_txt2overlib(_JLMS_USER_INFORMATION);
     $content = _JLMS_UI_USERNAME . ' ' . $username . '<br />' . _JLMS_UI_NAME . ' ' . $name . '<br />' . _JLMS_UI_EMAIL . ' ' . $email;
     return JLMS_toolTip($title, $content, $name, $link, '1', '30', true, 'jlms_ttip');
 }
    function jlms_booking_list($course_id, $option, &$rows, $pageNav, &$lists)
    {
        global $Itemid, $my, $JLMS_DB, $JLMS_CONFIG;
        JLMS_TMPL::OpenMT();
        $params = array('show_menu' => true);
        JLMS_TMPL::ShowHeader('conference', _JLMS_HEAD_CONF_STR, $params);
        JLMS_TMPL::OpenTS();
        ?>
		
	<script type="text/javascript" language="javascript">
	<!--//--><![CDATA[//><!--
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'new_period')
		{
			form.mode.value = pressbutton;
			form.submit();
		}
		else
		{
			if ( form.boxchecked.value == "0" ){
				alert("<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
");
			} else {
				if (pressbutton == 'period_delete'){
					if (confirm("<?php 
        echo 'Are you sure?';
        ?>
") == true){
						form.mode.value = pressbutton;
						form.submit();
					}
				}else{
					form.mode.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">
			<tr>
				<td colspan="2">
					<?php 
        $link_PN = "index.php?option={$option}&Itemid={$Itemid}&task=conference&mode=booking&course_id=" . $course_id;
        echo $pageNav->getLimitBox($link_PN) . "&nbsp;" . $pageNav->getPagesCounter($link_PN);
        echo '. Filter: ' . $lists['filter_teach'] . $lists['filter_stu'];
        ?>
				</td>
				<td style="text-align:right;"><br />
					<?php 
        $toolbar = array();
        //$toolbar[] = array('btn_type' => 'edit', 'btn_js' => sefRelToAbs("index.php?option=$option&amp;Itemid=$Itemid&amp;task=conference&amp;id=$course_id&amp;mode=archive") );
        $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=conference&amp;id={$course_id}"));
        echo JLMS_ShowToolbar($toolbar);
        ?>
				</td>
			</tr>
		</table>
<?php 
        /*JLMS_TMPL::CloseTS();
        		JLMS_TMPL::OpenTS();*/
        ?>
		
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="sectiontableheader" align="left" width="15">#</td>

					<td class="sectiontableheader" align="left" width="10"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></td>
					<td class="sectiontableheader" align="left"><?php 
        echo "Name";
        ?>
</td>
					<td class="sectiontableheader" align="left"><?php 
        echo "Teacher";
        ?>
</td>
					<td class="sectiontableheader" nowrap="nowrap" align="left"><?php 
        echo "Time";
        ?>
</td>

					<td class="sectiontableheader" align="left"><?php 
        echo "Date";
        ?>
</td>

					<td class="sectiontableheader" align="left"><?php 
        echo "Access";
        ?>
</td>

					
					
				</tr>
			<?php 
        $k = 1;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            //$link 	= sefRelToAbs("index.php?option=".$option."&Itemid=".$Itemid."&task=details_course&id=". $row->course_id);
            $checked = mosHTML::idBox($i, $row->p_id);
            $overlib_descr = JLMS_txt2overlib($row->p_description);
            $overlib_title = "Description";
            ?>
				<tr valign="middle" style="vertical-align:middle" class="<?php 
            echo "sectiontableentry{$k}";
            ?>
">
					<td align="left"><?php 
            echo $pageNav->limitstart + $i + 1;
            ?>
</td>
					<td align="left"><?php 
            echo $checked;
            ?>
</td>
					<td align="left">
						<?php 
            $inside_tag = $row->p_name ? $row->p_name : "";
            echo JLMS_toolTip($overlib_title, $overlib_descr, $inside_tag);
            ?>
 
					</td>
					<td align="left">
						<?php 
            if ($row->user_teacher_id) {
                echo $row->name;
            } else {
                echo 'Not selected';
            }
            ?>
					</td>
					<td align="left">
						<?php 
            echo date("H:i", $row->from_time) . " - " . date("H:i", $row->to_time);
            ?>
					</td>
					<td align="left">
					<?php 
            echo date("Y-m-d", $row->from_time);
            /*
            	<a href="javascript:startAppPlayback('<?php echo sefRelToAbs('index.php?tmpl=component&option=com_joomla_lms&task=conference&mode=conference_playback&Itemid='.$Itemid.'&id='.$course_id.'&name='.$row->record_name );?>');" title="View details">
            		<?php echo $row->session_name;?>
            	</a>
            */
            ?>
	
					</td>
					<td align="left">
						<?php 
            $query = "SELECT u.username FROM #__lms_conference_usr as cu, #__users as u WHERE cu.p_id = '" . $row->p_id . "' AND cu.user_id= u.id";
            $JLMS_DB->setQuery($query);
            $cur_users = $JLMS_DB->LoadResultArray();
            $cur_users = implode(',', $cur_users);
            $ulink = sefRelToAbs('index.php?option=com_joomla_lms&task=conference&mode=user_access&Itemid=' . $Itemid . '&course_id=' . $course_id . '&amp;pid=' . $row->p_id);
            echo $row->public ? 'Public' : '<a href="' . $ulink . '">' . ($cur_users ? $cur_users : "Specify user") . '</a>';
            ?>
					</td>
				</tr>
				<?php 
            $k = 3 - $k;
        }
        ?>
				<tr>
					<td colspan="7" align="center">	
						<?php 
        if (count($rows) == 0) {
            echo _JLMS_CONFERENCE_NO_RECORD;
        } else {
            echo $pageNav->writePagesLinks($link_PN);
        }
        ?>
					</td>	
				</tr>
			</table>
			<input type="hidden" name="task" value="conference" />
			<input type="hidden" name="mode" value="booking" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="id" value="<?php 
        echo $course_id;
        ?>
" />
			<input type="hidden" name="state" value="0" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        $controls = array();
        $controls[] = array('href' => "javascript:submitbutton('period_delete');", 'title' => _JLMS_DELETE, 'img' => 'delete');
        $controls[] = array('href' => "javascript:submitbutton('edit_period');", 'title' => _JLMS_EDIT, 'img' => 'edit');
        $controls[] = array('href' => "javascript:submitbutton('new_period');", 'title' => 'New', 'img' => 'add');
        JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=conference&amp;id={$course_id}"));
        JLMS_TMPL::CloseMT();
    }
    function showCourseLPath($course_id, $lpath_id, &$lpath, &$conds, $option)
    {
        global $Itemid, $JLMS_CONFIG;
        ?>

<script language="javascript" type="text/javascript">
<!--
function submitbutton(pressbutton) {
	var form = document.adminForm;

	// do field validation
	if (((pressbutton == 'lpath_item_delete') || (pressbutton == 'lpath_item_edit')) && (form.boxchecked.value == "0")){
		alert( "<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
" );
	} else {
		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_order(pressbutton, item_id) {
	var form = document.adminForm;
	if ((pressbutton == 'lpath_item_orderup') || (pressbutton == 'lpath_item_orderdown')){
		if (item_id) {
		form.task.value = pressbutton;
		form.row_id.value = item_id;
		form.submit();
		}
	}
}
/*
Ordering (Max)
*/
function checkAll_button( n ) {
	for ( var j = 0; j <= n; j++ ) {
		box = eval( "document.adminForm.cb" + j );
		if ( box ) {
			if ( box.checked == false ) {
				box.checked = true;
			}
		} else {
			alert("You cannot change the order of items, as an item in the list is `Checked Out`");
			return;
		}
	}
	submitform('lpath_item_saveorder');
}
var TreeArray1 = new Array();
var TreeArray2 = new Array();
var Is_ex_Array = new Array();
<?php 
        $i = 1;
        foreach ($lpath as $lpath_row) {
            echo "TreeArray1[" . $i . "] = " . $lpath_row->parent_id . ";";
            echo "TreeArray2[" . $i . "] = " . $lpath_row->id . ";";
            echo "Is_ex_Array[" . $i . "] = 1;" . "\n";
            $i++;
        }
        ?>
function Hide_Folder(fid) {
	var vis_style = 'hidden';var dis_style = 'none';var i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
			Hide_Folder(TreeArray2[i]); }
		i++; }
}
function Show_Folder(fid) {
	var vis_style = 'visible';var dis_style = '';var i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
			NoChange_Folder(TreeArray2[i]); }
		i++; }
}
function NoChange_Folder(fid) {
	var vis_style = 'hidden';var dis_style = 'none';var i = 1;var j = 0;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) && (Is_ex_Array[i] == 1) ) {
			vis_style = 'visible';dis_style = '';j = 1; }
		i++; }
	i = 1;
	while (i < TreeArray1.length) {
		if (TreeArray1[i] == fid) {
			getObj('tree_row_'+TreeArray2[i]).style.visibility = vis_style;
			getObj('tree_row_'+TreeArray2[i]).style.display = dis_style;
			if (j == 1) { NoChange_Folder(TreeArray2[i]);
			} else { Hide_Folder(TreeArray2[i]); } }
		i++; }
}

function Ex_Folder(fid) {
	var i = 1;var j = 1;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) && (Is_ex_Array[i] == 1) ) { j = 0; } i ++; }
	if (j == 1) {
		Show_Folder(fid);
		if (getObj('tree_img_' + fid).runtimeStyle) {
			var StStr = getObj('tree_img_' + fid).runtimeStyle.filter;
			var imgStr = getObj('tree_img_' + fid).outerHTML;
			imgStr = imgStr.replace('chapter_expand.png','chapter_collapse.png').replace('<?php 
        echo _JLMS_LPATH_EXP_CHAP;
        ?>
', '<?php 
        echo _JLMS_LPATH_COLL_CHAP;
        ?>
');
			StStr = StStr.replace('chapter_expand.png','chapter_collapse.png');
			getObj('tree_img_' + fid).outerHTML = imgStr;
			getObj('tree_img_' + fid).runtimeStyle.filter = StStr;
		} else {
			getObj('tree_img_' + fid).src = '<?php 
        echo $JLMS_CONFIG->getCfg('live_site');
        ?>
/components/com_joomla_lms/lms_images/learnpath/chapter_collapse.png';
			getObj('tree_img_' + fid).alt = '<?php 
        echo _JLMS_LPATH_COLLAPSE;
        ?>
';
			getObj('tree_img_' + fid).title = '<?php 
        echo _JLMS_LPATH_COLL_CHAP;
        ?>
';
		}
	} else {
		Hide_Folder(fid);
		if (getObj('tree_img_' + fid).runtimeStyle) {
			var StStr = getObj('tree_img_' + fid).runtimeStyle.filter;
			var imgStr = getObj('tree_img_' + fid).outerHTML;
			imgStr = imgStr.replace('chapter_collapse.png','chapter_expand.png').replace('<?php 
        echo _JLMS_LPATH_COLL_CHAP;
        ?>
', '<?php 
        echo _JLMS_LPATH_EXP_CHAP;
        ?>
');
			StStr = StStr.replace('chapter_collapse.png','chapter_expand.png');
			getObj('tree_img_' + fid).outerHTML = imgStr;
			getObj('tree_img_' + fid).runtimeStyle.filter = StStr;
		} else {
			getObj('tree_img_' + fid).src = '<?php 
        echo $JLMS_CONFIG->getCfg('live_site');
        ?>
/components/com_joomla_lms/lms_images/learnpath/chapter_expand.png';
			getObj('tree_img_' + fid).alt = '<?php 
        echo _JLMS_LPATH_EXPAND;
        ?>
';
			getObj('tree_img_' + fid).title = '<?php 
        echo _JLMS_LPATH_EXP_CHAP;
        ?>
';
		}
	}
	i = 1;
	while (i < TreeArray2.length) {
		if ( (TreeArray2[i] == fid) ) {
			if (Is_ex_Array[i] == 1) { Is_ex_Array[i] = 0; } else { Is_ex_Array[i] = 1; } }
		i++; }
}
JLMS_preloadImages('<?php 
        echo $JLMS_CONFIG->getCfg('live_site');
        ?>
/components/com_joomla_lms/lms_images/learnpath/chapter_expand.png','<?php 
        echo $JLMS_CONFIG->getCfg('live_site');
        ?>
/components/com_joomla_lms/lms_images/learnpath/chapter_collapse.png');
//-->
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        JLMS_TMPL::ShowHeader('lpath', _JLMS_LPATH_TITLE_LP, $hparams);
        $max_tree_width = 0;
        if (isset($lpath[0])) {
            $max_tree_width = $lpath[0]->tree_max_width;
        }
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo $JLMS_CONFIG->getCfg('live_site') . "/index.php?option=" . $option . "&amp;Itemid=" . $Itemid;
        ?>
" method="post" name="adminForm">
		<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');
        ?>
">&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="30%"><?php 
        echo _JLMS_LPATH_TBL_HEAD_NAME_LP;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" colspan="2" width="1"><?php 
        echo _JLMS_REORDER;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="1"><?php 
        echo _JLMS_ORDER;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="1">
					<a class="jlms_img_link" href="javascript:checkAll_button(<?php 
        echo count($lpath) - 1;
        ?>
)"><img width="16" height="16" border="0" title="<?php 
        echo _JLMS_SAVEORDER;
        ?>
" alt="<?php 
        echo _JLMS_SAVEORDER;
        ?>
" src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/filesave.png"/></a>
				</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" colspan="2" width="1">&nbsp;</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="60%"><?php 
        echo _JLMS_LPATH_TBL_HEAD_DESCR_LP;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
			</tr>
		<?php 
        $k = 1;
        $tree_modes = array();
        for ($i = 0, $n = count($lpath); $i < $n; $i++) {
            $row_path = $lpath[$i];
            $max_tree_width = $row_path->tree_max_width;
            $link = "index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=details_course&amp;id=" . $row_path->id;
            //ne zabyt' sefRelToAbs
            $checked = mosHTML::idBox($i, $row_path->id);
            ?>
			
			<tr id="tree_row_<?php 
            echo $row_path->id;
            ?>
" class="<?php 
            echo JLMSCSS::_('sectiontableentry' . $k);
            ?>
">
				<td align="center" valign="middle"><?php 
            echo $i + 1;
            ?>
</td>
				<td valign="middle"><?php 
            if (!isset($row_path->is_link)) {
                echo $checked;
            }
            ?>
</td>
				<?php 
            $add_img = '';
            if ($row_path->tree_mode_num) {
                $g = 0;
                $tree_modes[$row_path->tree_mode_num - 1] = $row_path->tree_mode;
                while ($g < $row_path->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' border='0' /></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_path->tree_mode . ".png\" width='16' height='16' border='0' alt='sub' /></td>";
                $max_tree_width = $max_tree_width - $g - 1;
            }
            echo $add_img;
            ?>
				<td valign="middle" align="center" width="16"><div align="center" style="vertical-align:middle;"><?php 
            switch ($row_path->step_type) {
                case 1:
                    echo "<span id='tree_div_" . $row_path->id . "' style='text-align:center; cursor:pointer; vertical-align:middle;' onclick='Ex_Folder(" . $row_path->id . "," . $row_path->id . ",true)'><img id='tree_img_" . $row_path->id . "' class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/learnpath/chapter_collapse.png\" width='16' height='16' border='0' alt='chapter' /></span>";
                    break;
                case 2:
                    if (isset($row_path->folder_flag) && $row_path->folder_flag == 2) {
                        echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/file_zippack.png\" width='16' height='16' border='0' alt='zip package' /></span>";
                    } else {
                        echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/" . $row_path->file_icon . ".png\" width='16' height='16' border='0' alt='file' /></span>";
                    }
                    break;
                case 3:
                    echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/link_world.png\" width='16' height='16' border='0' alt='link' /></span>";
                    break;
                case 4:
                    echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/files/file_content.png\" width='16' height='16' border='0' alt='content' /></span>";
                    break;
                case 5:
                    echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/toolbar/tlb_quiz.png\" width='16' height='16' border='0' alt='quiz' /></span>";
                    break;
                case 6:
                    echo "<span style='text-align:center;'><img class='JLMS_png' src=\"" . $JLMS_CONFIG->get('live_site') . "/components/com_joomla_lms/lms_images/toolbar/tlb_scorm.png\" width='16' height='16' border='0' alt='scorm' /></span>";
                    break;
            }
            ?>
				</div>
				</td>
				<td width="30%" align="left" valign="middle" <?php 
            if ($max_tree_width > 0) {
                echo "colspan='" . ($max_tree_width + 1) . "'";
            }
            ?>
>
					<?php 
            if ($row_path->step_type == 1) {
                echo "<strong>" . $row_path->doc_name . "</strong>";
            } elseif ($row_path->step_type == 2) {
                if ($row_path->folder_flag == 2 && $row_path->file_id) {
                    $link_download = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=docs_view_zip&amp;course_id=" . $course_id . "&amp;id=" . $row_path->item_id);
                    echo '<a target="_blank" href="' . $link_download . '" title="' . _JLMS_T_A_VIEW_ZIP_PACK . '">' . $row_path->doc_name . '</a>';
                } elseif ((!$row_path->folder_flag || $row_path->folder_flag == 3) && !$row_path->file_id) {
                    if (!isset($row_path->is_link)) {
                        $link_download = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=docs_view_content&amp;course_id=" . $course_id . "&amp;id=" . $row_path->item_id);
                        echo '<a target="_blank" href="' . $link_download . '" title="' . _JLMS_T_A_VIEW_CONTENT . '">' . $row_path->doc_name . '</a>';
                    } else {
                        echo $row_path->doc_name;
                    }
                } else {
                    if (!isset($row_path->is_link)) {
                        $link_download = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=get_document&amp;course_id=" . $course_id . "&amp;id=" . $row_path->item_id . "&amp;lpath_id=" . $lpath_id);
                        echo '<a href="' . $link_download . '" title="' . _JLMS_T_A_DOWNLOAD . '">' . $row_path->doc_name . '</a>';
                    } else {
                        echo $row_path->doc_name;
                    }
                }
            } elseif ($row_path->step_type == 3) {
                echo '<a target="_blank" href="' . $row_path->link_href . '" title="' . _JLMS_T_A_VIEW_LINK . '">' . $row_path->doc_name . '</a>';
            } elseif ($row_path->step_type == 4) {
                echo '<a href="' . sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=show_lp_content&amp;course_id=" . $course_id . "&amp;lpath_id=" . $row_path->lpath_id . "&amp;id=" . $row_path->id) . '" title="' . _JLMS_T_A_VIEW_CONTENT . '">' . $row_path->doc_name . '</a>';
            } else {
                echo $row_path->doc_name;
            }
            ?>
				</td>
				<td valign="middle" style="vertical-align:middle;"><?php 
            if ($row_path->allow_up == 1) {
                echo JLMS_orderUpIcon(1, $row_path->id, true, 'lpath_item_orderup');
            } else {
                echo '&nbsp;';
            }
            ?>
</td>
				<td valign="middle" style="vertical-align:middle;"><?php 
            if ($row_path->allow_down == 1) {
                echo JLMS_orderDownIcon(1, 3, $row_path->id, true, 'lpath_item_orderdown');
            } else {
                echo '&nbsp;';
            }
            ?>
</td>
				<td valign="middle" style="vertical-align:middle;" colspan="2">
					<?php 
            //					if ($row_path->step_type != 1) {
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row_path->ordering;
            ?>
" class="inputbox" style="text-align: center" />
					<?php 
            //					}
            ?>
				</td>
				<td valign="middle" style="vertical-align:middle ">
					<?php 
            if ($row_path->step_type == 1) {
                ?>
						<a class="jlms_img_link" href="<?php 
                echo $JLMS_CONFIG->getCfg('live_site') . "/index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=add_lpath_step&amp;course_id=" . $row_path->course_id . "&amp;id=" . $row_path->lpath_id . "&amp;parent=" . $row_path->id;
                ?>
" title="<?php 
                echo _JLMS_LPATH_LINK_ADDSTEP_TITLE;
                ?>
"><img class="JLMS_png" src="<?php 
                echo $JLMS_CONFIG->get('live_site');
                ?>
/components/com_joomla_lms/lms_images/toolbar/btn_add.png" width="16" height="16" border="0" alt="<?php 
                echo _JLMS_LPATH_LINK_ADDSTEP_TITLE;
                ?>
" title="<?php 
                echo _JLMS_LPATH_LINK_ADDSTEP_TITLE;
                ?>
" /></a>
					<?php 
            } else {
                echo '&nbsp;';
            }
            ?>
				</td>
				<td valign="middle" style="vertical-align:middle ">
					<?php 
            $cond_link = sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=lpath_step_cond&amp;course_id={$course_id}&amp;lpath_id={$lpath_id}&amp;id={$row_path->id}");
            $cond_descr = _JLMS_LPATH_FLWINDOW_NOCOND;
            $cond_title = _JLMS_LPATH_TITLE_FLWINDOW;
            $cond_img = 'btn_warning';
            if ($row_path->is_condition) {
                $cond_img = 'btn_cond_present';
                $y = 0;
                $is_cond_descr = false;
                $cond_descr = '<table cellpadding=0 cellspacing=0 border=0>';
                while ($y < count($conds)) {
                    if ($conds[$y]->step_id == $row_path->id) {
                        $ref_name = '';
                        $u = 0;
                        while ($u < count($lpath)) {
                            if ($lpath[$u]->id == $conds[$y]->ref_step) {
                                $ref_name = $lpath[$u]->step_name;
                                break;
                            }
                            $u++;
                        }
                        if (isset($conds[$y]->cond_time) && $conds[$y]->cond_time) {
                            $ref_name .= ' (' . _JLMS_LPATH_CONDTYPE_SPENT . ' ' . $conds[$y]->cond_time . ' ' . _JLMS_LPATH_CONDTYPE_TIME_SPENT_MIN . ')';
                        }
                        $cond_descr .= '<tr><td>' . _JLMS_LPATH_CONDTYPE_COMPLETE_W . '&nbsp;</td><td>' . $ref_name . '</td></tr>';
                        $is_cond_descr = true;
                    }
                    $y++;
                }
                $cond_descr .= '</table>';
                if (!$is_cond_descr) {
                    $cond_descr = _JLMS_LPATH_FLWINDOW_NOCOND;
                }
            }
            $img_inside_tag = '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $cond_img . '.png" width="16" height="16" border="0" alt="cond" />';
            echo JLMS_toolTip($cond_title, JLMS_txt2overlib($cond_descr), $img_inside_tag, $cond_link);
            ?>
				</td>
				<td width="60%" valign="middle" style="vertical-align:middle; "><?php 
            echo strlen($row_path->step_shortdescription) ? $row_path->step_shortdescription : '&nbsp;';
            ?>
</td>
			</tr>
			<?php 
            $k = 3 - $k;
        }
        ?>
		</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="lpath_add_chapter" />
			<input type="hidden" name="id" value="<?php 
        echo $lpath_id;
        ?>
" />
			<input type="hidden" name="course_id" value="<?php 
        echo $course_id;
        ?>
" />
			<input type="hidden" name="row_id" value="0" />
			<input type="hidden" name="boxchecked" value="0" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        $link_new = ampReplace(sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=new_lpath_chapter&amp;id=" . $lpath_id . "&amp;course_id=" . $course_id));
        $controls = array();
        //$controls[] = array('href' => $link_new, 'onclick' => "", 'title' => _JLMS_LPATH_LINK_NEW_CHAP, 'img' => 'add');
        $controls[] = array('href' => "javascript:submitbutton('add_lpath_step');", 'onclick' => "", 'title' => _JLMS_LPATH_LINK_ADDSTEP_TITLE, 'img' => 'add');
        $controls[] = array('href' => "javascript:submitbutton('lpath_item_delete');", 'onclick' => "", 'title' => _JLMS_LPATH_LINK_DEL_ITEM, 'img' => 'delete');
        $controls[] = array('href' => "javascript:submitbutton('lpath_item_edit');", 'onclick' => "", 'title' => _JLMS_LPATH_LINK_EDIT_ITEM, 'img' => 'edit');
        //$controls[] = array('href' => "spacer");
        JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=learnpaths&amp;id=" . $course_id));
        JLMS_TMPL::CloseMT();
    }
Пример #4
0
    function show_calendar_week($id, $option, $rows, $date)
    {
        $JLMS_CONFIG =& JLMSFactory::getConfig();
        $Itemid = $JLMS_CONFIG->get('Itemid');
        $month = date('m', $date);
        $day = date('j', $date);
        $year = date('Y', $date);
        $choose_date = JLMS_dateToDisplay(date('Y-m-d', $date));
        $date_format_fdow = $JLMS_CONFIG->get('date_format_fdow');
        /*<script type="text/javascript" src="<?php echo $JLMS_CONFIG->get('live_site');?>/includes/js/joomla.javascript.js "></script>*/
        ?>
		<script type="text/javascript" language="javascript">
		<!--
		function td_hover(elem){
			getObj(elem).style['background'] = '#EEEEEE';
			getObj(elem).style.color = '#000000';
			//getObj(elem).style.cursor = 'pointer';
		}
		//function out to other days
		function td_out(elem){
			getObj(elem).style['background'] = '';
			getObj(elem).style.color = '';
		}
		//function out to weekneds days
		function td_out2(elem){
			getObj(elem).style['background'] = '#E1CDCD';
			getObj(elem).style.color = '';
		}
		//function out to current day
		function td_out3(elem){
			getObj(elem).style['background'] = '#FBA179';
			getObj(elem).style.color = '';
		}
		-->
		</script>	
		<script language="javascript" type="text/javascript">
		<!--//
		function quick_date(){
			document.forms.jlms_agenda_form_day.submit();
		}	//-->
		</script>
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}");
        ?>
" method="post" name="jlms_agenda_form_day">
		<table cellpadding="0" cellspacing="0" border="0" style="height:20px" class="jlms_table_no_borders">
			<tr>
				<td valign="middle" align="center" width="18">
				<?php 
        echo JLMS_HTML::_('calendar.calendar', $choose_date, 'cal', 'jlms_choose', null, null, 'statictext');
        ?>
				
				</td><td valign="middle" align="center" width="18">
				<span onclick="quick_date()" style=" cursor:pointer" title="<?php 
        echo _JLMS_AGENDA_GO_DATE;
        ?>
">
				<img src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/agenda/loopnone.png" alt="<?php 
        echo _JLMS_AGENDA_GO_DATE;
        ?>
" title="<?php 
        echo _JLMS_AGENDA_GO_DATE;
        ?>
" id="go_date" border="0" width="16" height="16" class="JLMS_png" />
				</span>
				</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="agenda" />
		<input type="hidden" name="mode" value="view_week" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
		</form>
		<?php 
        $wday = JDDayOfWeek(GregorianToJD($month, $day, $year), 0);
        if ($date_format_fdow == 1) {
            if ($wday == 0) {
                $wday = 7;
            }
            $mon_day_num = strtotime("-" . ($wday - 1) . " day", $date);
            $sun_day_num = strtotime("+" . (7 - $wday) . " day", $date);
            $num_sat = 5;
            $num_sun = 6;
        } else {
            $mon_day_num = strtotime("-" . $wday . " day", $date);
            $sun_day_num = strtotime("+" . (6 - $wday) . " day", $date);
            $num_sat = 0;
            $num_sun = 6;
        }
        ?>
		<!-- Shablon calendaria. -->
		<table cellpadding="0" cellspacing="0" width="100%">
			<tr style="background: url('<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/agenda/bg.jpg') #cccccc repeat-x; font-weight:bold; color:white;height:20px " valign="middle">
				<td valign="middle" align="center">
				<a class="jlms_img_link" href="<?php 
        echo sefRelToAbs("index.php?option={$option}&amp;Itemid=" . $Itemid . "&amp;task=agenda&amp;mode=view_week&amp;id=" . $id . "&amp;date=" . JLMS_dateToDisplay(strtotime("-1 week", $date), true));
        ?>
">
				<img src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/agenda/ag_previous.png" class="JLMS_png" alt="<?php 
        echo _JLMS_AGENDA_PREVIOUSWEEK;
        ?>
" title="<?php 
        echo _JLMS_AGENDA_PREVIOUSWEEK;
        ?>
" width="16" height="16"  border="0"/>
				</a>
				</td>
				<td align="center" style="text-align:center" valign="middle" colspan="5">
				(<?php 
        echo day_month_lang(date('w d m Y', $mon_day_num), 0, 1, 5, 2) . "&nbsp;&nbsp;-&nbsp;&nbsp;" . day_month_lang(date('w d m Y', $sun_day_num), 0, 1, 5, 2);
        ?>
)
				</td>
				<td valign="middle" align="center">
				<a class="jlms_img_link" href="<?php 
        echo sefRelToAbs("index.php?option={$option}&amp;Itemid=" . $Itemid . "&amp;task=agenda&amp;mode=view_week&amp;id=" . $id . "&amp;date=" . JLMS_dateToDisplay(strtotime("+1 week", $date), true));
        ?>
">
				<img src="<?php 
        echo $JLMS_CONFIG->get('live_site');
        ?>
/components/com_joomla_lms/lms_images/agenda/ag_next.png" class="JLMS_png" alt="<?php 
        echo _JLMS_AGENDA_NEXTWEEK;
        ?>
" title="<?php 
        echo _JLMS_AGENDA_NEXTWEEK;
        ?>
" width="16" height="16"  border="0"/>
				</a></td>
			</tr>	
		<!-- cycle of rows -->
		<?php 
        echo "<tr>";
        $i = 0;
        $br_right = '';
        for ($i; $i < 7; $i++) {
            if ($i == 6) {
                $br_right = ';border-right:1px solid #B3B3B3';
            }
            echo "<td style='width:14%;text-align:center; height:15px;background:#cccccc;border-bottom:1px solid #B3B3B3; border-left:1px solid #B3B3B3 {$br_right}' >" . month_lang(strftime('%m %Y', strtotime("+{$i} day", $mon_day_num)), 0, 2) . "<br />" . day_month_lang(date("w", strtotime("+{$i} day", $mon_day_num)), 0, 1, 0, 0) . "</td>";
        }
        echo "</tr>";
        $i = 0;
        echo "<tr>";
        for ($i; $i < 7; $i++) {
            if ($i == $num_sat || $i == $num_sun) {
                $color = '';
                if ($i == 6) {
                    $color = "border-right:1px solid #B3B3B3;  ";
                }
                $color .= "background:#E1CDCD;border-left:1px solid #B3B3B3; border-bottom:1px solid #B3B3B3; ";
                $w = '2';
            } else {
                $color = 'border-bottom:1px solid #B3B3B3; border-left:1px solid #B3B3B3;';
                $w = '';
            }
            if (date("" . $year . "-" . $month . "-" . $i . "", $date) == date('Y-m-d')) {
                $color = "background:#FBA179;border:1px solid #B3B3B3;";
                $w = '3';
            }
            $today = '';
            if (date('Y-m-d', strtotime("+{$i} day", $mon_day_num)) == date('Y-m-d')) {
                $color = "background:#FBA179;border-left:1px solid #B3B3B3;border-bottom:1px solid #B3B3B3;";
                $w = '3';
                //$today = _JLMS_AGENDA_TODAY;
            }
            //if ($i == 0){ echo "<tr>";}
            echo "<td style='" . $color . "width:14%; height:40px;' valign='top' id='day" . $i . "' onmouseover=\"td_hover('day" . $i . "')\" onmouseout=\"td_out" . $w . "('day" . $i . "')\">" . $today . "<br />";
            $k = 0;
            while (isset($rows[$k]) && $k < count($rows)) {
                if (strtotime("+{$i} day", $mon_day_num) >= strtotime($rows[$k]->start_date) && strtotime("+{$i} day", $mon_day_num) <= strtotime($rows[$k]->end_date)) {
                    $title = substr($rows[$k]->title, 0, 12);
                    $title .= strlen($rows[$k]->title) > 12 ? "..." : '';
                    $descr = strip_tags($rows[$k]->content);
                    $overlib_descr = substr($descr, 0, 120) . (strlen($descr) > 120 ? "..." : '');
                    $overlib_descr = JLMS_txt2overlib($overlib_descr);
                    $overlib_title = JLMS_txt2overlib($rows[$k]->title);
                    $link = sefRelToAbs("index.php?option={$option}&amp;&amp;Itemid={$Itemid}&amp;task=agenda&amp;id={$id}&amp;agenda_id=" . $rows[$k]->agenda_id . "&amp;date=" . date("Y-m", $date) . "#anc" . $rows[$k]->agenda_id . '-' . date("Y-m", $date) . "");
                    echo JLMS_toolTip($overlib_title, $overlib_descr, $title, $link);
                    echo '<br />';
                }
                $k++;
            }
            echo "</td>";
        }
        echo "</tr>";
        ?>
		</table>
	<?php 
    }
Пример #5
0
    function echoMyCourses($option, $Itemid, &$my_courses)
    {
        global $JLMS_CONFIG;
        ?>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist', 'jlms_homepage_list');
        ?>
" style="margin-top:0; margin-bottom:0;">
		<tr><<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center" style="text-align:center"><?php 
        echo _JLMS_HOME_COURSES_TITLE;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
></tr>
	<?php 
        $k = 1;
        if (count($my_courses)) {
            $my_courses_teach = array();
            $my_courses_enroll = array();
            foreach ($my_courses as $my_course) {
                if ($my_course->user_course_role == 1) {
                    $my_courses_teach[] = $my_course;
                } else {
                    $my_courses_enroll[] = $my_course;
                }
            }
            if (count($my_courses_teach)) {
                echo "<tr class='" . JLMSCSS::_('sectiontableentry' . $k) . "'><td align='left'>" . _JLMS_COURSE_FP_COURSES_TEACH . "</td></tr>";
                $k = 3 - $k;
                foreach ($my_courses_teach as $my_course) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=details_course&amp;id=" . $my_course->id);
                    $description =& joomla_lms_html::PrepareDescription($my_course->course_description);
                    $title = JLMS_txt2overlib($my_course->course_name);
                    echo "<tr class='sectiontableentry{$k}" . ($k % 2 ? ' odd' : ' even') . "'><td>\n\t\t\t\t\t" . JLMS_toolTip($title, $description, $link) . "\n\t\t\t\t\t</td></tr>";
                    $k = 3 - $k;
                }
            }
            if (count($my_courses_enroll)) {
                echo "<tr class='" . JLMSCSS::_('sectiontableentry' . $k) . "'><td align='left'>" . _JLMS_COURSE_FP_COURSES_ENROLL . "</td></tr>";
                $k = 3 - $k;
                foreach ($my_courses_enroll as $my_course) {
                    $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=details_course&amp;id=" . $my_course->id);
                    $description =& joomla_lms_html::PrepareDescription($my_course->course_description);
                    $title = JLMS_txt2overlib($my_course->course_name);
                    echo "<tr class='sectiontableentry{$k}" . ($k % 2 ? ' odd' : ' even') . "'><td>\n\t\t\t\t\t" . JLMS_toolTip($title, $description, $link) . "\n\t\t\t\t\t</td></tr>";
                    $k = 3 - $k;
                }
            }
        } else {
            echo "<tr class='sectiontableentry{$k}" . ($k % 2 ? ' odd' : ' even') . "'><td>" . _JLMS_HOME_COURSES_NO_ITEMS . "</td></tr>";
        }
        ?>
	</table>
	<?php 
    }