Adding first version of the new access details see #3258
parent
ececab1cd3
commit
ef94e5eab9
@ -0,0 +1,60 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Responses to AJAX calls |
||||
*/ |
||||
require_once '../global.inc.php'; |
||||
$action = $_GET['a']; |
||||
|
||||
//if (!api_is_platform_admin() && !api_is_xml_http_request()) { exit; } |
||||
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php'; |
||||
|
||||
switch ($action) { |
||||
case 'access_detail': |
||||
$user_id = Security::remove_XSS($_REQUEST['student']); |
||||
$course_code = Security::remove_XSS($_REQUEST['course']); |
||||
$type = Security::remove_XSS($_REQUEST['type']); |
||||
$range = Security::remove_XSS($_REQUEST['range']); |
||||
|
||||
if ($range == 1){ |
||||
$start_date = Security::remove_XSS($_REQUEST['sd']); |
||||
$end_date = Security::remove_XSS($_REQUEST['ed']); |
||||
$sql_result = get_connections_to_course_by_date($user_id, $course_code, $start_date, $end_date); |
||||
} else { |
||||
$sql_result = MySpace::get_connections_to_course($user_id, $course_code); |
||||
} |
||||
$foo_print = grapher($sql_result, $start_date, $end_date, $type); |
||||
echo $foo_print; |
||||
|
||||
break; |
||||
|
||||
case 'access_detail_by_date': |
||||
|
||||
$db = array('is_empty'=>true); |
||||
$start_date = isset($_REQUEST['startDate'])?$_REQUEST['startDate']:""; |
||||
$end_date = isset($_REQUEST['endDate'])?$_REQUEST['endDate']:""; |
||||
$user_id = isset($_REQUEST['student'])?$_REQUEST['student']:""; |
||||
$course_code = isset($_REQUEST['course'])?$_REQUEST['course']:""; |
||||
|
||||
$sql_result = get_connections_to_course_by_date($user_id, $course_code, $start_date, $end_date); |
||||
|
||||
if (is_array($sql_result) && count($sql_result) > 0) { |
||||
$db['is_empty'] = false; |
||||
$db['result'] = convert_to_string($sql_result); |
||||
$rst = get_stats($user_id, $course_code, $start_date, $end_date); |
||||
$foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />'; |
||||
$foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />'; |
||||
$foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />'; |
||||
$db['stats'] = $foo_stats; |
||||
$db['graph_result'] = grapher($sql_result, $start_date, $end_date); |
||||
} else { |
||||
$db['result'] = '<div class="warning-message"> No se encontro información habilitada del usuario </div>'; |
||||
$db['graph_result'] = '<div class="warning-message"> No se encontro información habilitada del usuario </div>'; |
||||
$db['stats'] = '<div class="warning-message"> No se encontro información registrada para este rango </div>'; |
||||
} |
||||
header('Cache-Control: no-cache'); |
||||
echo json_encode($db); // requires: PHP >= 5.2.0, PECL json >= 1.2.0 |
||||
|
||||
break; |
||||
} |
||||
exit; |
@ -0,0 +1,57 @@ |
||||
div#cev_cont_results |
||||
{ |
||||
margin: 0; |
||||
padding-left:18px; |
||||
padding-right:18px; |
||||
} |
||||
div#cev_cont_header |
||||
{ |
||||
margin: 0; |
||||
padding-left:18px; |
||||
padding-right:18px; |
||||
} |
||||
div#cev_cont_stats |
||||
{ |
||||
margin: 0; |
||||
padding-left:18px; |
||||
padding-right:18px; |
||||
} |
||||
div.slider |
||||
{ |
||||
overflow: hidden; |
||||
display: none; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
div#cev_cont .ui-tabs-nav .ui-helper-reset .ui-helper-clearfix .ui-widget-header .ui-corner-all |
||||
{ |
||||
margin: 0; |
||||
padding-left:18px; |
||||
padding-right:18px; |
||||
} |
||||
|
||||
div.slider_menu a |
||||
{ |
||||
color: #3757F7; |
||||
font-size: 13px; |
||||
} |
||||
|
||||
/** |
||||
* Not required, for styling only |
||||
*/ |
||||
|
||||
div#slider_wrapper |
||||
{ |
||||
width: 500px; |
||||
} |
||||
|
||||
div.title |
||||
{ |
||||
font-weight: bold; |
||||
} |
||||
|
||||
div.slider p |
||||
{ |
||||
padding: 0 0 1em 0; |
||||
margin: 0; |
||||
} |
@ -0,0 +1,84 @@ |
||||
// Set the initial height
|
||||
var sliderHeight = "80px"; |
||||
|
||||
$(document).ready(function(){ |
||||
// Show the slider content
|
||||
$('.slider').show(); |
||||
|
||||
$('.slider').each(function () { |
||||
var current = $(this); |
||||
current.attr("box_h", current.height()); |
||||
}); |
||||
|
||||
$(".slider").css("height", sliderHeight); |
||||
}); |
||||
|
||||
function sliderGetHeight(foo_var) |
||||
{ |
||||
var current = $(foo_var); |
||||
if (current.height() <= 80){ |
||||
return current.height()+30; |
||||
} |
||||
else { |
||||
return current.height(); |
||||
} |
||||
} |
||||
|
||||
function sliderSetHeight(foo_var, foo_height) |
||||
{ |
||||
$(foo_var).each(function () { |
||||
var current = $(this); |
||||
current.attr("box_h", foo_height); |
||||
}); |
||||
} |
||||
|
||||
function controlSliderMenu(foo_height_a) |
||||
{ |
||||
if (foo_height_a <= 80){ |
||||
sliderOpen(); |
||||
slider_state = "open" |
||||
$(".slider_menu").empty(); |
||||
|
||||
} |
||||
} |
||||
// Set the initial slider state
|
||||
var slider_state = "close"; |
||||
|
||||
function getSliderState() |
||||
{ |
||||
return slider_state; |
||||
} |
||||
|
||||
function setSliderState(foo_slider_state) |
||||
{ |
||||
slider_state = foo_slider_state; |
||||
} |
||||
function sliderAction() |
||||
{ |
||||
if (slider_state == "close") |
||||
{ |
||||
sliderOpen(); |
||||
slider_state = "open" |
||||
$(".slider_menu").html('<a href="#" onclick="return sliderAction();">Cerrar</a>'); |
||||
} |
||||
else if (slider_state == "open") |
||||
{ |
||||
sliderClose(); |
||||
slider_state = "close"; |
||||
$(".slider_menu").html('<a href="#" onclick="return sliderAction();">Más...</a>'); |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
function sliderOpen() |
||||
{ |
||||
var open_height = $(".slider").attr("box_h") + "px"; |
||||
$(".slider").animate({"height": open_height}, {duration: "slow" }); |
||||
} |
||||
|
||||
function sliderClose() |
||||
{ |
||||
$(".slider").animate({"height": "0px"}, {duration: "fast" }); |
||||
$(".slider").animate({"height": sliderHeight}, {duration: "fast" }); |
||||
} |
Loading…
Reference in new issue