Cleaning up the templates

This commit is contained in:
jengo 2000-11-22 05:45:31 +00:00
parent 1690434306
commit a01fbc39e2
3 changed files with 27 additions and 31 deletions

View File

@ -15,11 +15,8 @@
$phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True);
include("../header.inc.php");
$phpgw->template->set_file(array( "header" => "accesslog.tpl",
"row" => "accesslog.tpl",
"footer" => "accesslog.tpl" ));
$phpgw->template->set_block("header","row","footer");
$phpgw->template->set_file(array("list" => "accesslog.tpl",
"row" => "accesslog_row.tpl"));
$show_maxlog = 30;
@ -32,10 +29,8 @@
$phpgw->template->set_var("lang_logout",lang("Logout"));
$phpgw->template->set_var("lang_total",lang("Total"));
$phpgw->template->parse("out","header");
$phpgw->db->query("select loginid,ip,li,lo from access_log order by li desc "
. "limit $show_maxlog");
. "limit $show_maxlog");
while ($phpgw->db->next_record()) {
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
@ -69,18 +64,20 @@
$lo = " ";
}
$phpgw->template->set_var("row_loginid",$phpgw->db->f("loginid"));
if (ereg("@",$phpgw->db->f("loginid"))) {
$t = split("@",$phpgw->db->f("loginid"));
$loginid = $t[0];
} else {
$loginid = $phpgw->db->f("loginid");
}
$phpgw->template->set_var("row_loginid",$loginid);
$phpgw->template->set_var("row_ip",$phpgw->db->f("ip"));
$phpgw->template->set_var("row_li",$li);
$phpgw->template->set_var("row_lo",$lo);
$phpgw->template->set_var("row_total",$total);
if ($phpgw->db->num_rows() == 1) {
$phpgw->template->set_var("output","");
}
if ($phpgw->db->num_rows() != ++$i) {
$phpgw->template->parse("output","row",True);
}
$phpgw->template->parse("rows","row",True);
}
$phpgw->db->query("select count(*) from access_log");
@ -97,6 +94,7 @@
$phpgw->template->set_var("footer_total",lang("Total records") . ": $total");
$phpgw->template->set_var("lang_percent",lang("Percent of users that logged out") . ": $percent%");
$phpgw->template->pparse("out","footer");
$phpgw->template->pparse("out","list");
$phpgw->common->phpgw_footer();
?>

View File

@ -1,4 +1,4 @@
<!-- BEGIN header -->
<!-- BEGIN list -->
<p>
<table border="0" align="center" width="75%">
<tr>
@ -13,21 +13,9 @@
<td>{lang_logout}</td>
<td>{lang_total}</td>
</tr>
<!-- END header -->
{output}
{rows}
<!-- BEGIN row -->
<tr bgcolor="{tr_color}">
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_li}</td>
<td>{row_lo}</td>
<td>{row_total}</td>
</tr>
<!-- END row -->
<!-- BEGIN footer -->
<tr bgcolor="{bg_color}">
<td colspan=5 align=left>{footer_total}</td>
</tr>
@ -36,4 +24,4 @@
<td colspan=5 align=left>{lang_percent}</td>
</tr>
</table>
<!-- END footer -->
<!-- END list -->

View File

@ -0,0 +1,10 @@
<!-- BEGIN row -->
<tr bgcolor="{tr_color}">
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_li}</td>
<td>{row_lo}</td>
<td>{row_total}</td>
</tr>
<!-- END row -->