1 |
efrain |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* helper page for the loggedin event. its only necessary because of the display size
|
|
|
5 |
*
|
|
|
6 |
*/
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
require_once('lib.php');
|
|
|
10 |
|
|
|
11 |
ini_set('memory_limit' , '1024M');
|
|
|
12 |
require_login();
|
|
|
13 |
|
|
|
14 |
global $PAGE;
|
|
|
15 |
|
|
|
16 |
$systemcontext = context_system::instance();
|
|
|
17 |
$PAGE->set_context($systemcontext);
|
|
|
18 |
$PAGE->set_url('/report/training/storage_helper_page.php');
|
|
|
19 |
$PAGE->set_pagelayout('redirect');
|
|
|
20 |
$PAGE->requires->css('/report/training/css/storage_helper_page_css.css');
|
|
|
21 |
$PAGE->requires->js('/report/training/libs/jquery-1.12.2.min.js', true);
|
|
|
22 |
|
|
|
23 |
$datastorage = new training_data_storage();
|
|
|
24 |
$insertid = $datastorage->training_user_loggedin();
|
|
|
25 |
$lastaccess_view_url = $datastorage->getlastaccess();
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
$CFG->additionalhtmlhead .= '<noscript>
|
|
|
29 |
<meta http-equiv="refresh" content="0;url='.$lastaccess_view_url.'">
|
|
|
30 |
</noscript>';
|
|
|
31 |
echo $OUTPUT->header();
|
|
|
32 |
?>
|
|
|
33 |
<script type="text/javascript">
|
|
|
34 |
$( document ).ready(function() {
|
|
|
35 |
if(<?php echo $insertid;?> == 0){
|
|
|
36 |
window.location.replace("<?php echo $lastaccess_view_url; ?>");
|
|
|
37 |
}else{
|
|
|
38 |
var ajaxurl = 'ajaxcall.php?' + 'sesskey=' + M.cfg.sesskey + '&insertid=' + <?php echo $insertid; ?>;
|
|
|
39 |
var screensize = {
|
|
|
40 |
'device_display_size_x': screen.width,
|
|
|
41 |
'device_display_size_y': screen.height,
|
|
|
42 |
'device_window_size_x': $(window).width(),
|
|
|
43 |
'device_window_size_y': $(window).height()
|
|
|
44 |
}
|
|
|
45 |
$.ajax({
|
|
|
46 |
type: "GET",
|
|
|
47 |
url: ajaxurl,
|
|
|
48 |
data: screensize,
|
|
|
49 |
}).done(function(html) {
|
|
|
50 |
window.location.replace("<?php echo $lastaccess_view_url; ?>");
|
|
|
51 |
});
|
|
|
52 |
}
|
|
|
53 |
});
|
|
|
54 |
</script>
|
|
|
55 |
<?php
|
|
|
56 |
echo $OUTPUT->footer();
|