Location: PHPKode > projects > HypatiaDB > hypatiadb/favourites.php
<?php

/* HypatiaDB - Easy to use web-based database management system. Written primarily in PHP using  * the MySQL database engine.
 * Copyright (C) 2004 Simon D'Alfonso
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


session_start();
header("Cache-control: private"); // IE 6 Fix. 


 


include_once("common_db.php");
include("menu.php");
include("functions.php");

//The query for the favourite
$query = $_GET['query'];
$db = $_GET['db'];

mysql_connect($host, $username, $password) or die("Couldn't connect to $host");

//Get the current users status
$user_status = get_currentuser_status();

mysql_select_db($db) or die("Couldn't select database $db");

//Strip the $query string of slashes incompatible with MySQL
$query = stripslashes($query);
($result = mysql_query($query)) or die ("$query query Unsuccessful");

?>

<HTML>
<HEAD>
<TITLE>Favourites</TITLE>

<LINK REL=stylesheet TYPE="text/css" HREF="styles.css">

<?php

$file_mnu["New"] = "yes";
$file_mnu["Open"] = "yes";
$file_mnu["Close"] = "yes";
$file_mnu["Print"] = "yes";
$file_mnu["Import"] = "no";
$file_mnu["Export"] = "no";
$file_mnu["Exit"] = "yes";

if($user_status == 'viewer')
{
   $file_mnu["NewDatabase"] = "no";
   $file_mnu["NewTable"] = "no";
}
else
{
   $file_mnu["NewDatabase"] = "yes";
   $file_mnu["NewTable"] = "no";
}

$edit_mnu["Search"] = "no";
$edit_mnu["Advanced_Search"] = "no";
$edit_mnu["Delete_Records"] = "no";
$edit_mnu["Rename_Table"] = "no";
$edit_mnu["Delete_Table"] = "no";
$edit_mnu["Delete_Database"] = "no";

$view_mnu["Favourites"] = "yes";
$view_mnu["Table_Properties"] = "no";
$view_mnu["Form"] = "no";

$queries_mnu["Report"] = "yes"; 
$queries_mnu["Aggregate"] = "yes";

if($user_status == 'viewer')
   $queries_mnu["SQL"] = "no";
else
   $queries_mnu["SQL"] = "yes";


$help_mnu["Help"] = "yes";
$help_mnu["About"] = "yes";


show_menu($file_mnu, $edit_mnu, $view_mnu, $insert_mnu, $queries_mnu, $help_mnu, 
          $db, $table, "no");

print_query_results_func($result);

?>

</BODY>
</HTML>
Return current item: HypatiaDB