-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-table.php
200 lines (179 loc) · 7.74 KB
/
test-table.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
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
<?php
$tab = 0;
include 'tests/test.includes.php';
session_start();
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
$run = filter_var($_GET['run'], FILTER_SANITIZE_STRING);
$id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
$db = new Connection();
$db->connect();
$prior = $db->select('test_xmls', array('*'), null, array(), 'order by id desc limit 10');
$db->close();
if ($run == 'true') {
$test = new CommunityTest(true, false);
$xml = $test->doAllTests(true);
echo $xml;
$db = new Connection();
$db->connect();
$insertId = $db->insert('test_xmls', 'is', array(null, $xml));
$db->close();
//echo $insertId;
} else {
if ($id) {
$db = new Connection();
$db->connect();
$return = $db->select('test_xmls', array('xml'), 'i', array($id), 'where id=?');
$db->close();
}
?>
<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en"> <!--<![endif]-->
<head>
<title>SciCrunch | Code Tests</title>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Favicon -->
<link rel="shortcut icon" href="/favicon.ico">
<!-- CSS Global Compulsory -->
<link rel="stylesheet" href="/assets/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/assets/plugins/sky-forms/version-2.0.1/css/custom-sky-forms.css">
<!-- CSS Implementing Plugins -->
<link rel="stylesheet" href="/assets/plugins/line-icons/line-icons.css">
<link rel="stylesheet" href="/assets/plugins/font-awesome/css/font-awesome.min.css">
<!-- CSS Page Style -->
<link rel="stylesheet" href="/assets/css/pages/page_search_inner.css">
<link rel="stylesheet" href="/assets/css/pages/page_log_reg_v2.css">
<link rel="stylesheet" href="/assets/css/shop/shop.blocks.css">
<!-- CSS Theme -->
<link rel="stylesheet" href="/assets/css/themes/default.css" id="style_color">
<!-- CSS Customization -->
<link rel="stylesheet" href="/assets/css/custom.css">
</head>
<body>
<div class="wrapper">
<!-- Brand and toggle get grouped for better mobile display -->
<?php include 'ssi/header.php' ?>
<!--=== Breadcrumbs v3 ===-->
<div class="breadcrumbs-v3">
<div class="container">
<h1 class="pull-left">SciCrunch Test Suite</h1>
<ul class="pull-right breadcrumb">
<li><a href="index.html">Home</a></li>
<?php if ($id) { ?>
<li><a href="/testing">SciCrunch Test Suite</a></li>
<li class="active">Prior Test</li>
<?php } else { ?>
<li class="active">SciCrunch Test Suite</li>
<?php } ?>
</ul>
</div>
</div>
<!--=== End Breadcrumbs v3 ===-->
<!--=== Search Results ===-->
<div class="container s-results margin-bottom-50">
<div class="row">
<?php
$test = new CommunityTest(true, false);
if ($id) {
echo $test->parseXML($return[0]['xml']);
} else {
$colors = array('#ff0000','#dddd00','#00dd00');
echo '<h1 align="center" style="margin-top: 40px">SciCrunch Test Suite - v' . VERSION . '</h1>';
echo '<div class="pull-right">';
echo '<div class="btn-group" style="margin:0 10px">
<button type="button" class="btn-u dropdown-toggle" data-toggle="dropdown">
Prior Tests
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu" role="menu" style="left:auto;right:0">';
foreach ($prior as $array) {
$prXML = simplexml_load_string($array['xml']);
if ($prXML) {
if(isset($prXML->status))
$status = (int)$prXML->status;
else
$status = 1;
echo '<li><a href="/testing/' . $array['id'] . '"><i class="fa fa-circle" style="color:'.$colors[$status].'"></i> v' . $prXML->version . ' - ' . $prXML->time . '</a></li>';
}
}
echo '</ul>
</div>';
echo '</div>';
echo '<p style="margin:20px 0">
This is the code testing suite for SciCrunch. This test is run live and shows the current integrity
of the current release compared to the expectations.
</p>';
echo $test->doAllTests(false);
}
?>
</div>
</div>
<!--/container-->
<!--=== End Search Results ===-->
<?php include 'ssi/footer.php' ?>
<!--=== End Copyright ===-->
</div>
<!--/End Wrapepr-->
<!-- JS Global Compulsory -->
<script type="text/javascript" src="/assets/plugins/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/assets/plugins/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="/assets/plugins/gmap/gmap.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
<script type="text/javascript" src="/js/jquery.truncate.js"></script>
<!-- JS Implementing Plugins -->
<script type="text/javascript" src="/assets/plugins/back-to-top.js"></script>
<!-- JS Page Level -->
<script type="text/javascript" src="/assets/js/app.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script type="text/javascript">
jQuery(document).ready(function () {
App.init();
<?php if(isset($_SESSION['user'])){?>
setTimeout(updateLogin, <?php if($_SESSION['user']->last_check > time()) echo 1000*($_SESSION['user']->last_check-time()); else echo 1000 ?>);
<?php } ?>
});
$('.inner-results p').truncate({max_length: 500});
</script>
<script>
$('.truncate-desc').truncate({max_length: 500});
$('.map').each(function () {
var _this = $(this);
var map, marker, infoWindow;
map = new GMaps({
div: '#' + $(_this).attr('id'),
scrollwheel: false,
lat: $(_this).attr('lat'),
lng: $(_this).attr('lng')
});
infoWindow = new google.maps.InfoWindow({
content: '<div style="height:40px">' + $(_this).attr('point') + '</div>'
});
marker = map.addMarker({
lat: $(_this).attr('lat'),
lng: $(_this).attr('lng'),
title: $(_this).attr('point'),
infoWindow: infoWindow
});
infoWindow.open(map, marker);
});
</script>
<!--[if lt IE 9]>
<script src="/assets/plugins/respond.js"></script>
<script src="/assets/plugins/html5shiv.js"></script>
<![endif]-->
</body>
</html>
<?php } ?>