<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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

if(isset($_POST['send_news'])){if(empty($_POST['title_news'])or empty($_POST['des_news']))
{echo"پر كردن همه ي فيلد ها الزامي است";}else{
$title_news =$_POST['title_news'];$des_news =$_POST['des_news'];
include("includes/jdate.php");$today = jdate(" d /m /13y");$dater = $today;$time_stamp= time();
$query = $db->sql_query("INSERT INTO fireshop_news (`title`, `des`, `date`, `time_stamp`) VALUES ('$title_news', '$des_news', '$dater', '$time_stamp')");if($query){print('<div class="contact_active">خبر با موفقيت ارسال گرديد</div>');}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');}}}else{echo"


<div style='padding:10px'  align='center' >
<form action='admin.php?do=send_news' method='post'>
<table width='100%' dir='rtl' cellpadding='0' cellspacing='0'>
<tr><td>
عنوان : <input type='text' size='30' name='title_news' /><br/><br/>
متن خبر : 
<br/><br/>
";
wysiwyg_textarea('des_news', '', 'FireShopAdmin', 50, 15);

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

?>