<?php

/* FIRESHOP: Advanced Content Market System                         */

/* ============================================                         */

/*                                                                      */

/* Copyright (c) 2012 by Mohamad Porhaji                                */

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

/************************************************************************/

/* $Id: add_sub_cat.php,v 1.0.0.1 2012/02/18 By Mohamad Porhaji $ */

if (stristr(htmlentities($_SERVER["PHP_SELF"]), "add_sub_cat.php")) {
    Header("Location: index.php");
    die();
}


if(isset($_POST['add_sub_cat'])){
if(empty($_POST['title'])){echo"پر كردن همه ي فيلد ها الزامي است";}else{
$title = $_POST['title'];
$is_active = $_POST['is_active'];

$query = $db->sql_query("INSERT INTO `fireshop_category` (`title`, `is_active`, `is_a_cat`, `is_sub_cat`) VALUES ('$title', '$is_active', '0', '1')");if($query){print('<div class="contact_active">دسته با موفقيت ايجاد گرديد</div>');}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');}}
}else{

echo"
<div dir='rtl' align='right' style='padding:10px;'>
<form dir='rtl' action='admin.php?do=add_sub_cat' method='post'>
<table>
<tr>
<td valign='top'>
عنوان : 
<br/><br/>

فعال :
</td>
<td valign='top'>
<input type='text' size='30' name='title' />
<br/><br/>

بله : <input type='radio' name='is_active' value='1' checked='checked'/>
خير : <input type='radio' name='is_active' value='0' />
<br/><br/>

<input type='submit' name='add_sub_cat' value='افزودن' />
 </td>
</tr>
</table>
</form></div>";

}

?>