Location: PHPKode > projects > SQLite PHP Admin > spa/leftframe.php
<?php
/***********************************************************************

		Copyright (c) 2011, Andrew V. Pleshakov	(hide@address.com)
		All rights reserved.

		This file is part of SPA (SQLite PHP Admin)
		See file LICENSE.txt for details

************************************************************************/

require_once('include.php');

$tar['dbases'] = db_selector($current_db);
$tar['tables'] = '';

if ($pla_db && ($pla_db->libVersion() != '0')) {
    $rr['curdb'] = $current_db;
	$rr['lis'] = '';
	$tbls = $pla_db->getTables();
	foreach($tbls as $row)
		$rr['lis'] .= design_render('extra/left',array('urow'=>urlencode($row),'row'=>$row));

	$tar['tables'] = design_render('misc/lefttab',$rr);
}
die(design_render('left',$tar));

function db_selector($current_db) {
	$s = "<form name=\"choosedb\" action=\"main.php\" method=\"post\" target=\"_top\">\n";
	$s .= "<select name=\"newdb\" onchange=\"this.form.submit();\">\n";

	$trk = ReadAliasCFG();// format: alias|path|description
	if(count($trk))
	  foreach($trk as $val) {
		$row = explode('|',$val,3);//
		if(!$row[0]) continue;
		$s .= "\t<option value=\"{$row[1]}\"";
		if($row[1] == $current_db) $s .= ' selected="selected"';
		$s .= ">{$row[0]}</option>\n";
	}
	$s .= "</select>\n</form>\n";
	return $s;
}
Return current item: SQLite PHP Admin