Location: PHPKode > projects > ChiCoMaS - Chilek CMS > chicomas/install/index.php
<?
// Direct access variable
define( "_VALID_DA_", 1 );
define("CONFIGFILE","../config.inc");
define("VERSIONFILE","../version.inc");

session_start();

if(is_file(VERSIONFILE)) require (VERSIONFILE);
if(is_file("functions.php")) require ("functions.php");
if(is_file("install_operation.php")) require ("install_operation.php");

//PrintSessionVar();

//Init Page Load Timer
t_pagetime("init");

if (!isset($lang)){
	$lang="en";
	$defaultlanguage="en";
}

SetLanguage();

if (!isset($action))
	$action="0";

$request = $_REQUEST;

Run_Script($request);


function Begin_Script($operation, $step){

	$content = "

	<html>
	<head>
	<title>"._CMN_CILEKCMS_._CMN_DASH_._CMN_IRB_TOOLS_."</title>
	<style type=\"text/css\">
      @import \"./style.css\";
	</style>

	<body>
	<center>
	
	<a href=\"".basename($PHP_SELF)."?lang=en\">
		<img class=\"flags\" src=\"../images/flags/english.jpg\" alt=\"English\" width=25 height=15 border=0>
	</a>

	<a href=\"".basename($PHP_SELF)."?lang=tr\">
		<img class=\"flags\" src=\"../images/flags/turkce.jpg\" alt=\"Trk�\" width=25 height=15 border=0>
	</a>

	<div id=\"navcontainer\">
	<ul id=\"navlist\">";

	if (!isset($step))
		$step="0";

	switch ($operation){
	default:
	case 'install':
		if ($step=="0")
			$content .= "<li id=\"active\"><a href=\"".basename($PHP_SELF)."?operation=install\" id=\"current\">"._CMN_INSTALL_."</a></li>";
		else
			$content .= "<li><a href=\"".basename($PHP_SELF)."?operation=install\">"._CMN_INSTALL_."</a></li>";
	
		if ($step=="1")
			$content .= "<li id=\"active\"><a href=\"".basename($PHP_SELF)."?operation=install&step=1\" id=\"current\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_1_."</a></li>";
		else
			$content .= "<li><a href=\"".basename($PHP_SELF)."?operation=install&step=1\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_1_."</a></li>";
	
		if ($step=="2")
			$content .= "<li id=\"active\"><a href=\"".basename($PHP_SELF)."?operation=install&step=2\" id=\"current\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_2_."</a></li>";
		else
			$content .= "<li><a href=\"".basename($PHP_SELF)."?operation=install&step=2\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_2_."</a></li>";

		if ($step=="3")
			$content .= "<li id=\"active\"><a href=\"".basename($PHP_SELF)."?operation=install&step=3\" id=\"current\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_3_."</a></li>";
		else
			$content .= "<li><a href=\"".basename($PHP_SELF)."?operation=install&step=3\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_3_."</a></li>";

		if ($step=="4")
			$content .= "<li id=\"active\"><a href=\"".basename($PHP_SELF)."?operation=install&step=4\" id=\"current\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_4_."</a></li>";
		else
			$content .= "<li><a href=\"".basename($PHP_SELF)."?operation=install&step=4\">"._CMN_INSTALL_._CMN_DASH_._CMN_STEP_4_."</a></li>";
	break;
	case 'repair':
	break;
	case 'backup':
	break;
	}
	
	$content .= "
	</ul>
	</div>";

	return $content;

};

function End_Script(){
	$content = "
	<hr><font size=\"-2\">"._CMN_TOTAL_TIME_.t_pagetime("print")."</font><hr>
	<center>
	</body>
	</html>";

	return $content;

};


function Repair_Operation($request){

	$step = $request['step'];

	if (!isset($step))
		$step="0";

	switch ($step){
	default:
	case '0':
		echo "step 0<br>";
	break;
	case '1':
		echo "step 1<br>";
	break;
	case '2':
		echo "step 2<br>";
	break;
	}

	$content = "
	<h3>Repair</h3>
	";

	return $content;

};

function Backup_Operation($request){

	$step = $request['step'];

	if (!isset($step))
		$step="0";

	switch ($step){
	default:
	case '0':
		echo "step 0<br>";
	break;
	case '1':
		echo "step 1<br>";
	break;
	case '2':
		echo "step 2<br>";
	break;
	}

	$content = "
	<h3>Backup</h3>
	";

	return $content;

};

function Run_Script($request){

	$operation = $request['operation'];
	$step = $request['step'];
	$install_ok = $request['install_ok'];

	if (!isset($operation))
		$operation="install";

	if ($operation=="install")
		if ($install_ok!=1){
			$request['step'] = 0;
			$step = 0;
		}

	$content = Begin_Script($operation, $step);

	switch ($operation){
	default:
	case 'install':
		$content .= Install_Operation($request);
	break;
	case 'repair':
		$content .= Repair_Operation($request);
	break;
	case 'backup':
		$content .= Backup_Operation($request);
	break;
	}

	$content .= End_Script();

	echo $content;

}
?>
Return current item: ChiCoMaS - Chilek CMS