1
|
<?php/* Written by Gerben Schmidt, http://scripts.zomp.nl */include_once("config.php");include('session.php');include('header.php');include("../language/$language");if(!$_POST["submit"]){echo "<form name='input' method='post' action='category.php'>";echo "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>"; echo "<td> </td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$lang_newcategory</td>";echo "</tr>";echo "<tr>";echo "<td> </td>";echo "</tr>";echo "<tr>";echo "<td class='admin'>$lang_catname</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'><input name='name' type='text' id='name'></td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>$lang_catpost</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>";?><select name="permissions" style="width: 140px"> <option value="0">everyone</option><option value="1">admin only</option></select><?echo "</td>";echo "</tr>";echo "<tr>"; echo "<td> </td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'><input type='submit' name='submit' value='submit'></td>";echo "</tr>";echo "<tr>";echo "<td> </td>";echo "</tr>";echo "</form>";echo "</table>";echo "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>";echo "<td class='admin'> </td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$lang_currentcategories</td>";echo "</tr>";echo "<tr>"; echo "<td> </td>";echo "</tr>";$query = mysql_query("SELECT * FROM $table_cat ORDER BY 'id' ASC"); while($row = mysql_fetch_array($query)) {$catid = $row['id'];$name = $row['name'];if(!$catid){echo "<tr>";echo "<td class='admin'>$lang_nocatcreated</td>";echo "</tr>";}else{echo "<tr>";echo "<td class='admin'>$name</td><td><A HREF='schredder.php?tablename=$table_cat&id=$catid' onclick=\"return verify()\">$delete</A></td>";echo "</tr>";}}echo "<tr>";echo "<td class='admin'> </td>";echo "</tr>";echo "</table>";}$username = $_SESSION['login'];if($_POST["submit"]){if(!$_POST["name"]) {$error = "$providecatname. $back $prevpage";}else {mysql_query("INSERT INTO $table_cat (name,permissions) VALUES ('$_POST[name]','$_POST[permissions]')") or die (mysql_error()); $error = "$data_added $backmembersarea";}}DisplayError($error);include('footer.php');?>
|