<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

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



if(isset($_POST['send_new_admin'])){

if(empty($_POST['new_user_admin'])
or empty($_POST['new_pass_admin'])
or empty($_POST['new_mail_admin'])
)
{
echo" پر كردن همه ي فيلد ها الزامي است <a href='javascript:history.go(-1)'>بازگشت</a>";
}else{

$new_user_admin =@$_POST['new_user_admin'];
$new_pass_admin =@$_POST['new_pass_admin'];
$new_mail_admin =@$_POST['new_mail_admin'];

$query = $db->sql_query("UPDATE `fireshop_admin` SET `username`='$new_user_admin',`password`='$new_pass_admin',`email`='$new_mail_admin' WHERE `id`='1' LIMIT 1");
if($query){
print('<div class="contact_active"> تغييرات با موفقيت اعمال شد</div>');

}else{
print('<div class="failed"><div class="MsgBody">خطا</div></div>');
}
}
}else{
echo"
<div align='right' style='padding:10px'>

<form action='admin.php?do=edit_admin' method='post'>

<div style='float:right;width:110px' for=\"name\">نام كاربري جديد  : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name='new_user_admin' size='30' style='height: 18px' /></div><div class='clear'></div><br/>
<div style='float:right;width:110px' for=\"name\">رمز عبور جديد  : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name='new_pass_admin' size='30' style='height: 18px' /></div><div class='clear'></div><br/>
<div style='float:right;width:110px' for=\"name\">ايميل  : <span style='color: red'>*</span></div>
<div style='float:right;'><input type='text' name='new_mail_admin' size='30' style='height: 18px' /></div><div class='clear'></div><br/>
<input type='submit' name='send_new_admin' value='بروز رساني' />
</form></div>
";

}




?>