<?php

if(stripos($_SERVER['SCRIPT_NAME'],"/admin/")===false?false:true){
	include_once("../connect.php");
	include_once("../session.php");
}else{
	include_once("connect.php");
	include_once("session.php");
}

$function = $_REQUEST['f'];
if($function == "saveBanner"){
   (saveBanner($_REQUEST['file']));
	
	
}

function saveBanner($filename){
	//var_dump(scandir("../img/banner/"));
	//var_dump(file_exists("../img/banner/" . $filename));
	if(rename("../img/banner/" . $filename, "../img/banner.jpg")){
		echo "true";
		return true;
	}else{
		echo "false";
		return false;
	}
	
}

?>