<?php

/* FIRESHOP: Advanced Content Market System                         */

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

/*                                                                      */

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

/* http://Firedesign.ir                                                   */

/*                                                                      */

/* This program is free software.  */

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

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

@session_start();



include("admin/module/product/component/controller/upload_tpl.php");

function Upload(){
if(isset($_SESSION['LogedIn_fireshop_ADMIN']))
{
if(@$_SESSION['LogedIn_fireshop_ADMIN'] == true)
{
if(isset($_POST['upload'])){
$path="img/upload/".$_FILES['up']['name'];
 $ext = substr($path, strrpos($path,'.'), 5);
if (($ext==".PHP") OR ($ext==".EXE") OR ($ext==".PL") OR ($ext==".CGI") OR ($ext==".ASP") OR ($ext==".ASPX") OR ($ext==".TXT") OR ($ext==".EXE") OR ($ext==".COM") OR ($ext==".BAT")  OR ($ext==".php") OR ($ext==".exe") OR ($ext==".pl") OR ($ext==".cgi") OR ($ext==".asp") OR ($ext==".aspx") OR ($ext==".txt") OR ($ext==".exe") OR ($ext==".com") OR ($ext==".bat") OR ($ext==".php3")OR ($ext==".html")OR ($ext==".htm")OR ($ext==".HTML")OR ($ext==".HTM")OR ($ext==".mht")OR ($ext==".MHT") OR ($ext==".php4")OR ($ext==".PHP3") OR ($ext==".PHP4") OR ($ext==".PHP5")OR ($ext==".PHP6") OR ($ext==".PHP2") OR ($ext==".php6")OR ($ext==".php5")OR ($ext==".php2")) {echo"فايل غير مجاز است";}else{

if(!empty($_FILES['up']['name'])){
if(copy($_FILES['up']['tmp_name'],$path)){
echo "فايل شما آپلود شد<br>";
echo "اسم :".$_FILES['up']['name']. "<br>";
echo "نوع :".$_FILES['up']['type']. "<br>";
echo "حجم :".$_FILES['up']['size']. "<br>";
echo "<img src='$path' width=173 height=101 ><br>";
echo"لينك تصوير : <input type='text' value='$path' /> لطفا اين لينك كپي كنيد";
}
}else{
die("يك فايل انتخاب كنيد");
}
}
}else{

echo"<html dir=rtl>
<form action=upload.php method='post' enctype='multipart/form-data'>
<input type=file name=up><br>
<input type=submit name='upload' value=UPLOAD>
</form>
</html>
";
}


}
}else{

echo"لطفا وارد پنل مديريت شويد شما لاگين نكرده ايد";
}
}


?>