PHP Classes

File: tpl.list_user.php

Recommend this page to a friend!
  Classes of marcelo entraigas   AMD   tpl.list_user.php   Download  
File: tpl.list_user.php
Role: Example script
Content type: text/plain
Description: Example - template report
Class: AMD
Add, modify and delete MySQL table records
Author: By
Last change:
Date: 14 years ago
Size: 778 bytes
 

Contents

Class file image Download
<?php
    $db
= new Database();
   
$sql = 'SELECT * FROM users';
   
$arr_users = $db->get_all($sql);
?>
<table border="1" align="center">
    <tr align="center">
        <td width="250px">User</td>
        <td width="100px">Type</td>
        <td width="150px" colspan="2"><small>Add,Modify,Delete</small></td>
    </tr>
<?php foreach ($arr_users as $value):?>
<tr align="center">
        <td align="left"><?php echo $value->username?></td>
        <td><?php echo $value->user_type?></td>
        <td><a href="index.php?id=<?php echo $value->user_id?>">Edit</a></td>
        <td><a href="index.php?del&user_id=<?php echo $value->user_id?>">Delete</a></td>
    </tr>
<?php endforeach;?>
<tr align="right"><td colspan="4"><a href="index.php?id=new">Add New User</a></td></tr>
</table>
NOTE: try to insert a XXS! >"<'