<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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

if(isset($_POST['send_st_page'])){if(empty($_POST['title_page'])or empty($_POST['des_page'])){
echo"پر كردن همه ي فيلد ها الزامي است";}else{$title_page =@$_POST['title_page'];$des_page =@$_POST['des_page'];
include("includes/jdate.php");$today = jdate(" d /m /13y");$dater = $today;$time_stamp= time();
$query = $db->sql_query("INSERT INTO fireshop_static (`title`, `des`, `date`, `time_stamp`) VALUES ('$title_page','$des_page','$dater','$time_stamp')");if($query){print('<div class="contact_active">صفحه با موفقيت ايجاد شد</div><br/><br/>');
$data = $db->sql_query("SELECT * FROM fireshop_static WHERE `title`='$title_page' ") or die(mysql_error());
$resdata = $db->sql_fetchrow($data); $page_id = $resdata['id'];
echo"لينك مستقيم صفحه : <a href='static.php?id=$page_id'>static.php?id=$page_id</a>";}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');}}}else{echo"


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

wysiwyg_textarea('des_page', '', 'FireShopAdmin', 50, 15);

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