<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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


if(isset($_POST['edit'])){
$id=$_POST['id'];
$title_page =@$_POST['title_page'];
$des_page =@$_POST['des_page'];
$query = mysql_query("UPDATE `fireshop_static` SET `title`='$title_page',`des`='$des_page'  WHERE id='$id' LIMIT 1");
if($query){print('<div class="contact_active">صفحه با موفقيت ويرايش شد</div><br/><br/>');}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');}


}else{

$id=$_POST['id'];
$datasql = $db->sql_query("SELECT * FROM fireshop_static WHERE `id`='3'") or die(mysql_error());
$mydata = $db->sql_fetchrow($datasql);
$static_id  	= $mydata['id'];
$static_title  	= $mydata['title'];
$static_des  	= $mydata['des'];

echo"


<div style='padding:10px'  align='center' >
<form action='admin.php?do=darbare' method='post'>
<table width='100%' dir='rtl' cellpadding='0' cellspacing='0'><tr><td>
عنوان : <input type='text' size='30' name='title_page' value='$static_title' /><br/>
متن : <br/><br/>";

wysiwyg_textarea('des_page', "$static_des", 'FireShopAdmin', 50, 15);

echo"<br/></td>
</tr></table><div align='left' style='margin-left:20px;'><input  type='hidden' size='50' name='id'  value='$static_id'/>
<input  type='submit' name='edit' value='ويرايش صفحه'/>&nbsp;&nbsp;&nbsp;
<button onclick='javascript:history.go(-1)' class='button'>بازگشت</button>
</div></form></div>";

}


?>