Location: PHPKode > projects > AxcotoCart > admin/index.php
<?php
//turn on outpput buffering to cache the output until a $_SESSION start
ob_start();
session_start();
define("VCL",1);

set_magic_quotes_runtime(0);
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
global $starttime,$choice,$context;
global $settings;
global $sBasePath;
global $dbruntime;
$dbruntme=0;
$sBasePath="/vShop/FCkeditor/";
//Lib file
require("../settings.php");
require("../lib/datetime.php");
require("../lib/functions.php");
require("../lib/imglib.php");
require("../lib/dbconnect.php");
//Run file
require("./sources/global.php");
require("./sources/bottom.php");

//With purpose get the time of executing of file, we get the time at this moment-as script start to run,
$starttime=getmicrotime();

$ttfdb=@mysql_connect($db_host,$db_user,$db_pass);
if (!$ttfdb) {
	call_user_func(db_error());
};
mysql_select_db($db_name,$ttfdb);

//get all the setting
call_user_func("readsettingboard");

call_user_func("ttf_main");
function ttf_main(){
	global $settings;
	
	$choice=array(
		"idx" => array("idx","general"),
		"login" => array("loginout","login"),
		"login2" => array("loginout","login2"),
		"logout" => array("loginout","logout"),		
		
		//Item categories
		"mancat" => array("cat","mancat"),		
		"addcat" => array("cat","addcat"),
        "addcat2" => array("cat","addcat2"),		
		"editcat" => array("cat","editcat"),
		"editcat2" => array("cat","editcat2"),
        "editcatA" => array("cat","editcatA"),
		"delcat" => array("cat","delcat"),
		//End Cat

		//Items	
		"additem" => array("items","additem"),
		"additem2" => array("items","additem2"),
		"edititem" => array("items","edititem"),
		"edititem2" => array("items","edititem2"),
		"deleteitem" => array("items","deleteitem"),		
		"manitem" => array("items","manitem"),		
		"rearrange"=> array("item","rearrange"),
		//End items
		
		//News and cat news
		"addnews" => array("news","addnews"),
		"addnews2" => array("news","addnews2"),
		"addnewscat" => array("news","addcat"),
		"addnewscat2" => array("news","addcat2"),
		"mannewscat" => array("news","mancat"),
		"delnewscat" => array("news","delcat"),
		"editnewscat" => array("news","editcat"),
		"mannews" => array("news","mannews"),
		"editnews" => array("news","editnews"),
		"editnews2" => array("news","editnews2"),
		"deletenews" => array("news","deletenews"),
		//End news
				
		//Poll
		"addpoll" => array("poll","addpoll"),
		"addpoll2" => array("poll","addpoll2"),
		"manpoll" => array("poll","manpoll"),
		"activepoll" => array("poll","actipoll"),
		"deactivepoll" => array("poll","deacpoll"),
		"editpoll" => array("poll","editpoll"),
		"editpoll2" => array("poll","editpoll2"),
		"delpoll" => array("poll","delpoll"),
		//End poll		

		//Page and block
		"manpage" => array("page","manpage"),
		"addpage" => array("page","addpage"),
		"addpage2" => array("page","addpage2"),
		"editpage" => array("page","editpage"),
		"editpage2" => array("page","editpage2"),
		"delpage" => array("page","delpage"),
		"manblock" => array("page","manblock"),
		"addblock" => array("page","addblock"),
		"addblock2" => array("page","addblock2"),
		"editblock" => array("page","editblock"),
		"editblock2" => array("page","editblock2"),
		"delblock" => array("page","delblock"),
		//End page and block
		
		//Help
		"manhelp" => array("help","manhelp"),
		"addhelp" => array("help","addhelp"),
		"addhelp2" => array("help","addhelp2"),
		"edithelp" => array("help","edithelp"),
		"edithelp2" => array("help","edithelp2"),
		"delhelp" => array("help","delhelp"),
		//End help	

		//Download
		"manfiles" => array("downloads","mancat"),
		"addfcat" => array("downloads","addfcat"),
		"addfcat2" => array("downloads","addfcat2"),
		"editfcat" => array("downloads","editfcat"),
		"editfcat2" => array("downloads","editfcat2"),
		"delfcat" => array("downloads","delfcat"),
		//File	
		"addfile" => array("downloads","addfile"),
		"addfile2" => array("downloads","addfile2"),
		"editfile" => array("downloads","editfile"),
		"delfile" => array("downloads","delfile"),
		//End Download
			
		//galley
		"mangcat" => array("gallery","mancat"),
		"addgcat" => array("gallery","addcat"),		
		"addgcat2" => array("gallery","addcat2"),
		"editgcat" => array("gallery","editcat"),
		"editgcat2" => array("gallery","editcat2"),
		"delgcat" => array("gallery","delfcat"),
		//Pictures	
		"addpicture" => array("gallery","addimg"),
		"addpicture2" => array("gallery","addimg2"),
		"editpicture" => array("gallery","editimg"),
		"delpicture" => array("gallery","delimg"),
		//End gallery
					
		//Foreign
		"addcurrency" => array("foreign","addCurrency"),
		"addcurrency2" => array("foreign","addcurrency2"),
		"editcurrency" => array("foreign","editcurrency"),
		"editcurrency2" => array("foreign","editcurrency2"),
		"delcurrency" => array("foreign","delcurrency"),
		"mancurrency" => array("foreign","mancurrencies"),		
		//End foreign

		//Advertisement
		"manlogo" => array("ads","manlogo"),
		"addbanner" => array("ads","addbanner"),
		"addbanner2" => array("ads","addbanner2"),
		"editbanner" => array("ads","editbanner"),
		"delbanner" => array("ads","delbanner"),
		//End advertisement

		//book list
		"booklist" => array("book","bookList"),
		"viewbook" => array("book","viewbook"),
		"finishbook" => array("book","finished"),
		"delbook" => array("book","delbook"),
		//end booklist
		
		//members
		"manmem" => array("members","manmem"),
		"viewmem" => array("members","viewmem"),
		"addmem" => array("members","addmem"),
		"addmem2" => array("members","addmem2"),
		"delmem" => array("members","delmem"),
		"editmem" => array("members","editmem"),
		"editmem2" => array("members","editmem2"),
		//End members
	);
	
	$act=isset($_GET["act"])? $_GET['act']:$act="idx";
	
	if (!isset($choice[$act])) {
		//The act isn't same as any element, so, the execute will be stop to anti hack
		exit;
	};
	
	//neu chua dang nhap va ko phai dang o trang xu ly dang nhap thi se chuyen ve trangg dang nhap
	if (!checklogin() && $act!="login2") {
		$act="login";
	};	
	
	//include file match with action just use
	require("./sources/" . $choice[$act][0].".php");
	
	//Header template
	call_user_func("themedisplayheader",'sa');
	//Goi am thuc su xu ly ung voi moi action
	call_user_func($choice[$act][1]);
	
	//Called ajax! So, we will not load bottom Templates
	if (!isset($_GET['ajax']) || $_GET['ajax']!=1) {
		call_user_func("bottom");
	};
};
?>
Return current item: AxcotoCart