File: D:/HostingSpaces/SBogers45/smuldersinterieurprojecten.nl/wwwroot/admin/index.php
<?php
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/config/komma_fix.php';
//Include needed php-files
require_once './php/connect.php';
require_once './php/functions.php';
require_once './php/structure.php';
require_once './php/form.php';
require_once './php/formArrays.php';
require_once './php/getSmallLibraries.php';
// Choose language & get text
$lang = getLang();
require_once './lang/'.$lang.'Strings.php';
//get text
$siteText = getSiteText();
//backup ($db_name is set in connect.php)
autoBackUpDB(DB);
//Dynamic client information
$result = mysql_query('SELECT name, label, logo, website FROM _client LIMIT 1');
$record = mysql_fetch_assoc($result);
$clienName = $record['name'];
$clientLabel = $record['label'];
$clientLogo = $record['logo'];
$clientWebsite = $record['website'];
if(substr($clientWebsite, 0, 7) != 'http://'){
$clientWebsite = 'http://'.$clientWebsite;
}
//create variables
$contentOutput = '';
//check if admin is logged in, else header to the login screen
if(checkLogin() == 1){
//get globale structure
$headerOutput = getAdminHeader();
$menuOutput = getAdminMainMenu();
$footerOutput = getAdminFooter();
//Log out listener
if(isset($_GET['page'])){
if($_GET['page'] == 'logout'){
session_destroy();
header("Location: ../");
}
}
/******* C O N T E N T O U T P U T ******/
//Check which content we need to load.
if(isset($_GET['page'])){
$page = $_GET['page'];
//Some pages which are always used
# password
# home
# pages
# libraries
# trash
if($page == 'password'){
include './php/changePass.php';
$contentOutput .= setChangePass();
}
else if($page == 'home'){
//welcome page
include './php/getWelcomePage.php';
$contentOutput .= getWelcomePage();
}
else if($page == 'pages'){
//welcome page
include './php/getPagesPage.php';
$contentOutput .= getPagesPage();
}
else if($page == 'media'){
//welcome page
include './php/getLibrariesPage.php';
$contentOutput .= getLibrariesPage();
}
else if($page == 'documents'){
//welcome page
include './php/getLibrariesPage.php';
$contentOutput .= getLibrariesPage();
}
else if($page == 'profile'){
//welcome page
include './php/getProfilePage.php';
$contentOutput .= getProfilePage();
}
else if($page == 'trash'){
include './php/trash.php';
$contentOutput .= getTrash();
}
else if($page == 'about' || $page == 'help' || $page == 'contact'){
include './php/getAboutHelpContact.php';
$contentOutput .= getAboutHelpContact();
}
}
else{
//welcome page
include './php/getWelcomePage.php';
$contentOutput .= getWelcomePage();
}
}
else{
//else show the loginform
include './php/getLoginPage.php';
$contentOutput .= getLoginPage();
}
/******* T O T A L O U T P U T ******/
$totalOutput = '';
$totalOutput .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$totalOutput .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$totalOutput .= '<head>';
$totalOutput .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
//base
//$totalOutput .= '<base href="http://localhost:8888/mikeontwerpt/dev/admin/" />';
$totalOutput .= '<base href="http://' . $_SERVER['HTTP_HOST'] . '/admin/" />';
//css
$totalOutput .= '<link href="./css/admin.css" rel="stylesheet" type="text/css" />';
//jquery
$totalOutput .= '<script type="text/javascript" src="./js/jquery-1.7.js"></script>';
$totalOutput .= '<script type="text/javascript" src="./js/jquery-ui-1.8.16.custom.min.js"></script>';
//ckeditor
$totalOutput .= '<script type="text/javascript" src="./ckeditor/ckeditor.js"></script>';
$totalOutput .= '<script type="text/javascript" src="./ckeditor/adapters/jquery.js"></script>';
$totalOutput .= '<script type="text/javascript" src="./js/functions.js"></script>';
$totalOutput .= '<script type="text/javascript" src="./js/browsercheck.js"></script>';
//main js
$totalOutput .= '<script type="text/javascript" src="./js/main.js"></script>';
//Dynamic title
$totalOutput .= '<title>'.$clientLabel.' - Content Management System</title>';
$totalOutput .= '</head>';
$totalOutput .= '<body>';
$totalOutput .= '<div id="main-container" class="center">';
if(checkLogin() == 1) $totalOutput .= $headerOutput;
if(checkLogin() == 1) $totalOutput .= $menuOutput;
if(checkLogin() == 1) $totalOutput .= '<div id="main-content-container">';
$totalOutput .= $contentOutput;
if(checkLogin() == 1) $totalOutput .= '</div>';
if(checkLogin() == 1) $totalOutput .= $footerOutput;
// $totalOutput .= '<form action="" method="get"><input type="submit" name="logout" value="Sign Out" /></form>';
$totalOutput .= '<div class="clear"></div>';
$totalOutput .= '</div>';
$totalOutput .= '<div id="jsbox"></div>';
$totalOutput .= '</body>';
$totalOutput .= '</html>';
echo $totalOutput;