<?
/*
 * MySQL Web Interface Version 0.8
 * -------------------------------
 * Developed By SooMin Kim (smkim@popeye.snu.ac.kr)
 * License : GNU Public License (GPL)
 * Homepage : http://popeye.snu.ac.kr/~smkim/mysql
 */

	include_once("anema.inc.php")	;
	
	define('ACTION',	(isset($HTTP_GET_VARS['action'])?$HTTP_GET_VARS['action']:''))	;
	$tablename	= (isset($HTTP_GET_VARS['tablename'])?$HTTP_GET_VARS['tablename']:'')	;
	$pdf_file	= (isset($HTTP_GET_VARS['pdf_file'])?$HTTP_GET_VARS['pdf_file']:'')		;

	define('VIEWSHEMA',	'viewSchema')	;
	define('VIEWDATA',	'viewData')		;
	define('SHEMADB',	'ShemaDB')		;
	define('DUMPTABLE',	'dumpTable')	;
	define('DUMPDB',	'dumpDB')		;

	define('IMG_DATA',	$bdd_titre['data'].'<img align="absmiddle" src="'.HTTP_BDD.'images/data.gif" border="0">') 	;
	define('IMG_DUMP',	$bdd_titre['dump'].'<img align="absmiddle" src="'.HTTP_BDD.'images/dump.gif" border="0">') 	;
	define('IMG_VIDER',	$bdd_titre['clear'].'<img align="absmiddle" src="'.HTTP_BDD.'images/vider.gif" border="0">') 	;	
	define('IMG_PDF',	$bdd_titre['pdf'].'<img align="absmiddle" src="'.HTTP_BDD.'images/pdf.gif" border="0">') 	;		
	define('IMG_SCHEMA',$bdd_titre['schema'].'<img align="absmiddle" src="'.HTTP_BDD.'images/schema.gif" border="0">') ;		

	require_once("bdd.inc.php");
	if ( $pdf_file != '' ) {
		require_once("fpdf.class.php");
	}

	if( ACTION == DUMPTABLE || ACTION == DUMPDB ) {
		dump();
	} else {
		InitPageHtml("BDD",false);
		switch(ACTION) {
		case 'listTables':
						listTables();
						break;
		case VIEWSHEMA :
						viewSchema();
						break;
		case VIEWDATA :
						viewData('');
						break;
		case SHEMADB :
						viewSchemaDB();
						break;
		default : 		listTables();
						break;
		}
	}


?>