<?php
include("../setari.php");
$cxn = @ConnectToDb($dbServer, $dbUser9, $dbPass9, $dbName9);
if(isset($_COOKIE['vanzinch_email']))
{
$username = $_COOKIE['vanzinch_email'];
$pass = $_COOKIE['vanzinch_pass'];
$check = mysql_query("SELECT * FROM clienti WHERE email = '$username'")or die(mysql_error());
while($myrow = mysql_fetch_array( $check ))
{
if ($pass != $myrow['parola'])
{
header("Location: login.php");
}
else
if($_POST[submit])
{
$insert="INSERT INTO judete(judete)VALUES('$_POST[category]')";
$rsult = mysql_query($insert) or die("Query failed aici");
header("Location: adauga_anunt0.php");
}
{?>
<html>
<head>
<title>ADMIN</title>
<style type="text/css"><!--
A{text-decoration:none}
-->
</style>
</head>
<body bgcolor="#333333">
<div align="center">
<br><br>
<?php
include 'sus.php';
?>
<div align="center">
<table border="1" width="860" cellspacing="0" cellpadding="0" bordercolor="#006699" bordercolorlight="#808080" bgcolor="#ffffff">
<tr><td>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="800" align=center bgcolor="#FFFFFF" valign="top">
<div align="center">
<table cellspacing="1" cellpadding="2" width="860">
<tr><td valign="top" bgcolor="#CC3300" width="418">
<font color="#FFFFFF" face="Verdana" size="2"><b>
</span>Add Main Category:</b></font><td bgcolor="#333333">
<p align="center"><b><font color="#FFFFFF" size="1" face="Verdana">
<span lang="en-us"><a href="cont.php"><font color="#FFFFFF"><<<</font></a></span></font></b><a href="cont.php"><span lang="en-us"><b><font face="Verdana" size="1" color="#FFFFFF">Back
to Main Page</font></b></span></a><td class=anunttitlu2 width=20% bgcolor="#FF0000">
<p align=center><b><a href=logout.php>
<font face=Verdana color=#ffffff size=1>Logout</font></a><span lang="en-us"><font face=Verdana color=#FFFFFF size=1>>>></font></span></b></p></td></tr></table>
<table width=860 cellpadding=0>
<tr><td width="80%" bgcolor=#EEF3F9 align="center">
<table border="0" width="60%">
<tr>
<td bgcolor="#4C83C8" width="60%">
<font face="Verdana" size="2" color="#FFFFFF">
<b>New Category:</b></font></td>
<td bgcolor="#FF0000" width="40%">
<p align="center"><b><a href="adauga_anunt0.php">
<font size="1" face="Verdana" color="#FFFFFF">cancel</font></a></b></td>
</tr>
<tr>
<td bgcolor="#EEF3F9" width="426" colspan="2">
</td>
</tr>
<tr>
<td colspan="2">
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<input type="text" name="category" size="31"> </tr>
<tr>
<td colspan="2">
<input type="submit" value="Add Category" name="submit"></td></tr>
<tr>
<td colspan="2">
</td></tr>
</form>
<tr><td bgcolor="#FFFFFF" colspan="2"><font color=#333333 size=2 face=verdana>
<br><font size=1>Example 1: <font color=red>New York City</font> > Manhattan <br>(New York City is the Main Category and Manhattan is the Subcategory)
<br><br>Example 2: <font color=red>New York City</font> > Apartments for Rent <br>(New York City is the Main Category and Apartments for Rent is the Subcategory)
<br><br>Example 3: <font color=red>Apartments for Rent</font> > Manhattan<br>(Apartments for Rent is the Main Category and Manhattan is the Subcategory)
<p>
</td/></tr><tr><td colspan="2"><br><br><br></td></tr></table>
<?php
}}}
else
//if the cookie does not exist, they are taken to the login screen
{
header("Location: login.php");
}
?>
</table>
</td>
</tr>
</td>
</tr>
</table></div>
</td>
</tr>
</table>
<tr>
<td colspan="2">
</td>
</tr>
</table>
</tr></td></table>
</body>
</html>