Location: PHPKode > projects > GeekDDB > geekddb/admin/index.php
<?php

// +---------------------------------------------------------------------------+
// | Universal Geeklog Plugin 1.0                                              |
// +---------------------------------------------------------------------------+
// | admin/index.php                                                           |
// | Administration page.                                                      |
// |                                                                           |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2002 by the following authors:                              |
// |                                                                           |
// | Author:                                                                   |
// | Constructed with the Universal Plugin                                     |
// | Copyright (C) 2002 by the following authors:                              |
// | Tom Willett                 -    hide@address.com           |
// | Blaine Lang                 -    hide@address.com                    |
// | The Universal Plugin is based on prior work by:                           |
// | Tony Bibbs                  -    hide@address.com                       |
// +---------------------------------------------------------------------------+
// | Replace all geekddb with the name of your plugin and you have a skeletal |
// | admin page.                                                               |
// +---------------------------------------------------------------------------+
// |                                                                           |
// | 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.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//

require_once('lib-common.php');


// Only let admin users access this page
if (!SEC_hasRights('geekddb.admin')) {
    // Someone is trying to illegally access this page
    COM_errorLog("Someone has tried to illegally access the geekddb Admin page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: $REMOTE_ADDR",1);
    $display = COM_siteHeader();
    $display .= COM_startBlock($LANG_DB00['access_denied']);
    $display .= $LANG_DB00['access_denied_msg'];
    $display .= COM_endBlock();
    $display .= COM_siteFooter(true);
    echo $display;
    exit;
}
 
/**
* Main 
*/

$display = COM_siteHeader();
$T = new Template($_CONF['path'] . 'plugins/geekddb/templates');
$T->set_file('admin', 'admin.thtml');
$T->set_var('site_url',$_CONF['site_url']);
$T->set_var('site_admin_url', $_CONF['site_admin_url']);
$T->set_var('header', $LANG_DB00['admin']);
$T->set_var('plugin','geekddb');

// include config, functions, common, check_table and header
include ($_CONF['path'] . 'plugins/geekddb/config.php');
include ($_CONF['path'] . 'plugins/geekddb/functions.php');
include ($_CONF['path'] . 'plugins/geekddb/common.php');
//include ($_CONF['path'] . 'plugins/geekddb/templates/header_admin.php');

$complete_tables_names_ar = build_tables_names_array($db_name, 1, 0, 0);


?>



<p><font size="+1">Manage the list of tables of the <font color="#FF0000">

<?php echo $db_name; ?></font> database you want to use in DaDaBIK</font></p>

<table border="0" cellpadding="6" width="100%">
<tr bgcolor="#F0F0F0">
<td>
<p><font color="#ff0000"><b>Here is the list of the tables present in your database:</b>
</font>
<br>You can edit the permissions here<br>
<br>

<?php

$manageables_tables_names_ar = build_tables_names_array($db_name, 1, 0, 1);


for ($i=0; $i<count($manageables_tables_names_ar); $i++)
{
	echo $complete_tables_names_ar[$i].
	"&nbsp;<a href=\"./configure.php?function=edittable&table_name=". 
	$complete_tables_names_ar[$i].
	"\">Set Permissions</a>" .
	
	
	
	"&nbsp;&nbsp;<a href=\"./internal_table_manager.php?table_name=". 
	$complete_tables_names_ar[$i].
	"\">Configure</a>" .
	
	"&nbsp;&nbsp;<a href=\"./internal_table_manager.php?table_name=". 
	$complete_tables_names_ar[$i].
	"\">Manage/Update</a>
	
	
	
	
	
	<br>";

} // end for
?>

</table>



<table border="0" cellpadding="6" width="100%">
<tr bgcolor="#F0F0F0">
<td>
<p><font color="#ff0000">
<b>Here is the list of the tables present in your database:</b></font>
<br>Click Install to install each table and add it to the above list.
<br>If you install an already present table, you'll overwrite its configuration.
<br><br>
<?php
for ($i=0; $i<count($complete_tables_names_ar); $i++)
{
	echo $complete_tables_names_ar[$i].
	"&nbsp;<a href=\"install_db.php?table_name=".
	urlencode($complete_tables_names_ar[$i]).
	"\">Install</a><br>";

} // end for
?>
</table>


<?


// $T->parse('output','admin');
// $display .= $T->finish($T->get_var('output'));
$display = COM_siteFooter(true);

echo $display;
echo "<pre>" ; 
print_r($_REQUEST) ; 
?>
Return current item: GeekDDB