<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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


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

$query = $db->sql_query("INSERT INTO fireshop_sendway (`title`, `maliyat`, `hazine`, `is_active`) VALUES ('$title', '$maliyat', '$hazine', '$is_active')");if($query){print('<div class="contact_active">با موفقيت ايجاد شد</div>');}else{print('خطا');}
}


}else{
echo"
<div align='right' style='padding:10px' dir='rtl'>
<form action='admin.php?do=add_sendway' method='POST'>
<div style='float:right;width:150px' for=\"name\">عنوان : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name=\"title\" size='50' style='height: 20px'/></div><div class='clear'></div><br/>

<div style='float:right;width:150px' for=\"name\">ماليات يا هزينه هاي متفرقه : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name=\"maliyat\" size='30' style='height: 20px'/> مبلغ به تومان</div><div class='clear'></div><br/>

<div style='float:right;width:150px' for=\"name\">هزينه پستي : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name=\"hazine\" size='30' style='height: 20px'/> مبلغ به تومان</div><div class='clear'></div><br/>

وضعيت  : <span style='color: red'>*</span> فعال <input type='radio' name='is_active' checked='checked' value='1'/> غيرفعال <input type='radio' name='is_active' value='0'/><br/><br/>
<div style='margin-right:300px'><input  type='submit' name='add_sendway' value='ايجاد' /></div><br/>
</form>
</div>
";


}
?>