###################################################################
# Coded by: Viescripts Web Programming Services
# Contact Us: support@viescripts.com
###################################################################
//check if script was accessed throught local server
function check_access()
{
if (!eregi("index.php", $PHP_SELF))
{
die ("You can't access this file directly...");
exit;
}
}
// error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
// print ini_get('display_errors');
// ini_set('display_errors',1);
//get template file
function get_template($tpl){
$template = "templates/$tpl.html";
if(file_exists($template)){
$t_array = file($template);
$t_string = '';
foreach($t_array as $str){
$t_string .= $str;
}
return $t_string;
}
else{
echo "ERROR: Cann't load template $tpl.html.";
exit;
}
}
include_once "connect.php";
//include_once "member.php";
include_once "admin.php";
include_once "authorizenet.class.php";
$sid = isset($_GET["sid"]) ? $_GET["sid"] : '';
$sidU = '&sid='.$sid;
if(isset($sid) && strlen($sid) > 0){
session_id($sid);
session_start();
}
//pages with no header/footer/menu
$excludelist = array('cimpayments', 'cimreport');
//header
ob_start();
if(!in_array($action, $excludelist))
eval("?>".get_template("header")."");
//menu
//if(!in_array($action, $excludelist))
if(!empty($_SESSION['psk']) && !in_array($action, $excludelist))
eval("?>".get_template("menu")."");
switch($action){
case 'accounts':
include "sessionsecure.php";
include "accounts.php";
break;
case 'buttons':
include "sessionsecure.php";
include "buttons.php";
break;
case 'cimpayments':
include "sessionsecure.php";
include "cimpayments.php";
break;
case 'cimedit':
include "sessionsecure.php";
include "cimedit.php";
break;
case 'cimreport':
include "sessionsecure.php";
include "cimreport.php";
break;
case 'config':
include "sessionsecure.php";
include "config.php";
break;
case 'genericemails':
include "sessionsecure.php";
include "genericemails.php";
break;
case 'groups':
include "sessionsecure.php";
include "groups.php";
break;
case 'login':
include "login.php";
break;
case 'logout':
include "sessionsecure.php";
include "logout.php";
break;
case 'main':
include "sessionsecure.php";
include "main.php";
break;
case 'manage':
include "sessionsecure.php";
include "manage.php";
break;
case 'products':
include "sessionsecure.php";
include "products.php";
break;
case 'refunds':
include "sessionsecure.php";
include "refunds.php";
break;
case 'viewrefund':
include "sessionsecure.php";
include "viewrefund.php";
break;
default:
header("Location: index.php?action=logout");
exit;
}
//footer
if(!in_array($action, $excludelist))
eval("?>".get_template("footer")."");
ob_end_flush();
exit;
?>