<?php
/***************************************************************************
* Product Name : Pointter PHP Content Management System
* Version : V 1.2
* Release Date : 01/02/11
* Copyright : (C) 2011 PangramSoft / Murat Cevik
* Program URL : http://www.pointter.com
* Company URL : http://www.pangramsoft.com
* Email Address : hide@address.com
***************************************************************************/
/****************************************************************************
Pointter PHP Content Management System is licensed under Creative Commons Attribution Non-commercial No Derivatives 3.0 Unported (by-nc-nd) License.
To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or (b) send a letter to Creative Commons, 171 2nd Street,
Suite 300, San Francisco, California, 94105, USA.
You must not remove/modify/alter the copyright informations both visible and invisible forms in the source code and you must not remove/modify/alter
the copyright informations in the footer part of the script including the Pointter image (png format file), hard link and title tag.
Please contact the copyright holder PangramSoft / Murat Cevik for a commercial license to remove the copyright information in the footer part of the script.
*****************************************************************************/
$main=$_POST[main];
$sub=$_POST[sub];
include '../../configset/conn.php';
if ($main!="")
{
$check=mysql_query("SELECT * FROM Category WHERE Url='$main'");
$row=mysql_fetch_array($check);
$sub_check=mysql_query("SELECT * FROM Category WHERE Subcode='$row[CategoryID]'");
//Delete Sub Category Database Inputs And PHP Url Files
while ($row_sub=mysql_fetch_array($sub_check))
{
unlink('../../'.$row_sub[Url]);
mysql_query("DELETE FROM Metatags WHERE Url='$row_sub[Url]'");
mysql_query("DELETE FROM Views WHERE Url='$row_sub[Url]'");
mysql_query("DELETE FROM Category WHERE Url='$row_sub[Url]'");
}
//Delete Main Category Database Inputs And PHP Url File
unlink ('../../'.$main);
mysql_query("DELETE FROM Category WHERE Url='$main'");
mysql_query("DELETE FROM Metatags WHERE Url='$main'");
mysql_query("DELETE FROM Views WHERE Url='$main'");
//Update Product Informations
mysql_query("UPDATE Products SET Category='',Subcode='' WHERE Subcode='$row[Name]'");
mysql_close($connect);
header("location:../deletecategory.php");
}
else if ($sub!="")
{
$check=mysql_query("SELECT * FROM Category WHERE Url='$sub'");
$row=mysql_fetch_array($check);
//Delete Sub Category Database Inputs And PHP Url File
unlink ('../../'.$sub);
mysql_query("DELETE FROM Category WHERE Url='$sub'");
mysql_query("DELETE FROM Metatags WHERE Url='$sub'");
mysql_query("DELETE FROM Views WHERE Url='$sub'");
//Update Product Informations
mysql_query("UPDATE Products SET Category='',Subcode='' WHERE Category='$row[Name]'");
mysql_close($connect);
header("location:../deletecategory.php");
}
else
header("location:../deletecategory.php");
?>