-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnurunhtml.php
80 lines (47 loc) · 1.49 KB
/
nurunhtml.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
<?php
require_once('nuchoosesetup.php');
require_once('nucommon.php');
require_once('nudata.php');
print "<meta charset='utf-8'>";
$table_id = nuTT();
$s = "SELECT deb_message AS json FROM zzzzsys_debug WHERE zzzzsys_debug_id = ? "; //-- created by nuRunHTML()
$t = nuRunQuery($s, array($_GET['i']));
$r = db_fetch_object($t);
$j = json_decode($r->json);
$q = $j->sql;
$c = $j->columns;
$_POST['nuHash'] = (array) $j->hash;
$_POST['nuHash']['TABLE_ID'] = nuHash()['browse_table_id'];
nuEval(nuHash()['form_id'] . '_BB');
print "<style>\n";
for($col = 0 ; $col < count($c) ; $col++){
$wd = ($c[$col]->width) . 'px';
if($c[$col]->align == 'l'){$align = 'left';}
if($c[$col]->align == 'r'){$align = 'right';}
if($c[$col]->align == 'c'){$align = 'center';}
$class[$col] = "style='font-size:12px;width:$wd;text-align:$align'";
}
print "</style>\n";
print "<TABLE border=1>\n";
print "\n<TR>";
for($col = 0 ; $col < count($c) ; $col++){
$st = $class[$col];
print "<TH $st>";
print $c[$col]->title;
print "</TH>\n";
}
$h = "</TR>";
$t = nuRunQuery($j->sql);
while($r = db_fetch_array($t)){
$h .= "\n<TR>\n";
for($col = 0 ; $col < count($c) ; $col++){
$st = $class[$col];
$h .= "<TD $st>" . $r[$c[$col]->display] . "</TD>\n";
}
$h .= "</TR>";
}
$h .= "</TABLE>";
print $h;
nuRunQuery("DELETE FROM zzzzsys_debug WHERE zzzzsys_debug_id = ? ", array($_GET['i']));
nuRunQuery("DROP TABLE IF EXISTS " . nuHash()['browse_table_id']);
?>