ruạṛ
<?php /** * Management of user-definable lists * @version 0.10 * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package WEP-CMS */ session_start(); require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/universal.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/display.php'; $connID = connect_to_db(); /** * define variables to be passed to header function * @var string $current section of site for navigation menu highlighting * @var string $title page title for browser * @var string $keywords meta keywords * @var string $keywords meta description */ $current = 'lists'; $title = 'Administration Panel'; $keywords = ''; $description = ''; /** * buffer then output page */ ob_start(); head($current,$title,$keywords,$description); this_page(); footer(); ob_end_flush(); /** * clean up and exit script */ exit; /** * function to display content specific to this page */ function this_page() { $error = isset($_SESSION['passback']); $lists = mysql_query("select * from lists order by list_name "); ?> <h1>Property option lists</h1> <?php if(MODULE_LISTS_CREATE): ?> <form name="add_list" id="add_list" action="processes/process-list-new.php" method="post" enctype="multipart/form-data" class="add"> <p class="center"><label for="list_name">New list:</label> <input name="list_name" id="list_name" type="text" size="30" placeholder="Name" value="<?php echo ($error) ? $_SESSION['passback']['list_name'] : ''; ?>" /> <input name="list_description" id="list_description" type="text" size="30" placeholder="Description" value="<?php echo ($error) ? $_SESSION['passback']['list_description'] : ''; ?>" /> <input type="submit" name="add" value="Add list" /> </p> </form> <?php endif; ?> <?php if($error){unset($_SESSION['passback']);} if(!$lists || mysql_num_rows($lists) < 1) { ?> <p class="center">No lists found.</p> <p> </p> <?php return; } //end if !testimonials ?> <table class="control_panel agent"> <thead> <tr> <th class="pad"> </th> <th class="username">List</th> <th class="left">Description</th> <th class="control">Manage</th> <th class="pad"> </th> </tr> </thead> <tfoot></tfoot> <tbody> <?php while($l = mysql_fetch_assoc($lists)) { $id = $l['list_id']; ?> <tr> <td> </td> <td valign="top"><?php echo $l['list_name']; ?></td> <td class="left"><?php echo nl2br($l['list_description']); ?></td> <td valign="top"><a href="list.php?list=<?php echo $id; ?>">Manage</a></td> <td> </td> </tr> <?php } ?> </tbody> </table> <p> </p> <?php } ?>
cải xoăn