Minor - format code.

1.9.x
Julio Montoya 12 years ago
parent b1432168df
commit 0f3f5434d8
  1. 19
      main/inc/lib/sessionmanager.lib.php
  2. 3
      main/inc/lib/usermanager.lib.php
  3. 46
      main/mySpace/access_details.php
  4. 7
      main/mySpace/myStudents.php

@ -2547,16 +2547,23 @@ class SessionManager
/** /**
* Gets the list of courses by session filtered by access_url * Gets the list of courses by session filtered by access_url
* @param int session id *
* @return array list of courses * @param $userId
* @param $sessionId
* @param null $from
* @param null $limit
* @param null $column
* @param null $direction
* @param bool $getCount
* @return array
*/ */
public static function getAllCoursesFollowedByUser( public static function getAllCoursesFollowedByUser(
$userId, $userId,
$sessionId, $sessionId,
$from, $from = null,
$limit, $limit = null,
$column, $column = null,
$direction, $direction = null,
$getCount = false $getCount = false
) { ) {
if (empty($sessionId)) { if (empty($sessionId)) {

@ -3733,7 +3733,6 @@ class UserManager
$result = Database::query($sql); $result = Database::query($sql);
$row = Database::fetch_array($result); $row = Database::fetch_array($result);
//var_dump($sql); //var_dump($sql);
//var_dump($row);
return $row['count']; return $row['count'];
} }
@ -3756,7 +3755,7 @@ class UserManager
$result = Database::query($sql); $result = Database::query($sql);
$users = array(); $users = array();
if (Database::num_rows($result) > 0) { if (Database::num_rows($result) > 0) {
//var_dump($sql);
while ($row = Database::fetch_array($result)) { while ($row = Database::fetch_array($result)) {
$users[$row['user_id']] = $row; $users[$row['user_id']] = $row;
} }

@ -41,8 +41,7 @@ $quote_simple = "'";
$htmlHeadXtra[] = '<script src="slider.js" type="text/javascript"></script>'; $htmlHeadXtra[] = '<script src="slider.js" type="text/javascript"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="slider.css" />'; $htmlHeadXtra[] = '<link rel="stylesheet" href="slider.css" />';
$htmlHeadXtra[] = '<script>
$htmlHeadXtra[] = '<script type="text/javascript">
$(function() { $(function() {
var dates = $( "#date_from, #date_to" ).datepicker({ var dates = $( "#date_from, #date_to" ).datepicker({
dateFormat: '.$quote_simple.'yy-mm-dd'.$quote_simple.', dateFormat: '.$quote_simple.'yy-mm-dd'.$quote_simple.',
@ -55,7 +54,8 @@ $(function() {
date = $.datepicker.parseDate( date = $.datepicker.parseDate(
instance.settings.dateFormat || instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat, $.datepicker._defaults.dateFormat,
selectedDate, instance.settings ); selectedDate, instance.settings
);
dates.not( this ).datepicker( "option", option, date ); dates.not( this ).datepicker( "option", option, date );
if (foo) { if (foo) {
@ -69,8 +69,10 @@ $(function() {
if (foo_slider_state == "open"){ if (foo_slider_state == "open"){
sliderAction(); sliderAction();
} }
$.post("'.api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail_by_date", {startDate: start_date, endDate: end_date, course: foo_course, student: foo_student, type: graph_type}, function(db) $.post(
{ "'.api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail_by_date",
{startDate: start_date, endDate: end_date, course: foo_course, student: foo_student, type: graph_type},
function(db) {
if (!db.is_empty){ if (!db.is_empty){
// Display confirmation message to the user // Display confirmation message to the user
$("#messages").html(db.result).stop().css("opacity", 1).fadeIn(30); $("#messages").html(db.result).stop().css("opacity", 1).fadeIn(30);
@ -79,8 +81,7 @@ $(function() {
$( "#ui-tabs-2" ).empty(); $( "#ui-tabs-2" ).empty();
$( "#ui-tabs-1" ).html(db.graph_result); $( "#ui-tabs-1" ).html(db.graph_result);
$( "#ui-tabs-2" ).html(db.graph_result); $( "#ui-tabs-2" ).html(db.graph_result);
} } else {
else{
$("#messages").text("'.get_lang('NoDataAvailable').'"); $("#messages").text("'.get_lang('NoDataAvailable').'");
$("#messages").addClass("warning-message"); $("#messages").addClass("warning-message");
$("#cev_cont_stats").html(db.stats); $("#cev_cont_stats").html(db.stats);
@ -100,18 +101,16 @@ $(function() {
$( "#cev_slider" ).empty(); $( "#cev_slider" ).empty();
// Create element to use for confirmation messages // Create element to use for confirmation messages
$('.$quote_simple .'<div id="messages"/>'.$quote_simple .').appendTo("#cev_slider"); $('.$quote_simple .'<div id="messages"/>'.$quote_simple .').appendTo("#cev_slider");
} }
} }
}); });
if (areBothFilled()) { if (areBothFilled()) {
runEffect(); runEffect();
} }
}); });
</script>'; </script>';
$htmlHeadXtra[] = '<script type="text/javascript"> $htmlHeadXtra[] = '<script type="text/javascript">
function changeHREF(sd,ed) { function changeHREF(sd,ed) {
@ -163,22 +162,21 @@ $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('AccessDetails'));
Display :: display_header(''); Display :: display_header('');
$main_user_info = api_get_user_info($user_id); $main_user_info = api_get_user_info($user_id);
$result_to_print = ''; $result_to_print = '';
$sql_result = MySpace::get_connections_to_course($user_id, $course_code); $sql_result = MySpace::get_connections_to_course($user_id, $course_code);
$result_to_print = convert_to_string($sql_result); $result_to_print = convert_to_string($sql_result);
echo Display::page_header(get_lang('DetailsStudentInCourse')); echo Display::page_header(get_lang('DetailsStudentInCourse'));
echo Display::page_subheader(get_lang('User').': '.api_get_person_name($main_user_info['firstName'], $main_user_info['lastName']).' - '.get_lang('Course').': '.$course_code); echo Display::page_subheader(
get_lang('User').': '.api_get_person_name($main_user_info['firstName'], $main_user_info['lastName']).' - '.get_lang('Course').': '.$course_code
);
$form = new FormValidator('myform', 'post', "javascript:get(document.getElementById('myform'));", null, array('id' => 'myform')); $form = new FormValidator('myform', 'post', "javascript:get(document.getElementById('myform'));", null, array('id' => 'myform'));
$form->addElement('text', 'from', get_lang('From'), array('id' => 'date_from')); $form->addElement('text', 'from', get_lang('From'), array('id' => 'date_from'));
$form->addElement('text', 'to', get_lang('Until'), array('id' => 'date_to')); $form->addElement('text', 'to', get_lang('Until'), array('id' => 'date_to'));
$form->addElement('style_submit_button', 'reset', get_lang('Reset'), array('onclick' => "javascript:window.location='access_details.php?course=".$course_code."&student=".$user_id."&cidReq=".$course_code."';")); $form->addElement('style_submit_button', 'reset', get_lang('Reset'), array('onclick' => "javascript:window.location='access_details.php?course=".$course_code."&student=".$user_id."&cidReq=".$course_code."';"));
$form->display(); $form->display();
?> ?>
<div id="cev_results_header" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> <div id="cev_results_header" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> <div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php echo get_lang('Statistics'); ?></div><br /> <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php echo get_lang('Statistics'); ?></div><br />
<div id="cev_cont_stats"> <div id="cev_cont_stats">
@ -198,13 +196,24 @@ $form->display();
<div id="container-9"> <div id="container-9">
<ul> <ul>
<li><a href="<?php echo api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail&type=day&course='.$course_code.'&student='.$user_id?>"><span> <?php echo api_ucfirst(get_lang('Day')); ?></span></a></li> <li>
<li><a href="<?php echo api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail&type=month&course='.$course_code.'&student='.$user_id?>"><span> <?php echo api_ucfirst(get_lang('MinMonth')); ?></span></a></li> <a href="<?php echo api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail&type=day&course='.$course_code.'&student='.$user_id?>">
<span> <?php echo api_ucfirst(get_lang('Day')); ?>
</span>
</a>
</li>
<li>
<a href="<?php echo api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?a=access_detail&type=month&course='.$course_code.'&student='.$user_id?>">
<span> <?php echo api_ucfirst(get_lang('MinMonth')); ?></span>
</a>
</li>
</ul> </ul>
</div> </div>
<div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> <div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php echo get_lang('DateAndTimeOfAccess'),' - ', get_lang('Duration') ?></div><br /> <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<?php echo get_lang('DateAndTimeOfAccess'),' - ', get_lang('Duration') ?>
</div><br />
<div id="cev_cont_results" > <div id="cev_cont_results" >
<div id="cev_slider" class="slider"> <div id="cev_slider" class="slider">
<?php <?php
@ -217,7 +226,8 @@ $form->display();
</div> </div>
<?php <?php
if ($result_to_print != "") { if ($result_to_print != "") {
echo '<br /><div class="slider_menu"> echo '<br />
<div class="slider_menu">
<a href="#" onclick="return sliderAction();"><img src="../img/icons/22/zoom_in.png"></a> <a href="#" onclick="return sliderAction();"><img src="../img/icons/22/zoom_in.png"></a>
</div>'; </div>';
}?> }?>

@ -317,8 +317,11 @@ if (!empty($student_id)) {
$send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM); $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM);
} }
echo $send_mail; echo $send_mail;
if (!empty($student_id) && !empty ($_GET['course'])) { //only show link to connection details if course and student were defined in the URL if (!empty($student_id) && !empty($_GET['course'])) {
echo '<a href="access_details.php?student=' . $student_id . '&course=' . Security :: remove_XSS($_GET['course']) . '&amp;origin=' . Security :: remove_XSS($_GET['origin']) . '&amp;cidReq='.Security::remove_XSS($_GET['course']).'&amp;id_session='.$session_id.'">' . Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>'; //only show link to connection details if course and student were defined in the URL
echo '<a href="access_details.php?student=' . $student_id . '&course=' . Security :: remove_XSS($_GET['course']) . '&amp;origin=' . Security :: remove_XSS($_GET['origin']) . '&amp;cidReq='.Security::remove_XSS($_GET['course']).'&amp;id_session='.$session_id.'">'.
Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>';
} }
if (api_can_login_as($student_id)) { if (api_can_login_as($student_id)) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$student_id.'&amp;sec_token='.$token.'">'. echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$student_id.'&amp;sec_token='.$token.'">'.

Loading…
Cancel
Save