<?php
include_once 'Auth_simple/Session.php';
include_once 'Auth_simple/Auth_Simple.php';
$sessionOBJ = new Session();
if($sessionOBJ->__isLoggedIn() == false){
//$sessionOBJ->__logout();
header('Location: login.php');
exit();
}else{
if($_GET['reset']== 'yes'){
Auth_Simple::__resetAuth();
$sessionOBJ->__logout();
header('Location: login.php');
}
if($_GET['logout']== 'yes'){
$sessionOBJ->__logout();
header('Location: login.php');
}
}
include_once 'bootstrap.php';
$theme = "default";
$index .= $_SERVER['PHP_SELF']."?action=dbmanager&";
$root = $index ;
$function = $_REQUEST['function'];
$version = "Katropine DBmanager 1.5";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $version;?> - www.katropine.com</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link href="theme/<?php echo $theme;?>/css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ChnageAuthAlert(){
if(confirm('This will delete the user name and password. \n You will need to register.')){
window.location = '<?php echo $root;?>reset=yes';
}
}
</script>
</head>
<body>
<div id="wrapper">
<center>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" id="tbl_global">
<tr>
<td id="header"><span id="headerleft"><span style="left:2px; top:2px; position:absolute; font-size:9px;"><?php echo $version;?></span></span><span id="headerright"></span></td>
</tr>
<tr>
<td valign="top" width="100%" align="left" class="default" id="headunderline">
<br/>
<?php if(File::__file_exists($config_path)):?>
<?php if($dbconnect_status === true):?>
<?php if(version_compare(PHP_VERSION, '5.0.0', '>') && version_compare($db->server_info, '5.0.0', '>') ):?>
<input type="button" value="Show Tables" class="bigbutton" onclick="javascript:window.location = '<?php echo $root;?>'" />
<input type="button" value="Export Data Base" class="bigbutton" onclick="javascript:window.location = '<?php echo $root;?>function=export'" />
<input type="button" value="SQL" class="bigbutton" onclick="javascript:window.location = '<?php echo $root;?>function=sql'" />
<input style="float:right;" type="button" value="Log out" class="button" onclick="javascript:window.location = '<?php echo $root;?>logout=yes'" />
<input style="float:right;" type="button" value="Change DB" alt="Change Database Params" class="button" onclick="javascript:window.location = '<?php echo $root;?>function=config'" />
<input style="float:right;" type="button" value="Change Auth" alt="Change username and password" class="button" onclick="javascript:ChnageAuthAlert()" />
<br /><br />
<?php
switch ($function){
case 'export': include('export.php'); break;
case 'textarea': include('textarea.php'); break;
case 'sql': include('sql.php'); break;
case 'sqlresult': include('sqlresult.php'); break;
case 'config': include('setconfig.php'); break;
default: include('list.php');
}
?>
<?php else: ?>
<?php include_once 'sysreq.php';?>
<?php endif;?>
<?php else: ?>
<h1><?php echo $dbconnect_status;?></h1>
<?php include_once 'setconfig.php';?>
<?php endif;?>
<?php else: ?>
<?php include_once 'setconfig.php';?>
<?php endif;?>
</td>
</tr>
</table>
</center>
<div id="push"></div>
</div>
<div id="footer">
<div style="padding-top:18px;">© Copyright <?php echo date("Y");?> <a href="http://www.katropine.com">Katropine.com</a>. All Rights Reserved.</div>
</div>
</body>
</html>