<?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 the cookie has the wrong password, they are taken to the login page
if ($pass != $myrow['parola'])
{
header("Location: login.php");
}
else
{?>
<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>Select Main Category:</b></font><td bgcolor="#333333">
<p align="center"><b><font color="#FFFFFF" size="1" face="Verdana">
<a href="cont.php"><font color="#FFFFFF"><<<</font></a></span></font></b><a href="cont.php"><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><font face=Verdana color=#FFFFFF size=1>>>></font></span></b></p></td></tr></table>
<table width=860 cellpadding=0>
<tr><td width="80%" bgcolor=#AFC7E2 align="center">
<table border="0" width="60%">
<tr>
<td bgcolor="#4C83C8" width="60%">
<font color="#FFFFFF" face="Verdana" size="2"><b>Select a
Category:</b></font></td>
<td bgcolor="#FF0000" width="40%">
<p align="center"><a href="newcateg.php"><b><font color="#FFFFFF" face="Verdana" size="1">
<u>or create a new one</u></font></b></a></td>
</tr>
<tr>
<td bgcolor="#AFC7E2" width="100%" colspan="2">
</td>
</tr>
</table>
<table width=60% cellspacing=2 border=0 cellpadding=4>
<?php
$check = mysql_query("SELECT * FROM judete ORDER BY judete ASC limit 0,50")or die(mysql_error());
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
echo "<tr><td bgcolor=#ffffff><font color=#333333 size=2 face=verdana>You have no main categories added!<br>To add a new category, just click on <a href=newcateg.php><span style=background-color: #FF0000>ADD NEW</span></a><br>Your website needs at least one category and one subcategory
<br><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)
</td/></tr>";
}
else
{
while($zzz = mysql_fetch_array( $check ))
{
$zz=str_replace (" ", "+", $zzz[judete]);
echo "<tr><td width=5% bgcolor=#ffffff align=center><img src=arrow.jpg border=0></td><td bgcolor=#ffffff width=75%><a href=adauga_anunt1.php?judet=".$zz."><font face=Verdana size=1 color=red><b><u>".$zzz[judete]."</u></b></a></td/><td bgcolor=#ffffff width=20% align=center><font color=#666666 size=1 face=verdana>delete [<a href= deletecategory.php?judet=".$zz."><font color=red>x</font></a>]</font></tr>";
}
}
echo "<tr><td><br><br><br></td></tr></table>";
}}}
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>