-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetrics.php
More file actions
416 lines (319 loc) · 10.2 KB
/
metrics.php
File metadata and controls
416 lines (319 loc) · 10.2 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<?php
ob_start();
error_reporting(E_ALL & ~E_NOTICE);
require "includes/config.php";
require "includes/sess.php";
session_start();
?>
<html>
<head>
<style>
#loaderbox{
background: #fff url("img/loader.gif") no-repeat center center;
position:absolute;
top:20%;
left:40%;
z-index:1000;
height:300px;
width:300px;
}
*{
margin:0px;
padding:0px;
}
#logo{
margin:5px;
}
a{
text-decoration:none;
}
.testBox{
border: 1px solid black;
position:relative;
display:none;
}
.totalEx{
position:absolute;
right:640px;
top:0px;
}
.totalPass{
position:absolute;
top:0px;
right:500px;
}
.totalPassPerc{
position:absolute;
top:0px;
right:345px;
}
.totalFail{
position:absolute;
top:0px;
right:213px;
}
.totalFailPerc{
position:absolute;
top:0px;
right:67px;
}
#funcCount{
right:640px;
position:absolute;
}
#funcPass{
right:500px;
position:absolute;
}
#funcFail{
right:215px;
position:absolute;
}
#funcPassPerc{
right:345px;
position:absolute;
}
#funcFailPerc{
right:70px;
position:absolute;
}
.client{
position:relative;
background-color:#999999;
color:#fff;
}
.client a{ color:#fff; }
.funcBox{
border:1px dotted #bbb;
/* display:none; */
background-color:#fff;
color:#000;
}
.project{
position:relative;
/* display:none; */
background-color:#D9E1E3;
color:#0000ee;
}
.project a{ color: #0000ee; }
.funcBox a { color:#000; }
.mainContent{
border: 1px solid #000;
position:relative;
width:97%;
background-color:#777777;
color:#ffffff;
margin: 0 auto;
padding-bottom:10px;
font:14px Arial,Helvetica,sans-serif;
-moz-border-radius-bottomright: 10px;
border-bottom-right-radius: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-left-radius: 10px;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
font-weight:bold;
}
.headExec{
position:absolute;
right:605px;
top:0px;
}
.headPass{
position:absolute;
right:470px;
top:0px;
}
.clientCountPass{
position:absolute;
right:500px;
top:0px;
}
.headPassPerc{
position:absolute;
right:320px;
top:0px;
}
.headFail{
position:absolute;
right:190px;
top:0px;
}
.headFailPerc{
position:absolute;
right:50px;
top:0px;
display:block;
}
.clear{
clear:both;
visibility:hidden;
}
#projCount{
right:640px;
position:absolute;
}
.clientCount{
right:640px;
position:absolute;
}
#projCountPerc{
right:500px;
position:absolute;
}
#projCountFail{
right:215px;
position:absolute;
}
.clientFail{
right:215px;
position:absolute;
}
#projCountPassPerc{
right:345px;
position:absolute;
}
.clientPassPerc{
right:345px;
position:absolute;
}
#projCountFailPerc{
right:70px;
position:absolute;
}
.clientFailPerc{
right:70px;
position:absolute;
}
.execution{
padding-left:100px;
}
.testName{
padding-left:75px;
}
.execResultP{
position:absolute;
right:500px;
}
.execResultF{
position:absolute;
right:210px;
}
.execResult{
border-bottom:1px dotted #000;
position:relative;
display:none;
}
.dateText{
position:absolute;
bottom:0px;
padding-left:100px;
}
.testNameLink{
margin-left:75px;
}
#noman,#noauto{
margin-left: 50px;
color:#f00;
font-weight:bold;
}
#noman{
margin-bottom:300px;
}
</style>
</head>
<body>
<?php
$month = mysql_real_escape_string($_GET['month']);
$vertical = mysql_real_escape_string($_GET['vertical']);
$client = mysql_real_escape_string($_GET['client']);
if(!$vertical or !$client){
echo "Missing Vertical or Client";
exit;
}
$automation = $_GET['auto'];
if(!$automation){
$cliquery = mysql_query("SELECT client_name AS 'CLIENT'
, COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)) AS 'TOTAL'
, COUNT(IF(exec_result='0',1,Null)) AS 'PASSES'
, COUNT(IF(exec_result='0',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'PASS_PERC'
, COUNT(IF(exec_result='1',1,Null)) AS 'FAILS'
, COUNT(IF(exec_result='1',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'FAIL_PERC'
FROM table_manual_exec, table_manual, table_vertical, table_client, table_project, table_relation
WHERE vertical_id = r_vertical
AND client_id = r_client
AND project_id = r_project
AND vertical_id = '{$vertical}'
AND client_id = '{$client}'
AND manual_id = exec_manual_id
AND relation_id = manual_relation_id
AND MONTHNAME(FROM_UNIXTIME(exec_end)) = '{$month}' ");
$clis = mysql_fetch_object($cliquery);
echo "<div class='mainContent'>";
echo "<div class='clear'>Testing...</div>";
echo "<div class='headExec'>Total Executed</div>";
echo "<div class='headPass'>Total Passed</div>";
echo "<div class='headPassPerc'>Percent Passed</div>";
echo "<div class='headFail'>Total Failed</div>";
echo "<div class='headFailPerc'>Percent Failed</div>";
echo "<div class='client'>";
$clipassperc = number_format($clis->PASS_PERC,2);
$clifailperc = number_format($clis->FAIL_PERC,2);
echo "<a href='javascript:void(0);' class='clientName'>" . $clis->CLIENT. "</a><span class='clientCount'>{$clis->TOTAL}</span><span class='clientCountPass'>{$clis->PASSES}</span><span class='clientPassPerc'>{$clipassperc}%</span><span class='clientFail'>{$clis->FAILS}</span><span class='clientFailPerc'>{$clifailperc}%</span><br />";
$qres2 = mysql_query("SELECT project_name AS 'PROJECT', project_id AS 'PROJECT_ID'
, COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)) AS 'TOTAL'
, COUNT(IF(exec_result='0',1,Null)) AS 'PASSES'
, COUNT(IF(exec_result='0',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'PASS_PERC'
, COUNT(IF(exec_result='1',1,Null)) AS 'FAILS'
, COUNT(IF(exec_result='1',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'FAIL_PERC'
FROM table_manual_exec, table_manual, table_vertical, table_client, table_project, table_relation
WHERE vertical_id = r_vertical
AND client_id = r_client
AND project_id = r_project
AND vertical_id = '{$vertical}'
AND client_id = '{$client}'
AND manual_id = exec_manual_id
AND relation_id = manual_relation_id
AND MONTHNAME(FROM_UNIXTIME(exec_end)) = '{$month}'
GROUP BY project_name
");
while($innerproj = mysql_fetch_object($qres2)){
echo "<div class='project'>";
$projpassperc = number_format($innerproj->PASS_PERC ,2);
$projfailperc = number_format($innerproj->FAIL_PERC ,2);
echo "       <a href='javascript:void(0);' class='projName'> " . $innerproj->PROJECT ." </a> <span id='projCount'>{$innerproj->TOTAL}</span><span id='projCountPerc'>{$innerproj->PASSES}</span><span id='projCountPassPerc'>{$projpassperc}%</span><span id='projCountFail'>{$innerproj->FAILS}</span><span id='projCountFailPerc'>{$projfailperc}%</span><br />";
$qres = mysql_query("SELECT manual_function_name AS 'FUNCTION_NAME'
, COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)) AS 'TOTAL'
, COUNT(IF(exec_result='0',1,Null)) AS 'PASSES'
, COUNT(IF(exec_result='0',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'PASS_PERC'
, COUNT(IF(exec_result='1',1,Null)) AS 'FAILS'
, COUNT(IF(exec_result='1',1,Null))/(COUNT(IF(exec_result='0',1,Null)) + COUNT(IF(exec_result='1',1,Null)))*100 AS 'FAIL_PERC'
FROM table_manual_exec, table_manual, table_vertical, table_client, table_project, table_relation
WHERE vertical_id = r_vertical
AND client_id = r_client
AND project_id = r_project
AND vertical_id = '{$vertical}'
AND client_id = '{$client}'
AND project_id = '{$innerproj->PROJECT_ID}'
AND manual_id = exec_manual_id
AND relation_id = manual_relation_id
AND MONTHNAME(FROM_UNIXTIME(exec_end)) = '{$month}'
GROUP BY manual_function_name");
while($funcs = mysql_fetch_object($qres)){
echo "<div class='funcBox'>";
$passperc = number_format($funcs->PASS_PERC, 2);
$failedperc = number_format($funcs->FAIL_PERC, 2);
if($funcs->FUNCTION_NAME == ""){ $genfunc = "99 - UX & UI"; } else{ $genfunc = $funcs->FUNCTION_NAME; }
echo "           <a href='javascript:(void);' class='funcName' id='funcName'> {$genfunc} </a><span id='funcCount'>{$funcs->TOTAL}</span><span id='funcPass'>{$funcs->PASSES}</span><span id='funcPassPerc'>{$passperc}%</span><span id='funcFail'>{$funcs->FAILS}</span><span id='funcFailPerc'>{$failedperc}%</span><br />";
echo "</div><!--end funcBox-->";
}
echo "</div><!--end project-->";
}
echo "</div><!--client -->";
echo "</div><!--end mainContent-->";
}//if not automation
?>
</body>
</html>