Location: PHPKode > projects > Arab Cart > arabCart/admincp/editcat.php
<?php
/*
  ArabCart, Free E-Commerce Solutions
  http://www.arabcart.info

  Copyright (c) 2005 Mhd Zaher Ghaibeh

  Released under the GNU General Public License
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
  USA.
*/


session_start();

if((!isset($admin))&&(!isset($upass)))

{

	echo('<html>

		<head>

		<meta http-equiv="Content-Type" content="text/html; charset='.charset.'">

		<link rel="stylesheet" href="../style/style.css" type="text/css">

		<meta http-equiv="Refresh" content="0; URL=../admincp/index.php">

		<title>Waite....</title>

		</head>

		<body>

		<br>

		<br>

		<br>

		<div align="center">

		<br><br>

		<table width="50%" border="1" class="border">

		<tr><td class="border">

		<table border="0" width="100%" id="table1" cellpadding="5" cellspacing="0">

		<tr>

		<td align="center">

		<b>Sorry you can\'t Assecc <br> Please waite While you Redirected to the Login Page<br> 

		waite .....</b>		

		</td>

		</tr>

		</table>

		</td></tr>

		</table>

		</div>

		</body>	

		</html>');

}

else

{

	include("../includes/lang-eng.php");

	require_once("../connections/connection.php");

	

	//added templates to deal with

	include("addtmpl.php");





	$template -> setAttribute("addc", "visibility", "visible");

	$template -> setAttribute("catid", "visibility", "visible");

	

	$category=mysql_query("select * from categories where id=".$id." ") or die(mysql_error());

	$row_cat=mysql_fetch_object($category);

	  

	//brings Categories name

	$catname=mysql_query("select * from categories where id<>".$id." order by id") or die(mysql_error());

	if(mysql_num_rows($catname)!=0)

	{

		

		while($row=mysql_fetch_object($catname))

		{

			$template -> AddVar("cat","CAT-NAME",$row->name);

			if($row_cat->parent_id==$row->id)

			{

				$template -> AddVar("cat","SELECT","selected");

				$template -> AddVar("cat","CAT-ID",$row->id);

				$template -> parseTemplate("cat","a");



			}

			else

				if($row_cat->parent_id!=$row->id)

				{

					$template -> AddVar("cat","SELECT","");

					$template -> AddVar("cat","CAT-ID",$row->id);

					$template -> parseTemplate("cat","a");

				}



		}	

	}

		

	$template -> AddVar("addc","CAT-NAME",catname);

	$template -> AddVar("addc","PAGE",'updatec');

	$template -> AddVar("addc","PARENT-CATEGORY",pcatego);

	$template -> AddVar("addc","DESC",sdesc);

	$template -> AddVar("addc","FULL-DESC",desc);

	

	// getting data from the database

	$template -> AddVar("addc","DB-CAT-NAME",$row_cat->name);

	$template -> AddVar("addc","CAT-ID",$row_cat->id);

	$template -> AddVar("addc","DB-DESC",htmlspecialchars(stripslashes($row_cat->desc)));

	$template -> AddVar("addc","ADD",edit);



	

	include("vars.php");

}

?>
Return current item: Arab Cart