Skip to content

Commit 34ca6ac

Browse files
committed
refactoring code: new html formating
1 parent e8590be commit 34ca6ac

File tree

18 files changed

+889
-709
lines changed

18 files changed

+889
-709
lines changed

web/list/backup/index.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@
1212
top_panel($user,$TAB);
1313

1414
// Data
15-
//if ($_SESSION['user'] == 'admin') {
16-
17-
exec (VESTA_CMD."v_list_user_backups $user json", $output, $return_var);
18-
check_error($return_var);
19-
$data = json_decode(implode('', $output), true);
20-
$data = array_reverse($data);
21-
unset($output);
22-
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
23-
//}
15+
exec (VESTA_CMD."v_list_user_backups $user json", $output, $return_var);
16+
$data = json_decode(implode('', $output), true);
17+
$data = array_reverse($data);
18+
unset($output);
19+
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
2420

2521
// Footer
2622
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

web/list/dns/index.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616

1717
if (empty($_GET['domain'])){
1818
exec (VESTA_CMD."v_list_dns_domains $user json", $output, $return_var);
19-
check_error($return_var);
2019
$data = json_decode(implode('', $output), true);
2120
$data = array_reverse($data);
2221
unset($output);
2322
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns.html');
2423
} else {
2524
exec (VESTA_CMD."v_list_dns_domain_records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
26-
check_error($return_var);
2725
$data = json_decode(implode('', $output), true);
2826
$data = array_reverse($data);
2927
unset($output);
@@ -32,14 +30,12 @@
3230
} else {
3331
if (empty($_GET['domain'])){
3432
exec (VESTA_CMD."v_list_dns_domains $user json", $output, $return_var);
35-
check_error($return_var);
3633
$data = json_decode(implode('', $output), true);
3734
$data = array_reverse($data);
3835
unset($output);
3936
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns.html');
4037
} else {
4138
exec (VESTA_CMD."v_list_dns_domain_records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
42-
check_error($return_var);
4339
$data = json_decode(implode('', $output), true);
4440
$data = array_reverse($data);
4541
unset($output);

web/list/ip/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// Data
1717
if ($_SESSION['user'] == 'admin') {
1818
exec (VESTA_CMD."v_list_sys_ips json", $output, $return_var);
19-
check_error($return_var);
2019
$data = json_decode(implode('', $output), true);
2120
$data = array_reverse($data);
2221
unset($output);

web/list/mail/index.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616

1717
if (empty($_GET['domain'])){
1818
exec (VESTA_CMD."v_list_mail_domains $user json", $output, $return_var);
19-
check_error($return_var);
2019
$data = json_decode(implode('', $output), true);
2120
$data = array_reverse($data);
2221
unset($output);
2322
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html');
2423
} else {
2524
exec (VESTA_CMD."v_list_mail_accounts '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
26-
check_error($return_var);
2725
$data = json_decode(implode('', $output), true);
2826
$data = array_reverse($data);
2927
unset($output);
@@ -33,15 +31,13 @@
3331

3432
if (empty($_GET['domain'])){
3533
exec (VESTA_CMD."v_list_mail_domains $user json", $output, $return_var);
36-
check_error($return_var);
3734
$data = json_decode(implode('', $output), true);
3835
$data = array_reverse($data);
3936
unset($output);
4037

4138
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_mail.html');
4239
} else {
4340
exec (VESTA_CMD."v_list_mail_accounts '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
44-
check_error($return_var);
4541
$data = json_decode(implode('', $output), true);
4642
$data = array_reverse($data);
4743
unset($output);

web/list/package/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// Data
1515
if ($_SESSION['user'] == 'admin') {
1616
exec (VESTA_CMD."v_list_user_packages json", $output, $return_var);
17-
check_error($return_var);
1817
$data = json_decode(implode('', $output), true);
1918
$data = array_reverse($data);
2019
unset($output);

web/list/stats/index.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,11 @@
1212
top_panel($user,$TAB);
1313

1414
// Data
15-
//if ($_SESSION['user'] == 'admin') {
16-
17-
exec (VESTA_CMD."v_list_user_stats $user json", $output, $return_var);
18-
check_error($return_var);
19-
$data = json_decode(implode('', $output), true);
20-
$data = array_reverse($data);
21-
unset($output);
22-
23-
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_stats.html');
24-
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_stats.html');
25-
//}
15+
exec (VESTA_CMD."v_list_user_stats $user json", $output, $return_var);
16+
$data = json_decode(implode('', $output), true);
17+
$data = array_reverse($data);
18+
unset($output);
19+
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_stats.html');
2620

2721
// Footer
2822
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

web/list/web/index.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
// Data
1515
if ($_SESSION['user'] == 'admin') {
1616
exec (VESTA_CMD."v_list_web_domains $user json", $output, $return_var);
17-
check_error($return_var);
1817
$data = json_decode(implode('', $output), true);
1918
$data = array_reverse($data);
2019
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_web.html');
2120
} else {
2221
exec (VESTA_CMD."v_list_web_domains $user json", $output, $return_var);
23-
check_error($return_var);
2422
$data = json_decode(implode('', $output), true);
2523
$data = array_reverse($data);
2624
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_web.html');

web/templates/admin/list_log.html

Lines changed: 77 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,77 @@
1-
<table class='data'>
2-
3-
<?php
4-
foreach ($data as $key => $value) {
5-
++$i;
6-
?>
7-
8-
<tr class="data-row">
9-
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
10-
<table class="data-col1" width="150">
11-
<tr><td style="padding: 18 0 4 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE']))?></a></td></tr>
12-
<tr><td style="padding: 0 0 0 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></td></tr>
13-
</table>
14-
</td>
15-
<td class="data-dotted" width="830px" style="vertical-align:top;">
16-
17-
<table width="830px"><tr>
18-
<td></td>
19-
</tr></table>
20-
21-
<table class="data-col5" width="720px">
22-
<tr><td class="log" style="padding: 0 0 20 0" ><?php echo $data[$key]['CMD'] ?> <a class="log-counter-value">
23-
<?php echo "".$data[$key]['A1']." ".$data[$key]['A2']." ".$data[$key]['A3']." ".$data[$key]['A4']." ".$data[$key]['A5']." ".$data[$key]['A6']." ".$data[$key]['A7']." ".$data[$key]['A8']." ".$data[$key]['A9'] ?></td></tr>
24-
</table>
25-
</td>
26-
</tr>
27-
28-
<?php
29-
}
30-
?>
31-
</table>
32-
<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
33-
<table class="data-count">
34-
<tr>
35-
<td>
36-
<?php
37-
if ( $i == 1) {
38-
echo "1 log record ";
39-
} else {
40-
echo "$i log records ";
41-
}
42-
?>
43-
</td>
44-
</tr>
45-
</table>
46-
<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
47-
<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:216px\"><tr><td></td></tr></table>"; ?>
48-
<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:125px\"><tr><td></td></tr></table>"; ?>
49-
<?php if ($i == 3) echo "<table class=\"data-spacer\" style=\"height:34px\"><tr><td></td></tr></table>"; ?>
1+
2+
<table class="sub-menu" style="background: white;">
3+
<tr>
4+
<td style="padding: 12px 0 8px 16px">
5+
<div style="float:left">
6+
</div>
7+
<div style="text-align: right; float: right;">
8+
<input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
9+
<button> Search </button>
10+
</div>
11+
</td>
12+
</tr>
13+
</table>
14+
</td>
15+
</tr>
16+
</table>
17+
18+
<form id="vstobjects">
19+
<table class='data'>
20+
21+
<?php
22+
foreach ($data as $key => $value) {
23+
++$i;
24+
?>
25+
26+
<tr class="data-row">
27+
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150px">
28+
<table class="data-col1" width="150">
29+
<tr><td style="padding: 18 0 4 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE']))?></a></td></tr>
30+
<tr><td style="padding: 0 0 0 4;"><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo $data[$key]['TIME']?></a></td></tr>
31+
</table>
32+
</td>
33+
<td class="data-dotted" width="830px" style="vertical-align:top;">
34+
<table width="830px">
35+
<tr>
36+
<td></td>
37+
</tr>
38+
</table>
39+
<table class="data-col5" width="720px">
40+
<tr>
41+
<td class="log" style="padding: 0 0 20 0" >
42+
<?php echo $data[$key]['CMD'] ?> <a class="log-counter-value">
43+
<?php echo "".$data[$key]['A1']." ".$data[$key]['A2']." ".$data[$key]['A3']." ".$data[$key]['A4']." ".$data[$key]['A5']." ".$data[$key]['A6']." ".$data[$key]['A7']." ".$data[$key]['A8']." ".$data[$key]['A9'] ?>
44+
</td>
45+
</tr>
46+
</table>
47+
</td>
48+
</tr>
49+
50+
<?php
51+
}
52+
?>
53+
54+
</table>
55+
56+
<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
57+
58+
<table class="data-count">
59+
<tr>
60+
<td width="160px"></td>
61+
<td>
62+
<?php
63+
if ( $i == 1) {
64+
echo "1 log record ";
65+
} else {
66+
echo "$i log records ";
67+
}
68+
?>
69+
</td>
70+
</tr>
71+
</table>
72+
</form>
73+
74+
<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
75+
<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:216px\"><tr><td></td></tr></table>"; ?>
76+
<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:125px\"><tr><td></td></tr></table>"; ?>
77+
<?php if ($i == 3) echo "<table class=\"data-spacer\" style=\"height:34px\"><tr><td></td></tr></table>"; ?>

web/templates/admin/list_rrd.html

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,71 @@
1-
<table class='data'>
21

3-
<?php
4-
if (empty($_GET['period'])) {
5-
$period='daily';
6-
} else {
7-
$period=$_GET['period'];
8-
}
2+
<table class="sub-menu" style="background: white;">
3+
<tr>
4+
<td style="padding: 12px 0 8px 16px">
5+
<div style="float:left">
6+
<a class="add" <?php if ((empty($_GET['period'])) || ($_GET['period'] == 'daily')) echo "style='color: #34536A'" ?> href="?period=daily">Daily</a>
7+
<a class="add" <?php if ($_GET['period'] == 'weekly') echo "style='color: #34536A'" ?> href="?period=weekly">Weekly</a>
8+
<a class="add" <?php if ($_GET['period'] == 'monthly') echo "style='color: #34536A'" ?> href="?period=monthly">Monthly</a>
9+
<a class="add" <?php if ($_GET['period'] == 'yearly') echo "style='color: #34536A'" ?> href="?period=yearly">Yearly</a>
10+
</div>
11+
<div style="text-align: right; float: right;">
12+
<input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
13+
<button> Search </button>
14+
</div>
15+
</td>
16+
</tr>
17+
</table>
18+
</td>
19+
</tr>
20+
</table>
921

10-
foreach ($data as $key => $value) {
11-
?>
22+
<form id="vstobjects">
23+
<table class='data'>
24+
<?php
25+
if (empty($_GET['period'])) {
26+
$period='daily';
27+
} else {
28+
$period=$_GET['period'];
29+
}
30+
foreach ($data as $key => $value) {
31+
?>
1232

13-
<tr class="data-row">
14-
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
15-
<table class="data-col1">
16-
<tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
17-
<tr><td><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
18-
<tr><td class="data-active"><b>active</b></td></tr>
19-
</table>
20-
</td>
21-
<td class="data-dotted" width="830px" style="vertical-align:top;">
22-
<table width="830px"><tr>
23-
<td></td>
24-
<td class="data-controls" width="80px"><img src="/images/download.png" width="8px" height="8px"><a href="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>" target="_blank"> download</a></td>
25-
</tr></table>
33+
<tr class="data-row">
34+
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
35+
<table class="data-col1">
36+
<tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
37+
<tr><td><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
38+
<tr><td class="data-active"><b>active</b></td></tr>
39+
</table>
40+
</td>
41+
<td class="data-dotted" width="830px" style="vertical-align:top;">
42+
<table width="830px">
43+
<tr>
44+
<td></td>
45+
<td class="data-controls" width="80px"><img src="/images/download.png" width="8px" height="8px"><a href="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>" target="_blank"> download</a></td>
46+
</tr>
47+
</table>
48+
<table class="data-col2" width="830px">
49+
<tr><td colspan=3 class="domain" style="padding: 0 0 4 4;"><b><?php echo $data[$key]['TITLE'] ?></b></td></tr>
50+
<tr>
51+
<td style="vertical-align:top;" width="630px">
52+
<table width="630px">
53+
</tr>
54+
<td style="background: #7a766d;" width="630px" height="250px">
55+
<img style="padding: 0 0 0 30;" src="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>">
56+
</td>
57+
</tr>
58+
</table>
59+
</td>
60+
<td style="vertical-align:top;">
61+
</td>
62+
</tr>
63+
</table>
64+
</td>
65+
</tr>
2666

27-
<table class="data-col2" width="830px">
28-
<tr><td colspan=3 class="domain" style="padding: 0 0 4 4;"><b><?php echo $data[$key]['TITLE'] ?></b></td></tr>
29-
<tr>
30-
<td style="vertical-align:top;" width="630px">
31-
<table width="630px">
32-
<td style="background: #7a766d;" width="630px" height="250px"><img style="padding: 0 0 0 30;" src="/rrd/<?php echo $data[$key]['TYPE']."/".$period."-".$data[$key]['RRD'].".png" ?>"></td>
67+
<?php
68+
}
69+
?>
3370
</table>
34-
</td>
35-
<td style="vertical-align:top;">
36-
</td>
37-
</tr>
38-
</table>
39-
</td>
40-
</tr>
41-
42-
43-
<?php
44-
}
45-
?>
46-
</table>
71+
</form>

0 commit comments

Comments
 (0)