<?
require_once('../include/user.php');
require_once('../include/authenticate.php');
require_once('../include/mysql.php');
require_once('../include/functions.php');
require_once('../include/fb.php');

ob_start();

session_start();

$_SESSION['panel_view_url'] = $_SERVER['REQUEST_URI'];

// SETUP MYSQL HANDLERS
$mysqldb1 = new mysql($host, $user, $pswd, $db);
$mysqldb1->connect();
$mysqldb1->select();
$mysqldb2 = new mysql($host, $user, $pswd, $db);
$mysqldb2->connect();
$mysqldb2->select();

// SETUP GENERAL VARIABLES
$url = $_SERVER['REQUEST_URI'];
$date = date('Y-m-d H:i:s', time());
$error = $_GET['error'];
$log = '';

?>
<!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>
        <title><? print ucfirst($_GET['table']); ?> Manager</title>
        <meta name="robots" content="noindex, nofollow, noarchive" />
        <meta http-equiv="pragma" content="no-cache" />
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <!--STYLES-->
        <link type="text/css" rel="stylesheet" href="../styles/default/table.css"/>
        <!--/STYLES-->
        <!--JQUERY-->
        <link type="text/css" rel="stylesheet" href="../styles/smoothness/jquery.ui.css"/>
        <script type="text/javascript" src="../scripts/jquery.js"></script>
        <script type="text/javascript" src="../scripts/jquery.ui.js"></script>
        <script type="text/javascript" src="../scripts/jquery.imgpreview.js"></script>
        <!--/JQUERY-->
        <!--UPLOADIFY-->
        <link rel="stylesheet" href="../uploadify/uploadify/uploadify.css" type="text/css" />
        <link rel="stylesheet" href="../uploadify/css/uploadify.jGrowl.css" type="text/css" />
        <script type="text/javascript" src="../uploadify/js/jquery.uploadify.js"></script>
        <script type="text/javascript" src="../uploadify/js/jquery.jgrowl_minimized.js"></script>
        <!--/UPLOADIFY-->
        <!--TINYMCE-->
        <script type="text/javascript" src="../scripts/tiny_mce/jquery.tinymce.js"></script>
        <!--/TINYMCE-->
        <!--CUSTOM-->
        <script type="text/javascript" src="../scripts/jquery.cookie.js"></script>
        <script type="text/javascript" src="../scripts/php.js"></script>
        <script type="text/javascript" src="../scripts/custom.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {

                $("#tabs").tabs( { cookie: { expires: 30 } } );

<?
if ($_GET['table'] != '') {
    ?>
            fetchRecords('<? print $_GET['table']; ?>');
    <?
}
?>

        });
        </script>
        <!--/CUSTOM-->
    </head>
    <body>
        <div id="tabs" class="ui-tabs">
            <ul>
                <li><a href="#tabs-1"><? print ucfirst($_GET['table']); ?> Manager</a></li>
            </ul>
            <!--MENU BUILDER-->
            <div id="tabs-1" class="ui-tabs-hide">
                <div id="records"></div>
            </div>
            <!--/MENU BUILDER-->
        </div>
        <? require_once("../panel/dialog.php"); ?>
    </body>
</html>
<?
$mysqldb1->close();
$mysqldb2->close();
?>