mirror of
https://github.com/phpLiteAdmin/pla.git
synced 2026-05-03 00:31:07 -05:00
- ALTER TABLE now supports ADD PRIMARY KEY(), so you can now add primary keys. This is also possible in column_view. NOTE: This is currently only possible if the table has no primary key yet. There is no possibility to drop or change primary keys so far. This is related to issue #12, issue #158 and issue #79, although not completely fixing any of these.
This required a new language text "ques_primarykey_add" that is currently only translated in German (and English) - the "back" links after some action was confirmed mostly let to the database page. Now they lead back to the place where the user came from, mostly column_view or row_view actions. This touches issue #230. git-svn-id: https://phpliteadmin.googlecode.com/svn/source/trunk@444 c054f44c-0d31-6418-e286-147a9414beb1
This commit is contained in:
+53
-27
@@ -208,7 +208,11 @@ class Database
|
||||
public function getAffectedRows()
|
||||
{
|
||||
if($this->type=="PDO")
|
||||
return $this->lastResult->rowCount();
|
||||
if(!is_object($this->lastResult))
|
||||
// in case it was an alter table statement, there is no lastResult object
|
||||
return 0;
|
||||
else
|
||||
return $this->lastResult->rowCount();
|
||||
else if($this->type=="SQLite3")
|
||||
return $this->db->changes();
|
||||
else if($this->type=="SQLiteDatabase")
|
||||
@@ -369,12 +373,14 @@ class Database
|
||||
// single-quotes, double-quotes, backticks, square brackets.
|
||||
// As sqlite does not keep this strict, we also need to be flexible here.
|
||||
// This function generates a regex that matches any of the possibilities.
|
||||
private function sqlite_surroundings_preg($name,$preg_quote=true,$notAllowedIfNone="'\"",$notAllowedName=false)
|
||||
private function sqlite_surroundings_preg($name,$preg_quote=true,$notAllowedCharsIfNone="'\"",$notAllowedName=false)
|
||||
{
|
||||
if($name=="*" || $name=="+")
|
||||
{
|
||||
if($notAllowedName!==false)
|
||||
if($notAllowedName!==false && $preg_quote)
|
||||
$notAllowed = "(?!".preg_quote($notAllowedName,"/").")";
|
||||
elseif($notAllowedName!==false)
|
||||
$notAllowed = "(?!".$notAllowedName.")";
|
||||
else
|
||||
$notAllowed = "";
|
||||
// use possesive quantifiers to save memory
|
||||
@@ -382,7 +388,7 @@ class Database
|
||||
$nameDouble = $notAllowed."(?:[^\"]$name+|\"\")$name+";
|
||||
$nameBacktick = $notAllowed."(?:[^`]$name+|``)$name+";
|
||||
$nameSquare = $notAllowed."(?:[^\]]$name+|\]\])$name+";
|
||||
$nameNo = $notAllowed."[^".$notAllowedIfNone."]$name";
|
||||
$nameNo = $notAllowed."[^".$notAllowedCharsIfNone."]$name";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -464,7 +470,15 @@ class Database
|
||||
$createtemptableSQL = "CREATE TEMPORARY TABLE ".$this->quote($tmpname)." ".$origsql_no_create;
|
||||
if($debug) echo "createtemptableSQL=($createtemptableSQL)<hr>";
|
||||
$createindexsql = array();
|
||||
preg_match_all("/(?:DROP|ADD|CHANGE|RENAME TO)\s+(?:\"(?:[^\"]|\"\")+\"|'(?:[^']|'')+')((?:[^,']|'[^']*')+)?/i",$alterdefs,$matches);
|
||||
$preg_alter_part = "/(?:DROP|ADD(?! PRIMARY KEY)|CHANGE|RENAME TO|ADD PRIMARY KEY)\s+" // the ALTER command
|
||||
."(?:"
|
||||
."\(".$this->sqlite_surroundings_preg("+",false,"\"'\[`)")."+\)" // stuff in brackets (in case of ADD PRIMARY KEY)
|
||||
."|" // or
|
||||
.$this->sqlite_surroundings_preg("+",false,",'\"\[`") // column names and stuff like this
|
||||
.")*/i";
|
||||
if($debug)
|
||||
echo "preg_alter_part=(".$preg_alter_part.")<hr />";
|
||||
preg_match_all($preg_alter_part,$alterdefs,$matches);
|
||||
$defs = $matches[0];
|
||||
|
||||
$get_oldcols_query = "PRAGMA table_info(".$this->quote_id($table).")";
|
||||
@@ -496,19 +510,24 @@ class Database
|
||||
foreach($defs as $def)
|
||||
{
|
||||
if($debug) echo "def=$def<hr />";
|
||||
$parse_def = preg_match("/^(DROP|ADD|CHANGE|RENAME TO)\s+" // $matches[1]: command
|
||||
."(?:\"((?:[^\"]|\"\")+)\"|'((?:[^']|'')+)')" // (first) column name, either in single or double quotes
|
||||
// in case of RENAME TO, it is the new a table name
|
||||
// $matches[2] will be the column/table name without the quotes if double quoted
|
||||
// $matches[3] will be the column/table name without the quotes if single quoted
|
||||
."(" // $matches[4]: anything after the column name
|
||||
."(?:\s+'((?:[^']|'')+)')?" // $matches[5] (optional): a second column name surrounded with single quotes
|
||||
// (the match does not contain the quotes)
|
||||
."\s+"
|
||||
."((?:[A-Z]+\s*)+(?:\(\s*[+-]?\s*[0-9]+(?:\s*,\s*[+-]?\s*[0-9]+)?\s*\))?)\s*" // $matches[6]: a type name
|
||||
.".*".
|
||||
")"
|
||||
."?\s*$/i",$def,$matches);
|
||||
$parse_def = preg_match("/^(DROP|ADD(?! PRIMARY KEY)|CHANGE|RENAME TO|ADD PRIMARY KEY)\s+" // $matches[1]: command
|
||||
."(?:" // this is either
|
||||
."(?:\((.+)\)\s*$)" // anything in brackets (for ADD PRIMARY KEY)
|
||||
// then $matches[2] is what there is in brackets
|
||||
."|" // OR:
|
||||
."(?:\"((?:[^\"]|\"\")+)\"|'((?:[^']|'')+)')" // (first) column name, either in single or double quotes
|
||||
// in case of RENAME TO, it is the new a table name
|
||||
// $matches[3] will be the column/table name without the quotes if double quoted
|
||||
// $matches[4] will be the column/table name without the quotes if single quoted
|
||||
."(" // $matches[5]: anything after the column name
|
||||
."(?:\s+'((?:[^']|'')+)')?" // $matches[6] (optional): a second column name surrounded with single quotes
|
||||
// (the match does not contain the quotes)
|
||||
."\s+"
|
||||
."((?:[A-Z]+\s*)+(?:\(\s*[+-]?\s*[0-9]+(?:\s*,\s*[+-]?\s*[0-9]+)?\s*\))?)\s*" // $matches[7]: a type name
|
||||
.".*".
|
||||
")"
|
||||
."?\s*$"
|
||||
.")/i",$def,$matches);
|
||||
if($parse_def===false)
|
||||
{
|
||||
$this->alterError = $errormsg . $lang['alter_parse_failed'];
|
||||
@@ -523,10 +542,12 @@ class Database
|
||||
}
|
||||
$action = strtolower($matches[1]);
|
||||
if($action == 'add' || $action == 'rename to')
|
||||
$column = str_replace("''","'",$matches[3]); // enclosed in ''
|
||||
$column = str_replace("''","'",$matches[4]); // enclosed in ''
|
||||
elseif($action == 'add primary key')
|
||||
$column = $matches[2];
|
||||
else
|
||||
$column = str_replace('""','"',$matches[2]); // enclosed in ""
|
||||
|
||||
$column = str_replace('""','"',$matches[3]); // enclosed in ""
|
||||
|
||||
$column_escaped = str_replace("'","''",$column);
|
||||
|
||||
if($debug) echo "action=($action), column=($column), column_escaped=($column_escaped)<hr />";
|
||||
@@ -539,7 +560,7 @@ class Database
|
||||
4. 'colX+1' ..., ..., 'colK') $5 (with colX+1-colK being columns after the column to change/drop)
|
||||
*/
|
||||
$preg_create_table = "\s*+(CREATE\s++TEMPORARY\s++TABLE\s++".preg_quote($this->quote($tmpname),"/")."\s*+\()"; // This is group $1 (keep unchanged)
|
||||
$preg_column_definiton = "\s*+".$this->sqlite_surroundings_preg("+",false," '\"\[`,",$column)."(?:\s*+".$this->sqlite_surroundings_preg("*",false,"'\",`\[ ").")++"; // catches a complete column definition, even if it is
|
||||
$preg_column_definiton = "\s*+".$this->sqlite_surroundings_preg("+",true," '\"\[`,",$column)."(?:\s*+".$this->sqlite_surroundings_preg("*",false,"'\",`\[ ").")++"; // catches a complete column definition, even if it is
|
||||
// 'column' TEXT NOT NULL DEFAULT 'we have a comma, here and a double ''quote!'
|
||||
// this definition does NOT match columns with the column name $column
|
||||
if($debug) echo "preg_column_definition=(".$preg_column_definiton.")<hr />";
|
||||
@@ -562,12 +583,12 @@ class Database
|
||||
switch($action)
|
||||
{
|
||||
case 'add':
|
||||
if(!isset($matches[4]))
|
||||
if(!isset($matches[5]))
|
||||
{
|
||||
$this->alterError = $errormsg . ' (add) - '. $lang['alter_no_add_col'];
|
||||
return false;
|
||||
}
|
||||
$new_col_definition = "'$column_escaped' ".$matches[4];
|
||||
$new_col_definition = "'$column_escaped' ".$matches[5];
|
||||
$preg_pattern_add = "/^".$preg_create_table. // the CREATE TABLE statement ($1)
|
||||
"((?:(?!,\s*(?:PRIMARY\s+KEY\s*\(|CONSTRAINT\s|UNIQUE\s*\(|CHECK\s*\(|FOREIGN\s+KEY\s*\()).)*)". // column definitions ($2)
|
||||
"(.*)\\)\s*$/s"; // table-constraints like PRIMARY KEY(a,b) ($3) and the closing bracket
|
||||
@@ -588,13 +609,13 @@ class Database
|
||||
$createtesttableSQL = $newSQL;
|
||||
break;
|
||||
case 'change':
|
||||
if(!isset($matches[5]) || !isset($matches[6]))
|
||||
if(!isset($matches[6]) || !isset($matches[7]))
|
||||
{
|
||||
$this->alterError = $errormsg . ' (change) - '.$lang['alter_col_not_recognized'];
|
||||
return false;
|
||||
}
|
||||
$new_col_name = $matches[5];
|
||||
$new_col_type = $matches[6];
|
||||
$new_col_name = $matches[6];
|
||||
$new_col_type = $matches[7];
|
||||
$new_col_definition = "'$new_col_name' $new_col_type";
|
||||
$preg_column_to_change = "\s*".$this->sqlite_surroundings_preg($column)."(?:\s+".preg_quote($coltypes[$column]).")?(\s+(?:".$this->sqlite_surroundings_preg("*",false,",'\"`\[").")+)?";
|
||||
// replace this part (we want to change this column)
|
||||
@@ -653,6 +674,11 @@ class Database
|
||||
// only change the name of the table
|
||||
$table_new = $column;
|
||||
break;
|
||||
case 'add primary key':
|
||||
// we want to add a primary key for the column(s) stored in $column
|
||||
$newSQL = preg_replace("/\)\s*$/", ", PRIMARY KEY (".$column.") )", $createtesttableSQL);
|
||||
$createtesttableSQL = $newSQL;
|
||||
break;
|
||||
default:
|
||||
if($debug) echo 'ERROR: unknown alter operation!<hr />';
|
||||
$this->alterError = $errormsg . $lang['alter_unknown_operation'];
|
||||
|
||||
@@ -728,6 +728,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_POST['tablename'])."' ".$lang['created'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($name);
|
||||
break;
|
||||
/////////////////////////////////////////////// empty table
|
||||
case "table_empty":
|
||||
@@ -740,6 +741,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_POST['tablename'])."' ".$lang['emptied'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=row_view&table=".urlencode($name);
|
||||
break;
|
||||
/////////////////////////////////////////////// create view
|
||||
case "view_create":
|
||||
@@ -748,6 +750,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['view']." '".htmlencode($_POST['viewname'])."' ".$lang['created'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_POST['viewname'])."&view=1";
|
||||
break;
|
||||
/////////////////////////////////////////////// drop table
|
||||
case "table_drop":
|
||||
@@ -756,6 +759,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_POST['tablename'])."' ".$lang['dropped'].".";
|
||||
$backlinkParameters = "";
|
||||
break;
|
||||
/////////////////////////////////////////////// drop view
|
||||
case "view_drop":
|
||||
@@ -764,6 +768,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['view']." '".htmlencode($_POST['viewname'])."' ".$lang['dropped'].".";
|
||||
$backlinkParameters = "";
|
||||
break;
|
||||
/////////////////////////////////////////////// rename table
|
||||
case "table_rename":
|
||||
@@ -775,6 +780,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_POST['oldname'])."' ".$lang['renamed']." '".htmlencode($_POST['newname'])."'.<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=row_view&table=".urlencode($_POST['newname']);
|
||||
break;
|
||||
//row actions
|
||||
/////////////////////////////////////////////// create row
|
||||
@@ -854,6 +860,7 @@ else //user is authorized - display the main application
|
||||
}
|
||||
}
|
||||
$completed = $z." ".$lang['rows']." ".$lang['inserted'].".<br/><br/>".$completed;
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// delete row
|
||||
case "row_delete":
|
||||
@@ -867,6 +874,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = sizeof($pks)." ".$lang['rows']." ".$lang['deleted'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=row_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// edit row
|
||||
case "row_edit":
|
||||
@@ -955,6 +963,7 @@ else //user is authorized - display the main application
|
||||
}
|
||||
if(isset($_POST['new_row']))
|
||||
$completed = $z." ".$lang['rows']." ".$lang['inserted'].".<br/><br/>".$completed;
|
||||
$backlinkParameters = "&action=row_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
//column actions
|
||||
/////////////////////////////////////////////// create column
|
||||
@@ -992,6 +1001,7 @@ else //user is authorized - display the main application
|
||||
}
|
||||
}
|
||||
$completed = $lang['tbl']." '".htmlencode($_GET['table'])."' ".$lang['altered'].".";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// delete column
|
||||
case "column_delete":
|
||||
@@ -1005,6 +1015,22 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_GET['table'])."' ".$lang['altered'].".";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// add a primary key
|
||||
case "primarykey_add":
|
||||
$pks = explode(":", $_GET['pk']);
|
||||
$query = "ALTER TABLE ".$db->quote_id($_GET['table']).' ADD PRIMARY KEY ('.$db->quote_id($pks[0]);
|
||||
for($i=1; $i<sizeof($pks); $i++)
|
||||
{
|
||||
$query .= ", ".$db->quote_id($pks[$i]);
|
||||
}
|
||||
$query .= ")";
|
||||
$result = $db->query($query);
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_GET['table'])."' ".$lang['altered'].".";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// edit column
|
||||
case "column_edit":
|
||||
@@ -1013,6 +1039,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['tbl']." '".htmlencode($_GET['table'])."' ".$lang['altered'].".";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// delete trigger
|
||||
case "trigger_delete":
|
||||
@@ -1021,6 +1048,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['trigger']." '".htmlencode($_GET['pk'])."' ".$lang['deleted'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// delete index
|
||||
case "index_delete":
|
||||
@@ -1029,6 +1057,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['index']." '".htmlencode($_GET['pk'])."' ".$lang['deleted'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// create trigger
|
||||
case "trigger_create":
|
||||
@@ -1048,6 +1077,7 @@ else //user is authorized - display the main application
|
||||
if($result===false)
|
||||
$error = true;
|
||||
$completed = $lang['trigger']." ".$lang['created'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
/////////////////////////////////////////////// create index
|
||||
case "index_create":
|
||||
@@ -1079,6 +1109,7 @@ else //user is authorized - display the main application
|
||||
$error = true;
|
||||
$completed = $lang['index']." ".$lang['created'].".<br/><span style='font-size:11px;'>".htmlencode($query)."</span>";
|
||||
}
|
||||
$backlinkParameters = "&action=column_view&table=".urlencode($_GET['table']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1191,7 +1222,7 @@ else //user is authorized - display the main application
|
||||
else if($_GET['action']=="column_create" || $_GET['action']=="column_delete" || $_GET['action']=="column_edit" || $_GET['action']=="index_create" || $_GET['action']=="index_delete" || $_GET['action']=="trigger_delete" || $_GET['action']=="trigger_create")
|
||||
echo "<br/><br/><a href='?table=".urlencode($_GET['table'])."&action=column_view'>".$lang['return']."</a>";
|
||||
else
|
||||
echo "<br/><br/><a href='".PAGE."'>".$lang['return']."</a>";
|
||||
echo "<br/><br/><a href='".PAGE.(isset($backlinkParameters)?$backlinkParameters:'')."'>".$lang['return']."</a>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
@@ -2426,7 +2457,7 @@ else //user is authorized - display the main application
|
||||
$query = "PRAGMA table_info(".$db->quote_id($_GET['table']).")";
|
||||
$result = $db->selectArray($query);
|
||||
|
||||
echo "<form action='?table=".urlencode($_GET['table'])."&action=column_delete' method='post' name='checkForm'>";
|
||||
echo "<form action='?table=".urlencode($_GET['table'])."&action=column_confirm' method='post' name='checkForm'>";
|
||||
echo "<table border='0' cellpadding='2' cellspacing='1' class='viewTable'>";
|
||||
echo "<tr>";
|
||||
if(!isset($_GET['view']))
|
||||
@@ -2439,6 +2470,8 @@ else //user is authorized - display the main application
|
||||
echo "<td class='tdheader'>".$lang['prim_key']."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
$noPrimaryKey = true;
|
||||
|
||||
for($i=0; $i<sizeof($result); $i++)
|
||||
{
|
||||
$colVal = $result[$i][0];
|
||||
@@ -2453,7 +2486,10 @@ else //user is authorized - display the main application
|
||||
else
|
||||
$notnullVal = $lang['no'];
|
||||
if(intval($primarykeyVal)!=0)
|
||||
{
|
||||
$primarykeyVal = $lang['yes'];
|
||||
$noPrimaryKey = false;
|
||||
}
|
||||
else
|
||||
$primarykeyVal = $lang['no'];
|
||||
|
||||
@@ -2469,7 +2505,7 @@ else //user is authorized - display the main application
|
||||
echo "<a href='?table=".urlencode($_GET['table'])."&action=column_edit&pk=".urlencode($fieldVal)."' title='".$lang['edit']."' class='edit'><span>".$lang['edit']."</span></a>";
|
||||
echo "</td>";
|
||||
echo $tdWithClass;
|
||||
echo "<a href='?table=".urlencode($_GET['table'])."&action=column_delete&pk=".urlencode($fieldVal)."' title='".$lang['del']."' class='delete'><span>".$lang['del']."</span></a>";
|
||||
echo "<a href='?table=".urlencode($_GET['table'])."&action=column_confirm&action2=column_delete&pk=".urlencode($fieldVal)."' title='".$lang['del']."' class='delete'><span>".$lang['del']."</span></a>";
|
||||
echo "</td>";
|
||||
}
|
||||
echo $tdWithClass;
|
||||
@@ -2502,11 +2538,12 @@ else //user is authorized - display the main application
|
||||
if(!isset($_GET['view']))
|
||||
{
|
||||
echo "<a onclick='checkAll()'>".$lang['chk_all']."</a> / <a onclick='uncheckAll()'>".$lang['unchk_all']."</a> <i>".$lang['with_sel'].":</i> ";
|
||||
echo "<select name='massType'>";
|
||||
echo "<select name='action2'>";
|
||||
//echo "<option value='edit'>".$lang['edit']."</option>";
|
||||
echo "<option value='delete'>".$lang['del']."</option>";
|
||||
echo "<option value='column_delete'>".$lang['del']."</option>";
|
||||
if($noPrimaryKey)
|
||||
echo "<option value='primarykey_add'>".$lang['prim_key']."</option>";
|
||||
echo "</select> ";
|
||||
echo "<input type='hidden' name='structureDel' value='true'/>";
|
||||
echo "<input type='submit' value='".$lang['go']."' name='massGo' class='btn'/>";
|
||||
}
|
||||
echo "</form>";
|
||||
@@ -2711,7 +2748,7 @@ else //user is authorized - display the main application
|
||||
}
|
||||
break;
|
||||
/////////////////////////////////////////////// delete column
|
||||
case "column_delete":
|
||||
case "column_confirm":
|
||||
if(isset($_POST['check']))
|
||||
$pks = $_POST['check'];
|
||||
elseif(isset($_GET['pk']))
|
||||
@@ -2734,9 +2771,9 @@ else //user is authorized - display the main application
|
||||
$str .= ", ".$pks[$i];
|
||||
$pkVal .= ":".$pks[$i];
|
||||
}
|
||||
echo "<form action='?table=".urlencode($_GET['table'])."&action=column_delete&confirm=1&pk=".urlencode($pkVal)."' method='post'>";
|
||||
echo "<form action='?table=".urlencode($_GET['table'])."&action=".$_REQUEST['action2']."&confirm=1&pk=".urlencode($pkVal)."' method='post'>";
|
||||
echo "<div class='confirm'>";
|
||||
printf($lang['ques_del_col'], htmlencode($str), htmlencode($_GET['table']));
|
||||
printf($lang['ques_'.$_REQUEST['action2']], htmlencode($str), htmlencode($_GET['table']));
|
||||
echo "<br/><br/>";
|
||||
echo "<input type='submit' value='".$lang['confirm']."' class='btn'/> ";
|
||||
echo "<a href='?table=".urlencode($_GET['table'])."&action=column_view'>".$lang['cancel']."</a>";
|
||||
|
||||
@@ -163,9 +163,11 @@ $lang = array(
|
||||
"ques_drop_view" => "هل أنت متأكد من محي عرض '%s' ؟",
|
||||
"ques_del_rows" => "هل أنت متأكد من محي السطر/السطور %s من جدول '%s' ؟",
|
||||
"ques_del_db" => "هل أنت متأكد من محي بنك المعلومات '%s' ؟",
|
||||
"ques_del_col" => "هل أنت متأكد من محي العامود/العواميج %s من جدول '%s' ؟",
|
||||
"ques_column_delete" => "هل أنت متأكد من محي العامود/العواميج %s من جدول '%s' ؟",
|
||||
"ques_del_index" => "هل أنت متأكد من محي الفهرس '%s' ؟",
|
||||
"ques_del_trigger" => "هل أنت متأكد من محي المؤثر '%s' ؟",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "تصدير مع الهيكل",
|
||||
"export_data" => "تصدير مع كافة المعلومات",
|
||||
|
||||
@@ -162,9 +162,11 @@ $lang = array(
|
||||
"ques_drop_view" => "你确定要删除视图 '%s'?",
|
||||
"ques_del_rows" => "你确定要删除行 %s 从表 '%s'?",
|
||||
"ques_del_db" => "你确定要删除数据库 '%s'?",
|
||||
"ques_del_col" => "你确定要删除列 %s 从表 '%s'?",
|
||||
"ques_column_delete" => "你确定要删除列 %s 从表 '%s'?",
|
||||
"ques_del_index" => "你确定要删除索引 '%s'?",
|
||||
"ques_del_trigger" => "你确定要删除触发器 '%s'?",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "导出结构",
|
||||
"export_data" => "导出数据",
|
||||
|
||||
@@ -163,9 +163,10 @@ $lang = array(
|
||||
"ques_drop_view" => "Sind Sie sicher, dass Sie die Sicht '%s' löschen möchten?",
|
||||
"ques_del_rows" => "Sind Sie sicher, dass Sie die Zeile(n) %s aus der Tabelle '%s' löschen möchten?",
|
||||
"ques_del_db" => "Sind Sie sicher, dass Sie die Datenbank '%s' löschen möchten?",
|
||||
"ques_del_col" => "Sie Sie sicher, dass Sie die Spalten %s aus der Tabelle '%s' löschen möchten?",
|
||||
"ques_column_delete" => "Sie Sie sicher, dass Sie die Spalten %s aus der Tabelle '%s' löschen möchten?",
|
||||
"ques_del_index" => "Sind Sie sicher, dass Sie den Index '%s' löschen möchten?",
|
||||
"ques_del_trigger" => "Sind Sie sicher, dass Sie den Trigger '%s' löschen möchten?",
|
||||
"ques_primarykey_add" => "Sind Sie sicher, dass Sie einen Primärschlüssel für die Spalte(n) %s in der Tabelle '%s' anlegen möchten?",
|
||||
|
||||
"export_struct" => "Mit Struktur exportieren",
|
||||
"export_data" => "Mit Daten exportieren",
|
||||
|
||||
@@ -164,9 +164,10 @@ $lang = array(
|
||||
"ques_drop_view" => "Are you sure you want to drop the view '%s'?",
|
||||
"ques_del_rows" => "Are you sure you want to delete row(s) %s from table '%s'?",
|
||||
"ques_del_db" => "Are you sure you want to delete the database '%s'?",
|
||||
"ques_del_col" => "Are you sure you want to delete column(s) %s from table '%s'?",
|
||||
"ques_column_delete" => "Are you sure you want to delete column(s) %s from table '%s'?",
|
||||
"ques_del_index" => "Are you sure you want to delete index '%s'?",
|
||||
"ques_del_trigger" => "Are you sure you want to delete trigger '%s'?",
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "Export with structure",
|
||||
"export_data" => "Export with data",
|
||||
|
||||
@@ -159,9 +159,11 @@ $lang = array(
|
||||
"ques_drop_view" => "Êtes-vous sûr de vouloir supprimer la vue '%s' ?",
|
||||
"ques_del_rows" => "Êtes-vous sûr de vouloir supprimer la ou les ligne(s) %s de la table '%s' ?",
|
||||
"ques_del_db" => "Êtes-vous sûr de vouloir effacer la base '%s'?",
|
||||
"ques_del_col" => "Êtes-vous sûr de vouloir effacer la ou les colonne(s) %s de la table '%s' ?",
|
||||
"ques_column_delete" => "Êtes-vous sûr de vouloir effacer la ou les colonne(s) %s de la table '%s' ?",
|
||||
"ques_del_index" => "Êtes-vous sûr de vouloir effacer l'index '%s' ?",
|
||||
"ques_del_trigger" => "Êtes-vous sûr de vouloir effacer le déclencheur '%s' ?",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "Exporter avec la structure",
|
||||
"export_data" => "Exporter avec les données",
|
||||
|
||||
@@ -166,9 +166,11 @@ $lang = array(
|
||||
"ques_drop_view" => "Sei sicuro di voler eliminare la view '%s'?",
|
||||
"ques_del_rows" => "Sei sicuro di voler cancellare la(e) riga(e) %s dalla tabella '%s'?",
|
||||
"ques_del_db" => "Sei sicuro di voler cancellare il database '%s'?",
|
||||
"ques_del_col" => "Sei sicuro di voler cancellare la(e) coonna(e) \"%s\" dalla tabella '%s'?",
|
||||
"ques_column_delete" => "Sei sicuro di voler cancellare la(e) coonna(e) \"%s\" dalla tabella '%s'?",
|
||||
"ques_del_index" => "Sei sicuro di vole cancellare l'indice '%s'?",
|
||||
"ques_del_trigger" => "Sei sicuro di voler cancellare il trigger '%s'?",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "Export with structure",
|
||||
"export_data" => "Export with data",
|
||||
|
||||
@@ -158,9 +158,11 @@ $lang = array(
|
||||
"ques_drop_view" => "Tem certeza de que quer eliminar a vista (View) '%s'?",
|
||||
"ques_del_rows" => "Tem certeza de que quer eliminar a(s) linha(s) %s da tabela '%s'?",
|
||||
"ques_del_db" => "Tem certeza de que quer eliminar o banco de dados '%s'?",
|
||||
"ques_del_col" => "Tem certeza de que quer eliminar a(s) coluna(s) %s da tabela '%s'?",
|
||||
"ques_column_delete" => "Tem certeza de que quer eliminar a(s) coluna(s) %s da tabela '%s'?",
|
||||
"ques_del_index" => "Tem certeza de que quer eliminar o índice '%s'?",
|
||||
"ques_del_trigger" => "Tem certeza de que quer eliminar o gatilho (trigger) '%s'?",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "Exportar com estrutura",
|
||||
"export_data" => "Exportar com dados",
|
||||
|
||||
@@ -157,14 +157,16 @@ $lang = array(
|
||||
"syntax_err" => "В синтаксисе запроса ошибка (Запрос не был выполнен)",
|
||||
"run_sql" => "Выполнить SQL запрос(ы) в базе данных '%s'",
|
||||
|
||||
"ques_empty" => "Вы уверены, что хотите очистить таблицу '%s'?",
|
||||
"empty" => "Вы уверены, что хотите очистить таблицу '%s'?",
|
||||
"ques_drop" => "Вы уверены, что хотите удалить таблицу '%s'?",
|
||||
"ques_drop_view" => "Вы уверены, что хотите удалить представление '%s'?",
|
||||
"ques_del_rows" => "Вы уверены, что хотите удалить строку(и) %s из таблицы '%s'?",
|
||||
"ques_del_db" => "Вы уверены, что хотите удалить базу данных '%s'?",
|
||||
"ques_del_col" => "Вы уверены, что хотите удалить поле(я) %s из таблицы '%s'?",
|
||||
"ques_column_delete" => "Вы уверены, что хотите удалить поле(я) %s из таблицы '%s'?",
|
||||
"ques_del_index" => "Вы уверены, что хотите удалить индекс '%s'?",
|
||||
"ques_del_trigger" => "Вы уверены, что хотите удалить триггер '%s'?",
|
||||
#todo: translate
|
||||
"ques_primarykey_add" => "Are you sure you want to add a primary key for the column(s) %s in table '%s'?",
|
||||
|
||||
"export_struct" => "Экспорт структуры",
|
||||
"export_data" => "Экспорт данных",
|
||||
|
||||
Reference in New Issue
Block a user