-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_dump.php
More file actions
77 lines (73 loc) · 2.5 KB
/
db_dump.php
File metadata and controls
77 lines (73 loc) · 2.5 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
<?php
header('Content-Type: text/html; charset=utf-8');
/*------------------------------------------------------------------------*
* © 2010 University of Limerick. All rights reserved. This material may *
* not be reproduced, displayed, modified or distributed without the *
* express prior written permission of the copyright holder. *
*------------------------------------------------------------------------*/
;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CNLF Server Stats</title>
<style type="text/css">
table.sample {
border-width: 0px;
border-spacing: 3px;
border-style: outset;
border-color: gray;
border-collapse: collapse;
background-color: rgb(255, 255, 240);
}
table.sample th {
border-width: 1px;
padding: 4px;
border-style: inset;
border-color: gray;
background-color: rgb(255, 255, 240);
-moz-border-radius: 3px 3px 3px 3px;
}
table.sample td {
border-width: 1px;
padding: 4px;
border-style: inset;
border-color: gray;
background-color: rgb(255, 255, 240);
-moz-border-radius: 3px 3px 3px 3px;
}
</style>
</head>
<body>
<?php
require_once('./conf.php');
try
{
//open the database
$db = new PDO('sqlite:'.BASE_DB_URL.'locTemp.sqlite');
//now output the data to a simple html table...
print "<table class='sample'>";
print "\n<tr>\n\t<td>Job</td>\n\t<td>Com</td>\n\t<td>File Content</td>\n\t<td> Status </td>\n\t<td>Feedback</td>\n\t<td>Output</td></tr>\n";
$result = $db->query('SELECT * FROM Demo order by Job');
foreach($result as $row)
{
$job=$row['Job'];
$com=$row['Com'];
print "\n<tr>\n\t<td>".$job."</td>\n";
print "\t<td>".$com."</td>\n";
print "\t<td><a href='http://".$_SERVER['HTTP_HOST'].BASE_URL."/show_job.php?type=fd&id=".$job."&com=".$com."'>".htmlspecialchars(substr($row['FileData'],0,30), ENT_QUOTES, "UTF-8")."..</a></td>\n";
print "\t<td>".$row['Status']."</td>\n";
print "\t<td>".$row['Feedback']."</td>\n";
print "\t<td><a href='http://".$_SERVER['HTTP_HOST'].BASE_URL."/show_job.php?type=output&id=".$job."&com=".$com."'>".htmlspecialchars(substr($row['Output'],0,30), ENT_QUOTES, "UTF-8")."..</a></td>\n</tr>\n";
}
print "</table>\n";
// close the database connection
$db = NULL;
}
catch(PDOException $e)
{
print 'Exception : '.$e->getMessage();
}
;?>
</body>
</html>