This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
inside/inside/Actions.php
T
2009-10-13 15:43:04 +02:00

56 lines
1.1 KiB
PHP

<?php
class Actions {
var $actions;
var $conn;
function Actions(){
$this->__construct();
}
function __construct(){
$conn =& DB::connect(getDSN());
if (DB::isError($conn)){
error("Actions: " . $conn->toString());
exit();
}else {
$this->conn = $conn;
}
$sql = "SELECT id, name
FROM din_action
ORDER BY name ASC";
$result = $this->conn->query($sql);
if (DB::isError($result) != true){
$this->actions = $result;
}else {
error($result->toString());
}
}
public function getList(){
return $this->actions;
}
public function displayList($limit = 25){
if ($this->actions->numRows() > 0){
?>
<table class="sortable" id="actions">
<tr>
<th>handling</th>
<th>beskrivelse</th>
<th colspan="2">&nbsp;</th>
</tr>
<?php
while ($row =& $this->actions->fetchRow(DB_FETCHMODE_OBJECT)){
$action = new Action($row->id);
$action->displayList();
}
print(" </table>");
}else {
print("<p>Ingen handlinger registrert.</p>");
}
}
}
?>