5tarl0rd
<?php
include("classes/access_user_class.php");
header("Cache-Control: public");
include_once("texteditor/fckeditor.php");
$page_protect = new Access_user;
//$page_protect->login_page = "login.php";
$page_protect->access_page();
if (isset($_GET['action']) && $_GET['action'] == "log_out") {
$page_protect->log_out(); // the method to log off
}
$response = new Response();
if(isset($_POST["Submit"]))
{
if($_POST['status'] != 1)
{
$status = 0;
}
else
{
$status = 1;
}
$title = $_POST["name"];
$query_news = "INSERT INTO tbl_category (name, status) VALUES ('$title','$status')";
mysql_query($query_news) or die('Error, insert query failed');
$news_id = mysql_insert_id();
$message= "Category successfully added";
$response->Redirect("list_cats.php?mes=".$message);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Control Panel</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<?php include("includes/header.php");?>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="3" align="left" background="images/white_left_bar.gif"></td>
<td align="center"></td>
<td width="1%" rowspan="3" align="right" background="images/white_right_bar.gif"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td width="99%"><table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="20%" valign="top"><?php require_once("includes/left_column.php");?></td>
<td width="80%" valign="top"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#cccccc" class="tableBorder">
<tr>
<td align="center" bgcolor="#EFEFEF" class="boldText">Add New Category </td>
</tr>
<tr>
<td align="left" background="#F6F6F6" class="boldBodyText"><form action="new_cats.php" method="post" enctype="multipart/form-data" name="navform" id="navform">
<table width="100%" border="0" cellpadding="2" cellspacing="2" >
<tr>
<td ><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td ><table width="100%" >
<tr>
<td width="18%" align="right" class="mainText12" > </td>
<td width="39%" align="left" > </td>
<td width="20%" align="right" class="mainText12"> </td>
<td width="23%" align="right" ><a href="list_cats.php">Go back</a> </td>
</tr>
<tr>
<td align="left" class="mainText">Title : </td>
<td colspan="3" align="left"><input name="name" type="text" id="name" size="53" maxlength="95" /></td>
</tr>
<tr>
<td align="left" class="mainText"> </td>
<td colspan="3" align="left"> </td>
</tr>
<tr>
<td height="24" align="left" class="mainText">Status:</td>
<td colspan="3" align="left"><input name="status" type="checkbox" id="status" value="1" checked="checked" />
Enabled</td>
</tr>
<tr>
<td align="left" class="mainText"> </td>
<td colspan="3" align="left"> </td>
</tr>
<tr>
<td colspan="4" align="center" class="mainText"><input type="submit" name="Submit" id="Submit" value="Submit" /></td>
</tr>
</table>
</td>
</tr>
<tr height="20">
<td> </td>
</tr>
<tr>
<td align="right" class="mainText12"></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td ><img src="images/white_left_bottom_corner.gif" width="9" height="9" /></td>
<td width="99%" background="images/white_bottom_bar.gif"><img src="images/white_bottom_bar.gif" width="4" height="9" /></td>
<td width="1%"><img src="images/white_right_bottom_corner.gif" width="9" height="9" /></td>
</tr>
</table>
</body>
<script language="javascript">
var valid = new Validator("navform");
</script>
</html>
5tarL0rd By