Location: PHPKode > projects > Butterfly Organizer > viewdb2.php
<?php
/*
Butterfly Organizer
Copyright (C) 2007-2008 Butterfly Media Romania

This file is part of Butterfly Organizer.

Butterfly Organizer is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

include('includes/top.php');

echo '<h2>Category Listing</h2>';

$mytable = $_GET['mytable'];

$result = mysql_query("SELECT * FROM ".$mytable,$database);

echo '<table id="tableCategories" class="stripeMe">';
echo "<thead><tr class='alt'><th>Name</th><th>Date added</th><th>Options</th></tr></thead>";
echo '<tbody>';
while ($myrow = mysql_fetch_array($result)) {
	echo "<tr><td><a href=\"view.php?id=".$myrow['id']."&amp;mytable=".$mytable."\">".$myrow['name']."</a></td><td class='dataCreationDate'>".$myrow['date']."</td>";
	echo "<td><a href=\"view.php?id=".$myrow['id']."&amp;mytable=".$mytable."\"><img src='".$imagesFolder."icon-account-view.png' alt='View' title='View' /></a> <a href=\"addedit.php?id=".$myrow['id']."&amp;mytable=".$mytable."\"><img src='".$imagesFolder."icon-account-edit.png' alt='Edit' title='Edit' /></a> <a href=\"delete.php?id=".$myrow['id']."&amp;mytable=".$mytable."\" onclick=\"return confirmLinkDropACC(this, 'delete &lt;".$myrow['reference']."&gt;?')\"><img src='".$imagesFolder."icon-account-delete.png' alt='Delete' title='Delete' /></a></td></tr>";
}
echo '</tbody>';
echo "</table>";

echo '<div class="menubar">';
echo '<a href="input.php?mytable='.$mytable.'" class="bsButton">Add Account</a> ';
echo '</div>';

include('includes/bottom.php');
?>
Return current item: Butterfly Organizer