<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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


if(isset($_POST['edit_help']))

{if(empty($_POST['des']))
{echo"پر كردن همه ي فيلد ها الزامي است";

}else{
$id=$_POST['id'];
$des =$_POST['des'];

$query = $db->sql_query("UPDATE `fireshop_help_order` SET `des`='$des' WHERE id='$id' LIMIT 1");
if($query){print('<div class="contact_active">متن با موفقيت ويرايش گرديد</div>');}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');}}

}else{


$query = $db->sql_query("SELECT * FROM `fireshop_help_order` WHERE id='1'");
$row=$db->sql_fetchrow($query);
$des = $row['des'];
$id="1";
echo"

<div style='padding:10px'  align='center' >
<form action='admin.php?do=edit_buy_help' method='post'>
<table width='100%' dir='rtl' cellpadding='0' cellspacing='0'>
<tr>
<td>
متن راهنماي خريد :<br/><br/>
<input type='hidden' size='30' name='id' value='$id'/>
<br/>";

wysiwyg_textarea('des', "$des", 'FireShopAdmin', 50, 15);

echo"<br/></td></tr></table>
<div align='left' style='margin-left:20px;'><input  type='submit' name='edit_help' value='ويرايش'/>&nbsp;&nbsp;&nbsp;
<button onclick='javascript:history.go(-1)' class='button'>بازگشت</button></div></form></div></BODY>";}

?>