0) $sql_to_display_data=0;
if($sql_to_display_data==1) {
//nur ein SQL-Statement
$limitende=($limitstart+$config["sql_limit"]);
//Darf sortiert werden?
$op=strpos($sql["sql_statement"],"ORDER");
if($op>0) {
$sql["order_statement"]=substr($sql["sql_statement"],$op);
$sql["sql_statement"]=substr($sql["sql_statement"],0,$op);
if(strpos($rest,",")>0) $no_order=true;
}
//Darf editiert werden?
$no_edit=(strtoupper(substr($sql["sql_statement"],0,6))!="SELECT" || $showtables==1);
if($no_edit)$no_order=true;
}
if(isset($_POST["tableselect"])) $tablename=$_POST["tableselect"];
//MySQL verbinden
MSD_mysql_connect();
mysql_select_db($db,$config["dbconnection"]);
///*** EDIT / UPDATES / INSERTS ***///
///*** ***///
//Datensatz editieren
if(isset($_POST["update"])) {
GetPostParams();
$f=explode("|",$_POST["feldnamen"]);
$sqlu='Update `'.$tablename.'` Set ';
for($i=0;$i'.$lang['sql_recordupdated'].'
';
}
//Datensatz einfügen
if(isset($_POST["insert"])) {
GetPostParams();
$f=explode("|",$_POST["feldnamen"]);
$sqlu='Insert into `'.$tablename.'` Set ';
for($i=0;$i'.$lang['sql_recordinserted'].'';
}
if(isset($_POST["cancel"])) GetPostParams();
//Tabellenansicht
$showtables=(substr(strtoupper($sql["sql_statement"]),0,5)=="SHOW ") ? 1 : 0;
$tabellenansicht=(substr(strtoupper($sql["sql_statement"]),0,10)=="SHOW TABLE") ? 1 : 0;
if(strtolower(substr($sql["sql_statement"],0,6))=="select") $limit=' LIMIT '.$limitstart.', '.$limitende.';';
$params="sql.php?db=".$db."&tablename=".$tablename."&dbid=".$dbid.'&context='.$context.'&sql_statement='.urlencode($sql["sql_statement"]).'&showtables='.$showtables;
if($order!="") $params.="&order=".$order."&orderdir=".$orderdir.'&context='.$context;
if($bb>-1) $params.="&bb=".$bb;
echo 'Mini-SQL ';
echo ' ';
echo ''.$lang['db'].' ';
if($context==0 || $context==2) {
echo '`'.$db.' ` '.(($tablename!="") ? ''.$lang['table'].' `'.$tablename.' `' : '').'';
} else echo "(".$lang['sql_selecdb'].")";
echo ' ';
if($context==0) {
//Start SQL-Box
if(isset($_GET["readfile"]) && $_GET["readfile"]==1) {
echo '';
}
if(isset($_POST["submit_openfile"])) {
//open file
if (!isset($_FILES["upfile"]["name"]) || empty($_FILES["upfile"]["name"])) echo ''.$lang["fm_uploadfilerequest"].' ';
else {
$fn=$_FILES["upfile"]["tmp_name"];
if(strtolower(substr($_FILES["upfile"]["name"],-3))==".gz")
$read__user_sqlfile=gzfile($fn);
else
$read__user_sqlfile=file($fn);
echo 'geladenes File: '.$_FILES["upfile"]["name"].' '.byte_output(filesize($_FILES["upfile"]["tmp_name"])).' ';
}
}
echo ' ';
if(isset($_GET["mode"]) && $context==0) {
if(isset($_GET["recordkey"])) $rk=stripslashes(urldecode($_GET["recordkey"]));
if(isset($_GET['tablename'])) $tablename=$_GET['tablename'];
if($_GET["mode"]=="kill") {
if($showtables==0) {
$sqlk= "DELETE FROM `$tablename` WHERE ".$rk;
$res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error()));
echo ''.$lang['sql_recorddeleted'].'
';
} else {
$sqlk= "Drop Table `$rk`";
$res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error()));
echo ''.$lang['sql_tabledeleted1'].$rk.$lang['sql_tabledeleted2'].'
';
}
}
if($_GET["mode"]=="edit") {
echo ''.$lang['sql_recordedit'].' '.$rk.' ';
$sqledit="Select * from $tablename where $rk";
$res=MSD_query($sqledit) or die(SQLError($sqledit,mysql_error()));
echo '
';
echo ' ';
$row=mysql_fetch_row($res);
echo ''.FormHiddenParams().' ';
}
if($_GET["mode"]=="new") {
echo ''.$lang['sql_recordnew'].' ';
$sqledit="SHOW FIELDS FROM $tablename";
$res=MSD_query($sqledit) or die(SQLError($sqledit,mysql_error()));
$num=mysql_numrows($res);
echo '
';
echo ' ';
echo ''.FormHiddenParams().' ';
}
}
if($context==0){
//Data-View
echo ''.(($showtables==1)?$lang['sql_tableview']:$lang['sql_dataview']).' ';
if($showtables==0){
$p='sql.php?sql_statement='.urlencode($sql["sql_statement"]).'&db='.$db.'&tablename='.$tablename.'&dbid='.$dbid.'&limitstart='.$limitstart.'&order='.$order.'&orderdir='.$orderdir;
echo ''.$lang['sql_recordnew'].' ';
} else {
$p='sql.php?db='.$db.'&dbid='.$dbid.'&context=2';
echo ''.$lang['sql_tablenew'].' ';
}
//Statuszeile
echo '';
if(isset($msg))echo $msg;
//SQL ausführen
if($sql_to_display_data==0) {
//mehrere SQL-Statements
$numrowsabs=$numrows=0;
MSD_DoSQL($sql["sql_statement"]);
echo SQLOutput($out);
} else {
$numrowsabs=$numrows=0;
$res=MSD_query($sql["sql_statement"]) or die(SQLError($sql["sql_statement"],mysql_error()));
$numrowsabs=mysql_num_rows($res);
$res=MSD_query($sql["sql_statement"].$sql["order_statement"].$limit) or die(SQLError($sql["sql_statement"].$sql["order_statement"].$limit,mysql_error()));
$numrows=mysql_num_rows($res);
if($limitende>$numrowsabs)$limitende=$numrowsabs;
}
if($numrowsabs>0 && $Anzahl_SQLs<=1) {
if($showtables==0) {
$command_line=$lang['info_records']." ".($limitstart+1)." - $limitende ".$lang['sql_vonins']." $numrowsabs ";
$command_line.=($limitstart>0) ? '<< ' : '<< ';
$command_line.=($limitstart>0) ? '< ' : '< ';
$command_line.=($limitende<$numrowsabs) ? '> ' : '> ';
$command_line.=($limitende<($numrowsabs-$config["sql_limit"])) ? '>> ' : '>>';
echo $command_line;
} else {
echo $numrowsabs." ".$lang['tables'];
}
echo '
';
//Datentabelle
echo '';
$t=$d="";
$fdesc=Array();
$key=-1;
if ($numrows>0){
//Infos und Header holen
//1.Datensatz für Feldinfos
$row= mysql_fetch_row($res);
$t=''.$lang['sql_queryentry'].' '.count($row).' '.$lang['sql_columns'].' ';
$t.=' ';
for($x=0; $x';
$pic="";
$fdesc[$x]['name']=$str->name;
$fdesc[$x]['table']=$str->table;
$fdesc[$x]['max_length']=$str->max_length;
$fdesc[$x]['not_null']=$str->not_null;
$fdesc[$x]['primary_key']=$str->primary_key;
$fdesc[$x]['unique_key']=$str->unique_key;
$fdesc[$x]['multiple_key']=$str->multiple_key;
$fdesc[$x]['numeric']=$str->numeric;
$fdesc[$x]['blob']=$str->blob;
$fdesc[$x]['type']=$str->type;
$fdesc[$x]['unsigned']=$str->unsigned;
$fdesc[$x]['zerofill']=$str->zerofill;
$tt="Name: ".$fdesc[$x]['name']."\nType: ".$fdesc[$x]['type']."\nMax Length: ".$fdesc[$x]['max_length']."\nUnsigned: ".$fdesc[$x]['unsigned']."\nzerofill: ".$fdesc[$x]['zerofill'];
$pic=' ';
if($str->primary_key==1 || $str->unique_key==1) {
if($key==-1) $key=$x;
if($str->primary_key==1) $pic=' ';
elseif($str->unique_key==1) $pic=' ';
}
if($bb==-1)
$bb_link=($str->type=="blob") ? ' [BB] ' : '';
else
$bb_link=($str->type=="blob") ? ' [no BB] ' : '';
if($no_order==false && $showtables==0)
$t.=$pic.' '.$str->name.' '.$bb_link;
else
$t.=$pic.' '.$str->name.' '.$bb_link;
$arname=($orderdir==" ASC") ? "arup.gif" : "ardown.gif";
if($str->name==$order)$t.=' ';
$t.='';
//echo "DOING HEADERS $t";
}
//und jetzt Daten holen
mysql_data_seek ($res, 0);
for ($i=0;$i<$numrows;$i++) {
$row= mysql_fetch_row($res);
for($x=0; $x ';
$p='sql.php?sql_statement='.urlencode($sql["sql_statement"]).'&db='.$db.'&tablename='.$tablename.'&dbid='.$dbid.'&limitstart='.$limitstart.'&order='.$order.'&orderdir='.$orderdir.'&editkey='.$key;
if($key==-1) {
$rk="";
for($il=0;$il ';
}
}
if($showtables==0) {
$d.=' ';
} else {
if($tabellenansicht==1) {
$d.=' ';
$d.=' ';
}
}
$d.='';
}
$d.='';
if($bb==$x){
$data=simple_bbcode_conversion($row[$x]);
} else
$data=($fdesc[$x]['type']=='string' || $fdesc[$x]['type']=='blob') ? strip_tags($row[$x]) : $row[$x];
$d.=($tabellenansicht==1 && $x==0) ? "$data " : $data;
$d.=' ';
}
if($i==0) echo ''.$t.' ';
echo ''.$d.' ';
$d="";
}
}
echo '
';
if($showtables==0) echo ' '.$command_line;
} else echo ''.$lang['sql_nodata'].'
';
} elseif ($context==1) {
//SQL-Strings
echo ''.$lang['sql_befehle'].' ('.count($SQL_ARRAY).') ';
echo ''.$lang['sql_befehlneu'].' ';
if(isset($_GET["sqlnewupdate"])) {
$ind=count($SQL_ARRAY);
if(count($SQL_ARRAY)>0)
array_push($SQL_ARRAY,$_GET["sqlname".$ind]."|".$_GET["sqlstring".$ind]);
else $SQL_ARRAY[0]=$_GET["sqlname0"]."|".$_GET["sqlstring0"];
WriteSQL();
echo ''.$lang['sql_befehlsaved1'].' \''.$_GET["sqlname".$ind].'\' '.$lang['sql_befehlsaved2'].'
';
}
echo '
';
} elseif ($context==2) {
//Tabellen
echo ''.$lang['sql_tablesofdb'].' `'.$databases["Name"][$dbid].'` '.$lang['sql_edit'].' ';
if(isset($_GET["kill"])) {
if($_GET["anz"]==1)
echo ''.$lang['sql_nofielddelete'].'
';
else {
$sql_alter="ALTER TABLE `".$databases["Name"][$dbid]."`.`".$_GET["table"]."` DROP COLUMN `".$_GET["kill"]."`";
MSD_DoSQL($sql_alter);
echo '';
echo '
'.$lang['sql_fielddelete1'].' `'.$_GET["kill"].'` '.$lang['sql_deleted'].'.
'.highlight_sql($out).'
';
}
}
if(isset($_POST["tablecopysubmit"])) {
$table_edit_name=$_GET["tablename"];
if($_POST["tablecopyname"]=="") {
echo ''.$lang['sql_nodest_copy'].'
';
} elseif(Table_Exists($databases["Name"][$dbid],$_POST["tablecopyname"])) {
echo ''.$lang['sql_desttable_exists'].'
';
} else {
Table_Copy("`".$databases["Name"][$dbid]."`.`".$table_edit_name."`",$_POST["tablecopyname"],$_POST["copyatt"]);
echo '';
echo ($_POST["copyatt"]==0) ? '
'.$lang['sql_scopy1'].' `'.$table_edit_name.'` '.$lang['sql_scopy2'].' `'.$_POST["tablecopyname"].'` '.$lang['sql_scopy3'].'.
' : '
'.$lang['table'].' `'.$table_edit_name.'` '.$lang['sql_copy1'].' `'.$_POST["tablecopyname"].'` '.$lang['sql_copied'].'.
';
echo highlight_sql($out).'
';
$tablename=$_POST["tablecopyname"];
}
}
if(isset($_POST["newtablesubmit"])) {
if($_POST["newtablename"]=="") {
echo ''.$lang['sql_tablenoname'].'
';
} else {
$sql_alter="CREATE TABLE `".$databases["Name"][$dbid]."`.`".$_POST["newtablename"]."` (`id` int(6) unsigned not null) ".((MSD_NEW_VERSION) ? "ENGINE" : "TYPE")."=MyISAM;";
MSD_DoSQL($sql_alter);
echo SQLOutput($out,$lang['table'].' `'.$_POST["newtablename"].'` '.$lang['sql_created']);
}
}
if(isset($_POST["t_edit_submit"])) {
$sql_alter="ALTER TABLE `".$databases["Name"][$dbid]."`.`".$_POST["table_edit_name"]."` ";
if($_POST["t_edit_name"]=="")
echo ''.$lang['sql_tblnameempty'].'
';
elseif(MSD_NEW_VERSION && $_POST["t_edit_collate"]!="" && substr($_POST["t_edit_collate"],0,strlen($_POST["t_edit_charset"]))!=$_POST["t_edit_charset"])
echo ''.$lang['sql_collatenotmatch'].'
';
else {
if($_POST["table_edit_name"]!=$_POST["t_edit_name"]) {
$sql_alter.="RENAME TO `".$_POST["t_edit_name"]."`, ";
$table_edit_name=$_POST["t_edit_name"];
} else $table_edit_name=$_POST["table_edit_name"];
if($_POST["t_edit_engine"]!="") $sql_alter.=((MSD_NEW_VERSION) ? "ENGINE=" : "TYPE=").$_POST["t_edit_engine"].", ";
if($_POST["t_edit_rowformat"]!="") $sql_alter.="ROW_FORMAT=".$_POST["t_edit_rowformat"].", ";
if(MSD_NEW_VERSION && $_POST["t_edit_charset"]!="") $sql_alter.="DEFAULT CHARSET=".$_POST["t_edit_charset"].", ";
if(MSD_NEW_VERSION && $_POST["t_edit_collate"]!="") $sql_alter.="COLLATE ".$_POST["t_edit_collate"].", ";
$sql_alter.="COMMENT='".$_POST["t_edit_comment"]."' ";
MSD_DoSQL($sql_alter);
echo SQLOutput($out,$lang['table'].' `'.$_POST["table_edit_name"].'` '.$lang['sql_changed']);
}
} else {
if(!isset($table_edit_name) || $table_edit_name=="") {
$table_edit_name=(isset($_GET["tablename"])) ? $_GET["tablename"] : "";
if(isset($_POST["tableselect"])) $table_edit_name=$_POST["tableselect"];
if(isset($_POST["newtablesubmit"])) $table_edit_name=$_POST["newtablename"];
}
}
if(isset($_POST["newfield_posted"])) {
//build sql for alter
$def_fieldvals=DefaultFieldVals();
if($_POST["f_name"]=="") {
echo ''.$lang['sql_fieldnamenotvalid'].' ('.$_POST["f_name"].')
';
$field_fehler=1;
} else {
$sql_stamm="ALTER TABLE `".$databases["Name"][$dbid]."`.`$table_edit_name` ";
$sql_alter=$sql_stamm.((isset($_POST["editfield"])) ? "CHANGE COLUMN `".$_POST["fieldname"]."` `".$_POST["f_name"]."` " : "ADD COLUMN `".$_POST["f_name"]."` ");
$sql_alter.=$_POST["f_type"];
$size=($_POST["f_size"]!="") ? $_POST["f_size"] : $def_fieldvals[strtoupper($_POST["f_type"])]["maxsize"];
$sql_alter.="(".$size.") ";
$sql_alter.=$_POST["f_null"]." ";
$sql_alter.=($_POST["f_default"]!="") ? "DEFAULT '".$_POST["f_default"]."' " :"";
if(MSD_NEW_VERSION && $_POST["f_collate"]!="") $sql_alter.="COLLATE ".$_POST["f_collate"]." ";
$sql_alter.=$_POST["f_position"]." ;";
//alter Key
$oldkeys[0]=$_POST["f_primary"];
$oldkeys[1]=$_POST["f_unique"];
$oldkeys[2]=$_POST["f_index"];
$oldkeys[3]=$_POST["f_fulltext"];
//neuer Key
$newkeys[0]=($_POST["f_index_new"]=="primary")? 1 : 0;
$newkeys[1]=($_POST["f_index_new"]=="unique")? 1 : 0;
$newkeys[2]=($_POST["f_index_new"]=="index")? 1 : 0;
$newkeys[3]=(isset($_POST["f_indexfull"])) ? 1 : 0;
//$s="$oldkeys[0] | $oldkeys[1] | $oldkeys[2] | $oldkeys[3] *** $newkeys[0] | $newkeys[1] |$newkeys[2] | $newkeys[3]";
$add_sql=ChangeKeys($oldkeys,$newkeys,$_POST["f_name"],$size);
if($add_sql!="") {
$add_sql=$sql_stamm.$add_sql;
$sql_alter=$sql_alter."\n".$add_sql." ;";
}
MSD_DoSQL($sql_alter);
echo '';
echo '
`'.$_POST["f_name"].'` '.((isset($_POST["editfield"])) ? $lang['sql_changed'] : $lang['sql_created']).'.
';
echo highlight_sql($out).'
';
$fields_infos=FillFieldinfos($databases["Name"][$dbid],$table_edit_name);
}
}
mysql_select_db($databases["Name"][$dbid]);
$sqlt="SHOW TABLE STATUS FROM `".$databases["Name"][$dbid]."` ;";
$res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error()));
$anz_tabellen=mysql_numrows($res);
$p="sql.php?db=".$databases["Name"][$dbid]."&dbid=$dbid&tablename=$table_edit_name&context=2";
echo '';
echo '';
echo ' ';
if($table_edit_name!="") {
$sqlf="SHOW FIELDS FROM `".$databases["Name"][$dbid]."`.`$table_edit_name` ;";
$res=MSD_query($sqlf) or die(SQLError($sqlf,mysql_error()));
$anz_fields=mysql_numrows($res);
//Array füllen
$fields_infos=FillFieldinfos($databases["Name"][$dbid],$table_edit_name);
if(MSD_NEW_VERSION)
$t_engine=(isset($fields_infos["_tableinfo_"]["ENGINE"])) ? $fields_infos["_tableinfo_"]["ENGINE"] : "MyISAM";
else
$t_engine=(isset($fields_infos["_tableinfo_"]["TYPE"])) ? $fields_infos["_tableinfo_"]["TYPE"] : "MyISAM";
$t_charset=(isset($fields_infos["_tableinfo_"]["DEFAULT CHARSET"])) ? $fields_infos["_tableinfo_"]["DEFAULT CHARSET"] : "";
$t_collation=(isset($fields_infos["_tableinfo_"]["COLLATE"])) ? $fields_infos["_tableinfo_"]["COLLATE"] : "";
$t_comment=(isset($fields_infos["_tableinfo_"]["COMMENT"])) ? substr($fields_infos["_tableinfo_"]["COMMENT"],1,strlen($fields_infos["_tableinfo_"]["COMMENT"])-2) : "";
$t_rowformat=(isset($fields_infos["_tableinfo_"]["ROW_FORMAT"])) ? $fields_infos["_tableinfo_"]["ROW_FORMAT"] : "";
echo "Tabelle `$table_edit_name` ";
$td='';
//Tabelleneigenschaften
echo ' ';
$field_fehler=0;
if(isset($_GET["newfield"]) || isset($_GET["editfield"]) || $field_fehler>0) {
if(isset($_GET["editfield"])) $id=$_GET["editfield"];
$d_name=(isset($_GET["editfield"])) ? $fields_infos[$id]["name"] : "";
$d_type=(isset($_GET["editfield"])) ? $fields_infos[$id]["type"] : "";
$d_size=(isset($_GET["editfield"])) ? $fields_infos[$id]["size"] : "";
$d_null=(isset($_GET["editfield"])) ? $fields_infos[$id]["null"] : "";
$d_default=(isset($_GET["editfield"])) ? substr($fields_infos[$id]["default"],1,strlen($fields_infos[$id]["default"])-2) : "";
$d_extra=(isset($_GET["editfield"])) ? $fields_infos[$id]["extra"] : "";
$d_primary=$d_unique=$d_index=$d_fulltext=0;
if(isset($_GET["editfield"])) {
$d_primary=(isset($fields_infos["_primarykey_"]) && $fields_infos["_primarykey_"]==$fields_infos[$id]["name"]) ? 1 : 0;
if(isset($fields_infos["_key_"])) {
for($i=0;$i ';
if (isset($_GET["editfield"])) echo ' ';
if(isset($_POST["newtablesubmit"])) echo ' ';
echo ' ';
echo '';
} else
echo ''.$lang['sql_insertnewfield'].' ';
//Felder ausgeben
echo '';
for($i=0;$i<$anz_fields;$i++) {
if($i==0) echo ' Field Type Size NULL Key Default Extra Sortierung ';
echo '';
echo ' ';
echo ' ';
echo ' '.$td.''.$fields_infos[$i]["name"].' '.$td.$fields_infos[$i]["type"].''.$td.$fields_infos[$i]["size"].'';
echo $td.$fields_infos[$i]["null"].''.$td;
//key
if($fields_infos["_primarykey_"]==$fields_infos[$i]["name"]) echo ' ';
if(isset($fields_infos["_fulltextkey_"])) {
for($ii=0;$ii'; break;
}
}
}
if(isset($fields_infos["_uniquekey_"])) {
for($ii=0;$ii'; break;
}
}
}
if(isset($fields_infos["_key_"])) {
for($ii=0;$ii".$fields_infos["_key_"][$ii]["columns"]."";
if($fields_infos["_key_"][$ii]["name"]==$fields_infos[$i]["name"]) {
echo ' '; break;
}
}
}
echo ''.$td.$fields_infos[$i]["default"].''.$td.$fields_infos[$i]["extra"].'';
echo ''.$td.$fields_infos[$i]["collate"].' ';
}
echo '
';
echo ''.$lang['sql_tableindexes'].' `'.$table_edit_name.'` ';
echo ' Index-Name '.((MSD_NEW_VERSION) ? 'Typ ' : '').''.$lang['sql_allowdups'].' '.$lang['sql_cardinality'].' Spalten ';
$sqlk="SHOW KEYS FROM `".$databases["Name"][$dbid]."`.`$table_edit_name`;";
$res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error()));
$num=mysql_numrows($res);
if($num==0) {
echo ''.$lang['sql_tablenoindexes'].' ';
} else {
for($i=0;$i<$num;$i++) {
$row=mysql_fetch_array($res);
//Images
echo ' ';
echo ''.$row["Key_name"].' ';
if(MSD_NEW_VERSION) echo ''.$row["Index_type"].' ';
echo ''.(($row["Non_unique"]==1) ? $lang["yes"]: $lang["no"]).' ';
echo ''.(($row["Cardinality"]>=0) ? $row["Cardinality"] : "keine").' ';
echo ''.$row["Column_name"].' ';
echo ' ';
}
}
echo '
';
/*echo " ";
echo '';print_r($fields_infos);echo ' ';*/
}
} elseif ($context==3) {
//Datenbanken
if(isset($_GET["dbrefresh"])) SetDefault(true);
echo "".$lang['dbs']." ";
if(isset($_POST["dbdosubmit"])) {
$newname=$_POST["newname"];
$db_index=$_POST["db_index"];
$db_action=$_POST["db_action"];
$changed=false;$ausgabe=$out="";
switch($db_action) {
case "drop":
MSD_DoSQL("DROP DATABASE `".$databases["Name"][$db_index]."`");
echo SQLOutput($out,''.$lang['db'].' `'.$databases["Name"][$db_index].'` wurde gelöscht.
');
$changed=true;
break;
case "empty":
DB_Empty($databases["Name"][$db_index]);
echo SQLOutput($out,''.$lang['db'].' `'.$databases["Name"][$db_index].'` '.$lang['sql_wasemptied'].'.
');
break;
case "rename":
$dbold=$databases["Name"][$db_index];
DB_Copy($dbold,$newname,1);
echo SQLOutput($out,''.$lang['db'].' `'.$dbold.'` '.$lang['sql_renamedto'].' `'.$newname.'`.
');
$changed=true;
break;
case "copy":
$dbold=$databases["Name"][$db_index];
DB_Copy($dbold,$newname);
$changed=true;
echo SQLOutput($out,''.$lang['sql_dbcopy1'].' `'.$dbold.'` '.$lang['sql_dbcopy2'].' `'.$newname.'` '.$lang['sql_copied'].'.
');
break;
case "structure":
DB_Copy($databases["Name"][$db_index],$newname,0,0);
$changed=true;
echo SQLOutput($out,''.$lang['sql_dbscopy1'].' `'.$databases["Name"][$db_index].'` '.$lang['sql_dbcopy2'].' `'.$newname.'` '.$lang['sql_copied'].'.
');
break;
case "rights":
break;
}
if($changed=true) {
SetDefault(true);
include ($config["files"]["parameter"]);
echo '';
}
}
if(isset($_POST["dbwantaction"])) {
if(isset($_POST["db_createnew"])) {
$newname=$_POST["db_create"];
if(!empty($newname)) {
$sqlc="CREATE DATABASE `$newname`";
MSD_query($sqlc) or die(SQLError($sqlc,mysql_error()));
echo $lang['db']." `$newname` ".$lang['sql_wascreated'].". ";
SetDefault(true);
}
}
$db_action=$newname="";$db_index=-1;
for($i=0;$i ";
}
}
echo ' ';
echo ' ';
} elseif ($context==4) {
//Tabellen
}
echo ' ';
include("inc/footer.php");
function FormHiddenParams()
{
global $db,$dbid,$tablename,$context,$limitstart,$order,$orderdir;
$s=' ';
$s.=' ';
$s.=' ';
$s.=' ';
$s.=' ';
$s.=' ';
$s.=' ';
return $s;
}
?>