Make use of Yapter Template Engine

This commit is contained in:
2023-02-13 09:31:40 +01:00
parent 7322231d3e
commit 8d00ee5e1b
100 changed files with 4804 additions and 2666 deletions

View File

@@ -1,23 +1,24 @@
<?php
include("header.php");
?>
<table border="0">
<tr>
<td>
<b>Asset:</b><br>
</td>
</tr>
<?php
$result = mysql_query("SELECT asset_id, asset_name FROM asset ORDER BY asset_name");
while ($row = mysql_fetch_object($result)) {
echo '<tr><td><a href="assetview.php?asset_id=' . $row->asset_id . '">' . $row->asset_name . '</a></td></tr>';
}
?>
</table>
<?
// set template
$tp = new Template("tpl/asset.tpl");
// set language variables
$tp->setvars($lang);
// get asset info
$result = mysql_query("SELECT asset_id, asset_name FROM asset ORDER BY asset_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("asset_id", $row->asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
?>