/
var
/
www
/
barefootlaw.org
/
bios2
/
manager
/
Upload File
HOME
<?php require_once('../Connections/fleetMan.php'); ?> <?php require_once("functions.php"); $api = new fleet(); ?> <?php date_default_timezone_set("Africa/Kampala") ?> <?php //initialize the session if (!isset($_SESSION)) { session_start(); } // ** Logout the current user. ** $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true"; if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){ $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){ //to fully log out a visitor we need to clear the session varialbles $_SESSION['MM_Username'] = NULL; $_SESSION['MM_UserGroup'] = NULL; $_SESSION['PrevUrl'] = NULL; unset($_SESSION['MM_Username']); unset($_SESSION['MM_UserGroup']); unset($_SESSION['PrevUrl']); $logoutGoTo = "signin.php"; if ($logoutGoTo) { header("Location: $logoutGoTo"); exit; } } ?> <?php if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && true) { $isValid = true; } } return $isValid; } $MM_restrictGoTo = "signin.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?"; $MM_referrer = $_SERVER['PHP_SELF']; if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) $MM_referrer .= "?" . $_SERVER['QUERY_STRING']; $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); exit; } ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_fleetMan, $fleetMan); $query_user_info = "select * from bios_sys_user where email = '".$_SESSION['MM_Username']."'"; $user_info = mysql_query($query_user_info, $fleetMan) or die(mysql_error()); $row_user_info = mysql_fetch_assoc($user_info); $totalRows_user_info = mysql_num_rows($user_info); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!--<link rel="shortcut icon" href="../images/favicon.png" type="image/png">--> <title><?php echo $api->site_name; ?></title> <link rel="stylesheet" href="../lib/Hover/hover.css"> <link rel="stylesheet" href="../lib/fontawesome/css/font-awesome.css"> <link rel="stylesheet" href="../lib/weather-icons/css/weather-icons.css"> <link rel="stylesheet" href="../lib/ionicons/css/ionicons.css"> <link rel="stylesheet" href="../lib/jquery-toggles/toggles-full.css"> <link rel="stylesheet" href="../lib/morrisjs/morris.css"> <link rel="stylesheet" href="../css/quirk.css"> <script src="../lib/modernizr/modernizr.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../lib/html5shiv/html5shiv.js"></script> <script src="../lib/respond/respond.src.js"></script> <![endif]--> </head> <body> <?php include("header.php"); ?> <section> <div class="leftpanel"> <?php include('menu.php'); ?> </div><!-- leftpanel --> <div class="mainpanel"> <!--<div class="pageheader"> <h2><i class="fa fa-home"></i> Dashboard</h2> </div>--> <div class="contentpanel"> <div class="row"> <div class="col-md-9 col-lg-8 dash-left"> <!-- panel --><!-- panel --> <div class="row panel-statistics"><!-- col-sm-6 --> <div class="col-sm-3"> <div class="panel panel-danger-full panel-updates"> <div class="panel-body"> <div class="row"> <div class="col-xs-7 col-lg-8"> <h4 class="panel-title text-success" id="stat1"> </h4> <h3 id="alert_value_1"> </h3> <span id="info_1"> </span> </div> </div> </div> </div><!-- panel --> </div><!-- col-sm-6 --> <div class="col-sm-3"> <div class="panel panel-success-full panel-updates"> <div class="panel-body"> <div class="row"> <div class="col-xs-7 col-lg-8"> <h4 class="panel-title text-success" id="stat2"> </h4> <h3 id="alert_value_2"> </h3> <span id="info_2"> </span> </div> </div> </div> </div><!-- panel --> </div><!-- col-sm-6 --><!-- col-sm-6 --> <div class="col-sm-3"> <div class="panel panel-updates panel-warning-full"> <div class="panel-body"> <div class="row"> <div class="col-xs-7 col-lg-8"> <h4 class="panel-title text-success" id="stat3"> </h4> <h3 id="alert_value_3"> </h3> <span id="info_3"> </span> </div> </div> </div> </div><!-- panel --> </div> <div class="col-sm-3"> <div class="panel panel-updates panel-info-full"> <div class="panel-body"> <div class="row"> <div class="col-xs-7 col-lg-8"> <h4 class="panel-title text-success" id="stat4"> </h4> <h3 id="alert_value_4"> </h3> <span id="info_4"> </span> </div> </div> </div> </div><!-- panel --> </div> </div><!-- row --> <div class="row"> <div class="col-sm-8 col-md-9 col-lg-10"> <div class="timeline-wrapper"> <div class="timeline-date"><?php echo date("l, F d, Y") ?></div> </div><!-- timeline-wrapper --> </div> <div id="container" style="width:100%"></div> </div> </div> <!-- col-md-9 --><!-- col-md-3 --> </div><!-- row --> </div><!-- contentpanel --> </div><!-- mainpanel --> </section> <script src="../lib/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready( function() { setInterval(load_alerts,1000); $.ajaxSetup({ cache: false }); }); function load_alerts() { $.getJSON( "../json_api.php?action=quick_stats", function( data ) { for(var i = 0; i < data.length; i++) { var n = i+1; if(n <= 4) { $("#stat"+n).html(data[i]); } /*var content = "<div class=\"panel panel-post-item status\"> <div class=\"panel-heading\"> <div class=\"media\"> <div class=\"media-body\"> <h4 class=\"media-heading\">{number_plate}</h4> <p class=\"media-usermeta\"> <span class=\"media-time\">{time}</span> <i class=\"glyphicon glyphicon-map-marker\"></i> <a href=\"\">{location}</a> </p> </div> </div><!-- media --> <ul class=\"panel-options\"> <li><a class=\"tooltips\" href=\"\" data-toggle=\"tooltip\" title=\"View Options\"><i class=\"glyphicon glyphicon-option-vertical\"></i></a></li> </ul> </div><!-- panel-heading --> <div class=\"panel-body\"> {desc}</a> </div> </div>";*/ } }); } </script> <script src="../lib/jquery-ui/jquery-ui.js"></script> <script src="../lib/bootstrap/js/bootstrap.js"></script> <script src="../lib/jquery-toggles/toggles.js"></script> <script src="../lib/morrisjs/morris.js"></script> <script src="../lib/raphael/raphael.js"></script> <script src="../lib/flot/jquery.flot.js"></script> <script src="../lib/flot/jquery.flot.resize.js"></script> <script src="../lib/flot-spline/jquery.flot.spline.js"></script> <script src="../lib/jquery-knob/jquery.knob.js"></script> <script src="../js/quirk.js"></script> <script src="../js/dashboard.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="charts/js/highcharts.js"></script> <script src="charts/js/modules/exporting.js"></script> <style type="text/css"> ${demo.css} </style> <script type="text/javascript"> $(function () { $('#container').highcharts({ title: { text: 'Message Log - Last 7 Days', x: -20 //center }, subtitle: { text: 'Source: BIOS', x: -20 }, xAxis: { categories: [ <?php $temp = ""; $messages = ""; $responses = ""; $x=0; for($i=date("d")-7;$i<=date("d");$i++) { if($x <= 10) { $temp .= "'".(date("D jS", strtotime(date("Y-m-".$i))))."',"; $messages .= round($api->get_record("bios_message","count(*)","where substr(send_date,1,10) = '".date("Y-m-".$i)."'")*1.5).","; $responses .= round($api->get_record("bios_response","count(*)","where substr(log_date,1,10) = '".date("Y-m-".$i)."'")*1.5).","; $x++; } else { break; } } echo substr($temp,0,-1); ?> ] }, yAxis: { title: { text: 'Interactions (Number)' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { valueSuffix: 'Interactions' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [{ name: 'Messages', data: [ <?php echo substr($messages,0,-1); ?> ] }, { name: 'responses', data: [ <?php echo substr($responses,0,-1); ?> ] } ] }); }); </script> </body> </html> <?php mysql_free_result($user_info); ?>