-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmrep.php
169 lines (136 loc) · 4.69 KB
/
mrep.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE HTML>
<html>
<head>
<title>RM Rep</title>
<style>
body { font-family: Arial, sans-serif; }
td { padding: 0px 5px; }
</style>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData5 = $.ajax({
url: "test7getdata.php",
dataType:"json",
async: false
}).responseText;
var options = {
title: 'IP Distribution',
is3D: true,
};
var data5 = new google.visualization.DataTable(jsonData5);
var chart5 = new google.visualization.PieChart(document.getElementById('chart_div_5'));
chart5.draw(data5, options);
var jsonData6 = $.ajax({
url: "test8getdata.php",
dataType:"json",
async: false
}).responseText;
var options = {
title: 'OS Distribution',
is3D: true,
};
var data6 = new google.visualization.DataTable(jsonData6);
var chart6 = new google.visualization.PieChart(document.getElementById('chart_div_6'));
chart6.draw(data6, options);
var jsonData7 = $.ajax({
url: "test9getdata.php",
dataType:"json",
async: false
}).responseText;
var options = {
title: 'Browser Distribution',
is3D: true,
};
var data7 = new google.visualization.DataTable(jsonData7);
var chart7 = new google.visualization.PieChart(document.getElementById('chart_div_7'));
chart7.draw(data7, options);
var jsonData8 = $.ajax({
url: "test10getdata.php",
dataType:"json",
async: false
}).responseText;
var options = {
title: 'Click Distribution',
hAxis: {title: 'Clicks', minValue: 24, maxValue: 100},
vAxis: {title: 'Times', minValue: 0, maxValue: 20},
legend: 'none'
};
var data8 = new google.visualization.DataTable(jsonData8);
var chart8 = new google.visualization.ScatterChart(document.getElementById('chart_div_8'));
chart8.draw(data8, options);
var jsonData9 = $.ajax({
url: "test11getdata.php",
dataType:"json",
async: false
}).responseText;
var options = {
title: 'Language Distribution',
is3D: true,
};
var data9 = new google.visualization.DataTable(jsonData9);
var chart9 = new google.visualization.PieChart(document.getElementById('chart_div_9'));
chart9.draw(data9, options);
}
</script>
</head>
<body>
<?php
$server = "localhost";
$username = "****";
$password = "*****";
$database = "****";
$conn = mysql_connect($server, $username, $password);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($database, $conn);
// Get all the results for issues matching the chosen status id.
$result = mysql_query("SELECT DTE, IP, GAME, CNT, TIME_TO_SEC(TIMEDIFF(DTE,DTB)) TD, LNG FROM srlog ORDER BY DTE DESC LIMIT 10" , $conn);
if ( !$result )
{
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
mysql_close($conn);
?>
<title>RM Rep</title>
<style>
body { font-family: Arial, sans-serif; }
td { padding: 0px 5px; }
</style>
<table>
<col width="50%">
<col width="50%">
<tr><td><div id="chart_div_5"></div></td><td><div id="chart_div_6"></div><td></tr>
<tr><td><div id="chart_div_7"></div></td><td><div id="chart_div_9"></div></td></tr>
<tr><td><div id="chart_div_8"></div></td>
<td align="center">
<table>
<?php
// Print results.
echo("<tr><th>Finishdate</th><th>IP</th><th>Game</th><th>Clicks</th><th>SEC</th><th>LNG</th></tr>");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo("<tr>");
echo("<td>" . $row['DTE'] . "</td>");
echo("<td>" . $row['IP'] . "</td>");
echo("<td>" . $row['GAME'] . "</td>");
echo("<td>" . $row['CNT'] . "</td>");
echo("<td>" . $row['TD'] . "</td>");
echo("<td>" . $row['LNG'] . "</td>");
echo("</tr>");
}
?>
</table>
</td></tr>
</table>
</body>
</html>