<?php
/********************************************************/
/* NSN GR Downloads                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright  2000-2005 by NukeScripts Network         */
/********************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}

$numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".TABLE_NSNGD_CATEGORIES." WHERE title='$title' AND parentid='$cid'"));
if ($numrows>0) {
  $pagetitle = _CATEGORIESADMIN.": "._DL_ERROR;
  incoh();
  title($pagetitle);
  DLadminmain();
  br('1');
  Max_OpenTable();
  echo "<center><b>"._ERRORTHESUBCATEGORY." $title "._ALREADYEXIST."</b></center><br />\n";
  echo "<center>"._GOBACK."</center>\n";
  Max_CloseTable();
  incof();
} else {
  $db->sql_query("INSERT INTO ".TABLE_NSNGD_CATEGORIES." VALUES (NULL, '$title', '$cdescription', '$cid', '$whoadd', '$uploaddir', '$canupload', 1)");
  redirect_url("".$admin_file.".php?op=Categories");
}