Skip to content
Snippets Groups Projects
Commit 0c1fecfd authored by Patrick Anders's avatar Patrick Anders
Browse files

backup_stats: add links & add backup counter

parent 78d02d71
No related branches found
No related tags found
No related merge requests found
...@@ -17,13 +17,19 @@ class list_action extends listform_actions { ...@@ -17,13 +17,19 @@ class list_action extends listform_actions {
public function prepareDataRow($rec) public function prepareDataRow($rec)
{ {
global $app;
$rec = parent::prepareDataRow($rec); $rec = parent::prepareDataRow($rec);
$rec['active'] = "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>"; $rec['active'] = "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>";
if ($rec['backup_interval'] === 'none') { if ($rec['backup_interval'] === 'none') {
$rec['active'] = "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"; $rec['active'] = "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>";
$rec['backup_copies'] = 0;
} }
$recBackup = $app->db->queryOneRecord('SELECT COUNT(backup_id) AS backup_count FROM web_backup WHERE parent_domain_id = ?', $rec['domain_id']);
$rec['backup_copies_exists'] = $recBackup['backup_count'];
return $rec; return $rec;
} }
} }
......
<?php
$wb["list_head_txt"] = 'Backup Statistiken';
$wb["database_name_txt"] = '';
$wb['active_txt'] = 'Aktiv';
$wb['domain_txt'] = 'Domain';
$wb['backup_count_txt'] = 'Anz. Backups';
$wb['backup_server_txt'] = 'Server';
$wb['backup_interval_txt'] = 'Intervall / Anz.';
?>
<?php
$wb["list_head_txt"] = 'Backup Stats';
$wb["database_name_txt"] = '';
$wb['active_txt'] = 'Active';
$wb['domain_txt'] = 'Domain';
$wb['backup_count_txt'] = 'Backup count';
$wb['backup_server_txt'] = 'Server';
$wb['backup_interval_txt'] = 'Interval / cnt.';
?>
...@@ -13,25 +13,25 @@ ...@@ -13,25 +13,25 @@
<th class="tbl_col_domain" scope="col"> <th class="tbl_col_domain" scope="col">
<tmpl_var name="domain_txt"> <tmpl_var name="domain_txt">
</th> </th>
<th class="tbl_col_backup_count" scope="col">
<tmpl_var name="backup_count_txt">
</th>
<th class="tbl_col_server" scope="col"> <th class="tbl_col_server" scope="col">
<tmpl_var name="backup_server_txt"> <tmpl_var name="backup_server_txt">
</th> </th>
<th class="tbl_col_period" scope="col"> <th class="tbl_col_interval" scope="col">
<tmpl_var name="backup_period_txt"> <tmpl_var name="backup_interval_txt">
</th>
<th class="tbl_col_backup_count" scope="col">
<tmpl_var name="backup_count_txt">
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tmpl_loop name="records"> <tmpl_loop name="records">
<tr class="tbl_row_{tmpl_if name='__EVEN__'}even{tmpl_else}uneven{/tmpl_if}"> <tr class="tbl_row_{tmpl_if name='__EVEN__'}even{tmpl_else}uneven{/tmpl_if}">
<td class="tbl_col_active">{tmpl_var name="active"}</td> <td class="tbl_col_active"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="active"}</a> </td>
<td class="tbl_col_domain">{tmpl_var name="domain"}</td> <td class="tbl_col_domain"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain"}</a> </td>
<td class="tbl_col_backup_count">{tmpl_var name="backup_copies"}</td> <td class="tbl_col_server"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="server_id"}</a> </td>
<td class="tbl_col_server">{tmpl_var name="server_id"}</td> <td class="tbl_col_interval"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_interval"}</a> / <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_copies"}</a> </td>
<td class="tbl_col_period">{tmpl_var name="backup_interval"}</td> <td class="tbl_col_backup_count"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_copies_exists"}</a> </td>
</tr> </tr>
</tmpl_loop> </tmpl_loop>
</tbody> </tbody>
...@@ -46,37 +46,3 @@ ...@@ -46,37 +46,3 @@
</fieldset> </fieldset>
</div> </div>
</div> </div>
<!--
-<old>
- <tmpl_loop name="records">
- <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
- <td class="tbl_col_domain"><a target="_blank" href="http://{tmpl_var name="domain"}/stats">{tmpl_var name="domain"}</a></td>
- <td class="tbl_col_this_month"><a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_month"} MB</a></td>
- <td class="tbl_col_last_month"><a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_month"} MB</a></td>
- <td class="tbl_col_this_year"><a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="this_year"} MB</a></td>
- <td class="tbl_col_last_year"><a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="last_year"} MB</a></td>
- <td class="tbl_col_buttons"></td>
- </tr>
- </tmpl_loop>
- <tmpl_unless name="records">
- <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
- <td colspan="6">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
- </tr>
- </tmpl_unless>
- <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
- <td class="tbl_col_domain"><a href="#" onclick="return false;" style="font-weight:bold;">{tmpl_var name="sum_txt"}</a></td>
- <td class="tbl_col_this_month"><a href="#" onclick="return false;" style="font-weight:bold;">{tmpl_var name="sum_this_month"} MB</a></td>
- <td class="tbl_col_last_month"><a href="#" onclick="return false;" style="font-weight:bold;">{tmpl_var name="sum_last_month"} MB</a></td>
- <td class="tbl_col_this_year"><a href="#" onclick="return false;" style="font-weight:bold;">{tmpl_var name="sum_this_year"} MB</a></td>
- <td class="tbl_col_last_year"><a href="#" onclick="return false;" style="font-weight:bold;">{tmpl_var name="sum_last_year"} MB</a></td>
- <td class="tbl_col_buttons"></td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td class="tbl_footer tbl_paging" colspan="6"><tmpl_var name="paging"></td>
- </tr>
- </tfoot>
-</old>
-->
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment