';if(!$l)echo"<pclass='error'>".'You have no privileges to update this table.'."\n";else{echo"<tablecellspacing='0'onkeydown='return editingKeydown(event);'>\n";foreach($l
';if(!$l)echo"<pclass='error'>".'You have no privileges to update this table.'."\n";else{echo"<tablecellspacing='0'onkeydown='return editingKeydown(event);'>\n";foreach($l
select($Q,$N,$Z,$r,$ee=array(),$z=1,$F=0,$Ie=false){global$b,$x;$Vc=(count($r)<count($N));$I=$b->selectQueryBuild($N,$Z,$r,$ee,$z,$F);if(!$I)$I="SELECT".limit(($_GET["page"]!="last"&&+$z&&$r&&$Vc&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$N)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):""),($z!=""?+$z:null),($F?$z*$F:0),"\n");$Bf=microtime(true);$K=$this->_conn->query($I);if($Ie)echo$b->selectQuery($I,format_time($Bf));return$K;}function
select($Q,$N,$Z,$r,$ee=array(),$z=1,$F=0,$Ie=false){global$b,$x;$Vc=(count($r)<count($N));$I=$b->selectQueryBuild($N,$Z,$r,$ee,$z,$F);if(!$I)$I="SELECT".limit(((isset($_GET["page"])?$_GET["page"]:null)!="last"&&+$z&&$r&&$Vc&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$N)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):""),($z!=""?+$z:null),($F?$z*$F:0),"\n");$Bf=microtime(true);$K=$this->_conn->query($I);if($Ie)echo$b->selectQuery($I,format_time($Bf));return$K;}function
as$s=>$u){if($u["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$K[]="MATCH (".implode(", ",array_map('idf_escape',$u["columns"])).") AGAINST (".q($_GET["fulltext"][$s]).(isset($_GET["boolean"][$s])?" IN BOOLEAN MODE":"").")";}foreach((array)$_GET["where"]as$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$cb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$Lc=process_length($X["val"]);$cb.=" ".($Lc!=""?$Lc:"(NULL)");}elseif($X["op"]=="SQL")$cb=" $X[val]";elseif($X["op"]=="LIKE %%")$cb=" LIKE ".$this->processInput($l[$X["col"]],"%$X[val]%");elseif(!preg_match('~NULL$~',$X["op"]))$cb.=" ".$this->processInput($l[$X["col"]],$X["val"]);if($X["col"]!="")$K[]=idf_escape($X["col"]).$cb;else{$Xa=array();foreach($l
as$s=>$u){if($u["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$K[]="MATCH (".implode(", ",array_map('idf_escape',$u["columns"])).") AGAINST (".q($_GET["fulltext"][$s]).(isset($_GET["boolean"][$s])?" IN BOOLEAN MODE":"").")";}foreach((array)(isset($_GET["where"])?$_GET["where"]:null)as$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$cb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$Lc=process_length($X["val"]);$cb.=" ".($Lc!=""?$Lc:"(NULL)");}elseif($X["op"]=="SQL")$cb=" $X[val]";elseif($X["op"]=="LIKE %%")$cb=" LIKE ".$this->processInput($l[$X["col"]],"%$X[val]%");elseif(!preg_match('~NULL$~',$X["op"]))$cb.=" ".$this->processInput($l[$X["col"]],$X["val"]);if($X["col"]!="")$K[]=idf_escape($X["col"]).$cb;else{$Xa=array();foreach($l
as$E=>$k){$Xc=preg_match('~char|text|enum|set~',$k["type"]);if((is_numeric($X["val"])||!preg_match('~(^|[^o])int|float|double|decimal|bit~',$k["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||$Xc)){$E=idf_escape($E);$Xa[]=($x=="sql"&&$Xc&&!preg_match('~^utf8~',$k["collation"])?"CONVERT($E USING utf8)":$E);}}$K[]=($Xa?"(".implode("$cb OR ",$Xa)."$cb)":"0");}}}return$K;}function
as$E=>$k){$Xc=preg_match('~char|text|enum|set~',$k["type"]);if((is_numeric($X["val"])||!preg_match('~(^|[^o])int|float|double|decimal|bit~',$k["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||$Xc)){$E=idf_escape($E);$Xa[]=($x=="sql"&&$Xc&&!preg_match('~^utf8~',$k["collation"])?"CONVERT($E USING utf8)":$E);}}$K[]=($Xa?"(".implode("$cb OR ",$Xa)."$cb)":"0");}}}return$K;}function
as$E=>$k){if(!isset($k["privileges"][$_g?"update":"insert"])||$b->fieldName($k)=="")unset($l[$E]);}if($_POST&&!$j&&!isset($_GET["select"])){$A=$_POST["referer"];if($_POST["insert"])$A=($_g?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$A))$A=ME."select=".urlencode($a);$v=indexes($a);$vg=unique_array($_GET["where"],$v);$Re="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($A,'Item has been deleted.',$i->delete($a,$Re,!$vg));else{$P=array();foreach($l
as$E=>$k){if(!isset($k["privileges"][$_g?"update":"insert"])||$b->fieldName($k)=="")unset($l[$E]);}if($_POST&&!$j&&!isset($_GET["select"])){$A=$_POST["referer"];if($_POST["insert"])$A=($_g?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$A))$A=ME."select=".urlencode($a);$v=indexes($a);$vg=unique_array($_GET["where"],$v);$Re="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($A,'Item has been deleted.',$i->delete($a,$Re,!$vg));else{$P=array();foreach($l
as$E=>$k){$X=process_input($k);if($X!==false&&$X!==null)$P[idf_escape($E)]=$X;}if($_g){if(!$P)redirect($A);queries_redirect($A,'Item has been updated.',$i->update($a,$P,$Re,!$vg));if(is_ajax()){page_headers();page_messages($j);exit;}}else{$J=$i->insert($a,$P);$gd=($J?last_id():0);queries_redirect($A,sprintf('Item%s has been inserted.',($gd?" $gd":"")),$J);}}}$L=null;if($_POST["save"])$L=(array)$_POST["fields"];elseif($Z){$N=array();foreach($l
as$E=>$k){$X=process_input($k);if($X!==false&&$X!==null)$P[idf_escape($E)]=$X;}if($_g){if(!$P)redirect($A);queries_redirect($A,'Item has been updated.',$i->update($a,$P,$Re,!$vg));if(is_ajax()){page_headers();page_messages($j);exit;}}else{$J=$i->insert($a,$P);$gd=($J?last_id():0);queries_redirect($A,sprintf('Item%s has been inserted.',($gd?" $gd":"")),$J);}}}$L=null;if($_POST["save"])$L=(array)$_POST["fields"];elseif($Z){$N=array();foreach($l
as$E=>$k){if(isset($k["privileges"]["select"])){$ua=convert_field($k);if($_POST["clone"]&&$k["auto_increment"])$ua="''";if($x=="sql"&&preg_match("~enum|set~",$k["type"]))$ua="1*".idf_escape($E);$N[]=($ua?"$ua AS ":"").idf_escape($E);}}$L=array();if(!support("table"))$N=array("*");if($N){$J=$i->select($a,$N,array($Z),$N,array(),(isset($_GET["select"])?2:1));$L=$J->fetch_assoc();if(!$L)$L=false;if(isset($_GET["select"])&&(!$L||$J->fetch_assoc()))$L=null;}}if(!support("table")&&!$l){if(!$Z){$J=$i->select($a,array("*"),$Z,array("*"));$L=($J?$J->fetch_assoc():false);if(!$L)$L=array($i->primary=>"");}if($L){foreach($L
as$E=>$k){if(isset($k["privileges"]["select"])){$ua=convert_field($k);if(!empty($_POST["clone"])&&!empty($k["auto_increment"]))$ua="''";if($x=="sql"&&preg_match("~enum|set~",$k["type"]))$ua="1*".idf_escape($E);$N[]=($ua?"$ua AS ":"").idf_escape($E);}}$L=array();if(!support("table"))$N=array("*");if($N){$J=$i->select($a,$N,array($Z),$N,array(),(isset($_GET["select"])?2:1));$L=$J->fetch_assoc();if(!$L)$L=false;if(isset($_GET["select"])&&(!$L||$J->fetch_assoc()))$L=null;}}if(!support("table")&&!$l){if(!$Z){$J=$i->select($a,array("*"),$Z,array("*"));$L=($J?$J->fetch_assoc():false);if(!$L)$L=array($i->primary=>"");}if($L){foreach($L
as$Of=>$k)$n[str_replace("`","``",$Of)."`".str_replace("`","``",$k["field"])]=$Of;$ke=array();$R=array();if($a!=""){$ke=fields($a);$R=table_status($a);if(!$R)$j='No tables.';}$L=$_POST;$L["fields"]=(array)$L["fields"];if($L["auto_increment_col"])$L["fields"][$L["auto_increment_col"]]["auto_increment"]=true;if($_POST&&!process_fields($L["fields"])&&!$j){if($_POST["drop"])queries_redirect(substr(ME,0,-1),'Table has been dropped.',drop_tables(array($a)));else{$l=array();$ra=array();$Cg=false;$qc=array();ksort($L["fields"]);$je=reset($ke);$pa=" FIRST";foreach($L["fields"]as$y=>$k){$m=$n[$k["type"]];$qg=($m!==null?$Xe[$m]:$k);if($k["field"]!=""){if(!$k["has_default"])$k["default"]=null;if($y==$L["auto_increment_col"])$k["auto_increment"]=true;$Ne=process_field($k,$qg);$ra[]=array($k["orig"],$Ne,$pa);if($Ne!=process_field($je,$je)){$l[]=array($k["orig"],$Ne,$pa);if($k["orig"]!=""||$pa)$Cg=true;}if($m!==null)$qc[idf_escape($k["field"])]=($a!=""&&$x!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$n[$k["type"]],'source'=>array($k["field"]),'target'=>array($qg["field"]),'on_delete'=>$k["on_delete"],));$pa=" AFTER ".idf_escape($k["field"]);}elseif($k["orig"]!=""){$Cg=true;$l[]=array($k["orig"]);}if($k["orig"]!=""){$je=next($ke);if(!$je)$pa="";}}$ue="";if($se[$L["partition_by"]]){$ve=array();if($L["partition_by"]=='RANGE'||$L["partition_by"]=='LIST'){foreach(array_filter($L["partition_names"])as$y=>$X){$Y=$L["partition_values"][$y];$ve[]="\n PARTITION ".idf_escape($X)." VALUES ".($L["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$ue.="\nPARTITION BY $L[partition_by]($L[partition])".($ve?" (".implode(",",$ve)."\n)":($L["partitions"]?" PARTITIONS ".(+$L["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$ue.="\nREMOVE PARTITIONING";$C='Table has been altered.';if($a==""){cookie("adminer_engine",$L["Engine"]);$C='Table has been created.';}$E=trim($L["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($E),$C,alter_table($a,$E,($x=="sqlite"&&($Cg||$qc)?$ra:$l),$qc,$L["Comment"],($L["Engine"]&&$L["Engine"]!=$R["Engine"]?$L["Engine"]:""),($L["Collation"]&&$L["Collation"]!=$R["Collation"]?$L["Collation"]:""),($L["Auto_increment"]!=""?+$L["Auto_increment"]:""),$ue));}}page_header(($a!=""?'Alter table':'Create table'),$j,array("table"=>$a),h($a));if(!$_POST){$L=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($sg["int"])?"int":(isset($sg["integer"])?"integer":"")))),"partition_names"=>array(""),);if($a!=""){$L=$R;$L["name"]=$a;$L["fields"]=array();if(!$_GET["auto_increment"])$L["Auto_increment"]="";foreach($ke
as$Of=>$k)$n[str_replace("`","``",$Of)."`".str_replace("`","``",$k["field"])]=$Of;$ke=array();$R=array();if($a!=""){$ke=fields($a);$R=table_status($a);if(!$R)$j='No tables.';}$L=$_POST;$L["fields"]=(array)$L["fields"];if($L["auto_increment_col"])$L["fields"][$L["auto_increment_col"]]["auto_increment"]=true;if($_POST&&!process_fields($L["fields"])&&!$j){if($_POST["drop"])queries_redirect(substr(ME,0,-1),'Table has been dropped.',drop_tables(array($a)));else{$l=array();$ra=array();$Cg=false;$qc=array();ksort($L["fields"]);$je=reset($ke);$pa=" FIRST";foreach($L["fields"]as$y=>$k){$m=$n[$k["type"]];$qg=($m!==null?$Xe[$m]:$k);if($k["field"]!=""){if(!$k["has_default"])$k["default"]=null;if($y==$L["auto_increment_col"])$k["auto_increment"]=true;$Ne=process_field($k,$qg);$ra[]=array($k["orig"],$Ne,$pa);if($Ne!=process_field($je,$je)){$l[]=array($k["orig"],$Ne,$pa);if($k["orig"]!=""||$pa)$Cg=true;}if($m!==null)$qc[idf_escape($k["field"])]=($a!=""&&$x!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$n[$k["type"]],'source'=>array($k["field"]),'target'=>array($qg["field"]),'on_delete'=>$k["on_delete"],));$pa=" AFTER ".idf_escape($k["field"]);}elseif($k["orig"]!=""){$Cg=true;$l[]=array($k["orig"]);}if($k["orig"]!=""){$je=next($ke);if(!$je)$pa="";}}$ue="";if($se[$L["partition_by"]]){$ve=array();if($L["partition_by"]=='RANGE'||$L["partition_by"]=='LIST'){foreach(array_filter($L["partition_names"])as$y=>$X){$Y=$L["partition_values"][$y];$ve[]="\n PARTITION ".idf_escape($X)." VALUES ".($L["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$ue.="\nPARTITION BY $L[partition_by]($L[partition])".($ve?" (".implode(",",$ve)."\n)":($L["partitions"]?" PARTITIONS ".(+$L["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$ue.="\nREMOVE PARTITIONING";$C='Table has been altered.';if($a==""){cookie("adminer_engine",$L["Engine"]);$C='Table has been created.';}$E=trim($L["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($E),$C,alter_table($a,$E,($x=="sqlite"&&($Cg||$qc)?$ra:$l),$qc,$L["Comment"],($L["Engine"]&&$L["Engine"]!=$R["Engine"]?$L["Engine"]:""),($L["Collation"]&&$L["Collation"]!=$R["Collation"]?$L["Collation"]:""),($L["Auto_increment"]!=""?+$L["Auto_increment"]:""),$ue));}}page_header(($a!=""?'Alter table':'Create table'),$j,array("table"=>$a),h($a));if(!$_POST){$L=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($sg["int"])?"int":(isset($sg["integer"])?"integer":"")))),"partition_names"=>array(""),);if($a!=""){$L=$R;$L["name"]=$a;$L["fields"]=array();if(!$_GET["auto_increment"])$L["Auto_increment"]="";foreach($ke
as$k){$k["has_default"]=isset($k["default"]);$L["fields"][]=$k;}if(support("partitioning")){$vc="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$J=$e->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $vc ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($L["partition_by"],$L["partitions"],$L["partition"])=$J->fetch_row();$ve=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $vc AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$ve[""]="";$L["partition_names"]=array_keys($ve);$L["partition_values"]=array_values($ve);}}}$Wa=collations();$Tb=engines();foreach($Tb
as$k){$k["has_default"]=isset($k["default"]);$L["fields"][]=$k;}if(support("partitioning")){$vc="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$J=$e->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $vc ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($L["partition_by"],$L["partitions"],$L["partition"])=$J->fetch_row();$ve=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $vc AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$ve[""]="";$L["partition_names"]=array_keys($ve);$L["partition_values"]=array_values($ve);}}}$Wa=collations();$Tb=engines();foreach($Tb
';if(support("kill")){echo($s+1)."/".sprintf('%d in total',$e->result("SELECT @@max_connections")),"<p><inputtype='submit'value='".'Kill'."'>\n";}echo'<inputtype="hidden"name="token"value="',$T,'">
';if(support("kill")){echo($s+1)."/".sprintf('%d in total',$e->result("SELECT @@max_connections")),"<p><inputtype='submit'value='".'Kill'."'>\n";}echo'<inputtype="hidden"name="token"value="',$T,'">
as$y=>$k){$E=$b->fieldName($k);if(isset($k["privileges"]["select"])&&$E!=""){$d[$y]=html_entity_decode(strip_tags($E),ENT_QUOTES);if(is_shortable($k))$Zf=$b->selectLengthProcess();}$gf+=$k["privileges"];}list($N,$r)=$b->selectColumnsProcess($d,$v);$Vc=count($r)<count($N);$Z=$b->selectSearchProcess($l,$v);$ee=$b->selectOrderProcess($l,$v);$z=$b->selectLimitProcess();$vc=($N?implode(", ",$N):"*".($Qd?", $Qd":"")).convert_fields($d,$l,$N)."\nFROM ".table($a);$zc=($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):"");if($_GET["val"]&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$wg=>$L){$ua=convert_field($l[key($L)]);$N=array($ua?$ua:idf_escape(key($L)));$Z[]=where_check($wg,$l);$K=$i->select($a,$N,$Z,$N);if($K)echo
as$y=>$k){$E=$b->fieldName($k);if(isset($k["privileges"]["select"])&&$E!=""){$d[$y]=html_entity_decode(strip_tags($E),ENT_QUOTES);if(is_shortable($k))$Zf=$b->selectLengthProcess();}$gf+=$k["privileges"];}list($N,$r)=$b->selectColumnsProcess($d,$v);$Vc=count($r)<count($N);$Z=$b->selectSearchProcess($l,$v);$ee=$b->selectOrderProcess($l,$v);$z=$b->selectLimitProcess();$vc=($N?implode(", ",$N):"*".($Qd?", $Qd":"")).convert_fields($d,$l,$N)."\nFROM ".table($a);$zc=($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):"");if((isset($_GET["val"])?$_GET["val"]:false)&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$wg=>$L){$ua=convert_field($l[key($L)]);$N=array($ua?$ua:idf_escape(key($L)));$Z[]=where_check($wg,$l);$K=$i->select($a,$N,$Z,$N);if($K)echo
reset($K->fetch_row());}exit;}if($_POST&&!$j){$Og=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$Na=array();foreach($_POST["check"]as$La)$Na[]=where_check($La,$l);$Og[]="((".implode(") OR (",$Na)."))";}$Og=($Og?"\nWHERE ".implode(" AND ",$Og):"");$He=$yg=null;foreach($v
reset($K->fetch_row());}exit;}if($_POST&&!$j){$Og=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$Na=array();foreach($_POST["check"]as$La)$Na[]=where_check($La,$l);$Og[]="((".implode(") OR (",$Na)."))";}$Og=($Og?"\nWHERE ".implode(" AND ",$Og):"");$He=$yg=null;foreach($v
as$y=>$X){if(in_array(idf_escape($y),$N))unset($yg[$y]);}if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");if(!is_array($_POST["check"])||$yg===array())$I="SELECT $vc$Og$zc";else{$ug=array();foreach($_POST["check"]as$X)$ug[]="(SELECT".limit($vc,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l).$zc,1).")";$I=implode(" UNION ALL ",$ug);}$b->dumpData($a,"table",$I);exit;}if(!$b->selectEmailProcess($Z,$n)){if($_POST["save"]||$_POST["delete"]){$J=true;$na=0;$P=array();if(!$_POST["delete"]){foreach($d
as$y=>$X){if(in_array(idf_escape($y),$N))unset($yg[$y]);}if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");if(!is_array($_POST["check"])||$yg===array())$I="SELECT $vc$Og$zc";else{$ug=array();foreach($_POST["check"]as$X)$ug[]="(SELECT".limit($vc,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l).$zc,1).")";$I=implode(" UNION ALL ",$ug);}$b->dumpData($a,"table",$I);exit;}if(!$b->selectEmailProcess($Z,$n)){if($_POST["save"]||$_POST["delete"]){$J=true;$na=0;$P=array();if(!$_POST["delete"]){foreach($d
as$E=>$X){$X=process_input($l[$E]);if($X!==null&&($_POST["clone"]||$X!==false))$P[idf_escape($E)]=($X!==false?$X:idf_escape($E));}}if($_POST["delete"]||$P){if($_POST["clone"])$I="INTO ".table($a)." (".implode(", ",array_keys($P)).")\nSELECT ".implode(", ",$P)."\nFROM ".table($a);if($_POST["all"]||($yg===array()&&is_array($_POST["check"]))||$Vc){$J=($_POST["delete"]?$i->delete($a,$Og):($_POST["clone"]?queries("INSERT $I$Og"):$i->update($a,$P,$Og)));$na=$e->affected_rows;}else{foreach((array)$_POST["check"]as$X){$Ng="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l);$J=($_POST["delete"]?$i->delete($a,$Ng,1):($_POST["clone"]?queries("INSERT".limit1($I,$Ng)):$i->update($a,$P,$Ng)));if(!$J)break;$na+=$e->affected_rows;}}}$C=lang(array('%d item has been affected.','%d items have been affected.'),$na);if($_POST["clone"]&&$J&&$na==1){$gd=last_id();if($gd)$C=sprintf('Item%s has been inserted.'," $gd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$C,$J);if(!$_POST["delete"]){edit_form($a,$l,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$j='Ctrl+click on a value to modify it.';else{$J=true;$na=0;foreach($_POST["val"]as$wg=>$L){$P=array();foreach($L
as$E=>$X){$X=process_input($l[$E]);if($X!==null&&($_POST["clone"]||$X!==false))$P[idf_escape($E)]=($X!==false?$X:idf_escape($E));}}if($_POST["delete"]||$P){if($_POST["clone"])$I="INTO ".table($a)." (".implode(", ",array_keys($P)).")\nSELECT ".implode(", ",$P)."\nFROM ".table($a);if($_POST["all"]||($yg===array()&&is_array($_POST["check"]))||$Vc){$J=($_POST["delete"]?$i->delete($a,$Og):($_POST["clone"]?queries("INSERT $I$Og"):$i->update($a,$P,$Og)));$na=$e->affected_rows;}else{foreach((array)$_POST["check"]as$X){$Ng="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l);$J=($_POST["delete"]?$i->delete($a,$Ng,1):($_POST["clone"]?queries("INSERT".limit1($I,$Ng)):$i->update($a,$P,$Ng)));if(!$J)break;$na+=$e->affected_rows;}}}$C=lang(array('%d item has been affected.','%d items have been affected.'),$na);if($_POST["clone"]&&$J&&$na==1){$gd=last_id();if($gd)$C=sprintf('Item%s has been inserted.'," $gd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$C,$J);if(!$_POST["delete"]){edit_form($a,$l,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$j='Ctrl+click on a value to modify it.';else{$J=true;$na=0;foreach($_POST["val"]as$wg=>$L){$P=array();foreach($L
as$y=>$X){$y=bracket_escape($y,1);$P[idf_escape($y)]=(preg_match('~char|text~',$l[$y]["type"])||$X!=""?$b->processInput($l[$y],$X):"NULL");}$J=$i->update($a,$P," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($wg,$l),!($Vc||$yg===array())," ");if(!$J)break;$na+=$e->affected_rows;}queries_redirect(remove_from_uri(),lang(array('%d item has been affected.','%d items have been affected.'),$na),$J);}}elseif(!is_string($lc=get_file("csv_file",true)))$j=upload_error($lc);elseif(!preg_match('~~u',$lc))$j='File must be in UTF-8 encoding.';else{cookie("adminer_import","output=".urlencode($ma["output"])."&format=".urlencode($_POST["separator"]));$J=true;$Xa=array_keys($l);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$lc,$sd);$na=count($sd[0]);$i->begin();$sf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$M=array();foreach($sd[0]as$y=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$sf]*)$sf~",$X.$sf,$td);if(!$y&&!array_diff($td[1],$Xa)){$Xa=$td[1];$na--;}else{$P=array();foreach($td[1]as$s=>$Ta)$P[idf_escape($Xa[$s])]=($Ta==""&&$l[$Xa[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ta))));$M[]=$P;}}$J=(!$M||$i->insertUpdate($a,$M,$He));if($J)$i->commit();queries_redirect(remove_from_uri("page"),lang(array('%d row has been imported.','%d rows have been imported.'),$na),$J);$i->rollback();}}}$Of=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
as$y=>$X){$y=bracket_escape($y,1);$P[idf_escape($y)]=(preg_match('~char|text~',$l[$y]["type"])||$X!=""?$b->processInput($l[$y],$X):"NULL");}$J=$i->update($a,$P," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($wg,$l),!($Vc||$yg===array())," ");if(!$J)break;$na+=$e->affected_rows;}queries_redirect(remove_from_uri(),lang(array('%d item has been affected.','%d items have been affected.'),$na),$J);}}elseif(!is_string($lc=get_file("csv_file",true)))$j=upload_error($lc);elseif(!preg_match('~~u',$lc))$j='File must be in UTF-8 encoding.';else{cookie("adminer_import","output=".urlencode($ma["output"])."&format=".urlencode($_POST["separator"]));$J=true;$Xa=array_keys($l);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$lc,$sd);$na=count($sd[0]);$i->begin();$sf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$M=array();foreach($sd[0]as$y=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$sf]*)$sf~",$X.$sf,$td);if(!$y&&!array_diff($td[1],$Xa)){$Xa=$td[1];$na--;}else{$P=array();foreach($td[1]as$s=>$Ta)$P[idf_escape($Xa[$s])]=($Ta==""&&$l[$Xa[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ta))));$M[]=$P;}}$J=(!$M||$i->insertUpdate($a,$M,$He));if($J)$i->commit();queries_redirect(remove_from_uri("page"),lang(array('%d row has been imported.','%d rows have been imported.'),$na),$J);$i->rollback();}}}$Of=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
page_header('Select'.": $Of",$j);$P=null;if(isset($gf["insert"])||!support("table")){$P="";foreach((array)$_GET["where"]as$X){if(count($n[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$P.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$P);if(!$d&&support("table"))echo"<pclass='error'>".'Unable to select the table'.($l?".":": ".error())."\n";else{echo"<formaction=''id='form'>\n","<divstyle='display: none;'>";hidden_fields_get();echo(DB!=""?'<inputtype="hidden"name="db"value="'.h(DB).'">'.(isset($_GET["ns"])?'<inputtype="hidden"name="ns"value="'.h($_GET["ns"]).'">':""):"");echo'<inputtype="hidden"name="select"value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($N,$d);$b->selectSearchPrint($Z,$d,$v);$b->selectOrderPrint($ee,$d,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($Zf);$b->selectActionPrint($v);echo"</form>\n";$F=$_GET["page"];if($F=="last"){$uc=$e->result(count_rows($a,$Z,$Vc,$r));$F=floor(max(0,$uc-1)/$z);}$pf=$N;if(!$pf){$pf[]="*";if($Qd)$pf[]=$Qd;}$hb=convert_fields($d,$l,$N);if($hb)$pf[]=substr($hb,2);$J=$i->select($a,$pf,$Z,$r,$ee,$z,$F,true);if(!$J)echo"<pclass='error'>".error()."\n";else{if($x=="mssql"&&$F)$J->seek($z*$F);$Qb=array();echo"<formaction=''method='post'enctype='multipart/form-data'>\n";$M=array();while($L=$J->fetch_assoc()){if($F&&$x=="oracle")unset($L["RNUM"]);$M[]=$L;}if($_GET["page"]!="last"&&+$z&&$r&&$Vc&&$x=="sql")$uc=$e->result(" SELECT FOUND_ROWS()");if(!$M)echo"<pclass='message'>".'No rows.'."\n";else{$Ba=$b->backwardKeys($a,$Of);echo"<tableid='table'cellspacing='0'class='nowrap checkable'onclick='tableClick(event);'ondblclick='tableClick(event, true);'onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$r&&$N?"":"<td><inputtype='checkbox'id='all-page'onclick='formCheck(this, /check/);'><ahref='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".'Modify'."</a>");$Hd=array();$xc=array();reset($N);$Te=1;foreach($M[0]as$y=>$X){if($y!=$Qd){$X=$_GET["columns"][key($N)];$k=$l[$N?($X?$X["col"]:current($N)):$y];$E=($k?$b->fieldName($k,$Te):($X["fun"]?"*":$y));if($E!=""){$Te++;$Hd[$y]=$E;$c=idf_escape($y);$Hc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);$xb="&desc%5B0%5D=1";echo'<thonmouseover="columnMouse(this);"onmouseout="columnMouse(this, \' hidden\');">','<ahref="'.h($Hc.($ee[0]==$c||$ee[0]==$y||(!$ee&&$Vc&&$r[0]==$c)?$xb:'')).'">';echo
page_header('Select'.": $Of",$j);$P=null;if(isset($gf["insert"])||!support("table")){$P="";foreach((array)(isset($_GET["where"])?$_GET["where"]:null)as$X){if(count($n[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$P.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$P);if(!$d&&support("table"))echo"<pclass='error'>".'Unable to select the table'.($l?".":": ".error())."\n";else{echo"<formaction=''id='form'>\n","<divstyle='display: none;'>";hidden_fields_get();echo(DB!=""?'<inputtype="hidden"name="db"value="'.h(DB).'">'.(isset($_GET["ns"])?'<inputtype="hidden"name="ns"value="'.h($_GET["ns"]).'">':""):"");echo'<inputtype="hidden"name="select"value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($N,$d);$b->selectSearchPrint($Z,$d,$v);$b->selectOrderPrint($ee,$d,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($Zf);$b->selectActionPrint($v);echo"</form>\n";$F=(isset($_GET["page"])?$_GET["page"]:null);if($F=="last"){$uc=$e->result(count_rows($a,$Z,$Vc,$r));$F=floor(max(0,$uc-1)/$z);}$pf=$N;if(!$pf){$pf[]="*";if($Qd)$pf[]=$Qd;}$hb=convert_fields($d,$l,$N);if($hb)$pf[]=substr($hb,2);$J=$i->select($a,$pf,$Z,$r,$ee,$z,$F,true);if(!$J)echo"<pclass='error'>".error()."\n";else{if($x=="mssql"&&$F)$J->seek($z*$F);$Qb=array();echo"<formaction=''method='post'enctype='multipart/form-data'>\n";$M=array();while($L=$J->fetch_assoc()){if($F&&$x=="oracle")unset($L["RNUM"]);$M[]=$L;}if((isset($_GET["page"])?$_GET["page"]:null)!="last"&&+$z&&$r&&$Vc&&$x=="sql")$uc=$e->result(" SELECT FOUND_ROWS()");if(!$M)echo"<pclass='message'>".'No rows.'."\n";else{$Ba=$b->backwardKeys($a,$Of);echo"<tableid='table'cellspacing='0'class='nowrap checkable'onclick='tableClick(event);'ondblclick='tableClick(event, true);'onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$r&&$N?"":"<td><inputtype='checkbox'id='all-page'onclick='formCheck(this, /check/);'><ahref='".h((isset($_GET["modify"])?$_GET["modify"]:null)?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".'Modify'."</a>");$Hd=array();$xc=array();reset($N);$Te=1;foreach((isset($M[0])?$M[0]:null)as$y=>$X){if($y!=$Qd){$X=(isset($_GET["columns"])?$_GET["columns"][key($N)]:null);$k=$l[$N?($X?$X["col"]:current($N)):$y];$E=($k?$b->fieldName($k,$Te):($X["fun"]?"*":$y));if($E!=""){$Te++;$Hd[$y]=$E;$c=idf_escape($y);$Hc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);$xb="&desc%5B0%5D=1";echo'<thonmouseover="columnMouse(this);"onmouseout="columnMouse(this, \' hidden\');">','<ahref="'.h($Hc.((isset($ee[0])?$ee[0]:null)==$c||(isset($ee[0])?$ee[0]:null)==$y||(!$ee&&$Vc&&$r[0]==$c)?$xb:'')).'">';echo
as$y=>$X)json_row("sum-$y",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$e->query("KILL ".(+$_POST["kill"]));else{foreach(count_tables($b->databases())as$h=>$X){json_row("tables-$h",$X);json_row("size-$h",db_size($h));}json_row("");}exit;}else{$Tf=array_merge((array)(isset($_POST["tables"])?$_POST["tables"]:null),(array)(isset($_POST["views"])?$_POST["views"]:null));if($Tf&&!$j&&!$_POST["search"]){$J=true;$C="";if($x=="sql"&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$J=truncate_tables($_POST["tables"]);$C='Tables have been truncated.';}elseif($_POST["move"]){$J=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been moved.';}elseif($_POST["copy"]){$J=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been copied.';}elseif($_POST["drop"]){if($_POST["views"])$J=drop_views($_POST["views"]);if($J&&$_POST["tables"])$J=drop_tables($_POST["tables"]);$C='Tables have been dropped.';}elseif($x!="sql"){$J=($x=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$C='Tables have been optimized.';}elseif(!$_POST["tables"])$C='No tables.';elseif($J=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($L=$J->fetch_assoc())$C.="<b>".h($L["Table"])."</b>: ".h($L["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$C,$J);}page_header((empty($_GET["ns"])?'Database'.": ".h(DB):'Schema'.": ".h(empty($_GET["ns"])?null:$_GET["ns"])),$j,true);if($b->homepage()){if((isset($_GET["ns"])?$_GET["ns"]:null)!==""){echo"<h3id='tables-views'>".'Tables and views'."</h3>\n";$Sf=tables_list();if(!$Sf)echo"<pclass='message'>".'No tables.'."\n";else{echo"<formaction=''method='post'>\n";if(support("table")){echo"<fieldset><legend>".'Search data in tables'." <spanid='selected2'></span></legend><div>","<inputtype='search'name='query'value='".h($_POST["query"])."'><inputtype='submit'name='search'value='".'Search'."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!="")search_tables();}echo"<tablecellspacing='0'class='nowrap checkable'onclick='tableClick(event);'ondblclick='tableClick(event, true);'>\n",'<thead><trclass="wrap"><td><inputid="check-all"type="checkbox"onclick="formCheck(this, /^(tables|views)\[/);">','<th>'.'Table','<td>'.'Engine','<td>'.'Collation','<td>'.'Data Length','<td>'.'Index Length','<td>'.'Data Free','<td>'.'Auto Increment','<td>'.'Rows',(support("comment")?'<td>'.'Comment':''),"</thead>\n";$S=0;foreach($Sf
as$y=>$X)json_row("sum-$y",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$e->query("KILL ".(+$_POST["kill"]));else{foreach(count_tables($b->databases())as$h=>$X){json_row("tables-$h",$X);json_row("size-$h",db_size($h));}json_row("");}exit;}else{$Tf=array_merge((array)(isset($_POST["tables"])?$_POST["tables"]:null),(array)(isset($_POST["views"])?$_POST["views"]:null));if($Tf&&!$j&&!$_POST["search"]){$J=true;$C="";if($x=="sql"&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$J=truncate_tables($_POST["tables"]);$C='Tables have been truncated.';}elseif($_POST["move"]){$J=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been moved.';}elseif($_POST["copy"]){$J=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been copied.';}elseif($_POST["drop"]){if($_POST["views"])$J=drop_views($_POST["views"]);if($J&&$_POST["tables"])$J=drop_tables($_POST["tables"]);$C='Tables have been dropped.';}elseif($x!="sql"){$J=($x=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$C='Tables have been optimized.';}elseif(!$_POST["tables"])$C='No tables.';elseif($J=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($L=$J->fetch_assoc())$C.="<b>".h($L["Table"])."</b>: ".h($L["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$C,$J);}page_header((empty($_GET["ns"])?'Database'.": ".h(DB):'Schema'.": ".h(empty($_GET["ns"])?null:$_GET["ns"])),$j,true);if($b->homepage()){if((isset($_GET["ns"])?$_GET["ns"]:null)!==""){echo"<h3id='tables-views'>".'Tables and views'."</h3>\n";$Sf=tables_list();if(!$Sf)echo"<pclass='message'>".'No tables.'."\n";else{echo"<formaction=''method='post'>\n";if(support("table")){echo"<fieldset><legend>".'Search data in tables'." <spanid='selected2'></span></legend><div>","<inputtype='search'name='query'value='".h($_POST["query"])."'><inputtype='submit'name='search'value='".'Search'."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!="")search_tables();}echo"<tablecellspacing='0'class='nowrap checkable'onclick='tableClick(event);'ondblclick='tableClick(event, true);'>\n",'<thead><trclass="wrap"><td><inputid="check-all"type="checkbox"onclick="formCheck(this, /^(tables|views)\[/);">','<th>'.'Table','<td>'.'Engine','<td>'.'Collation','<td>'.'Data Length','<td>'.'Index Length','<td>'.'Data Free','<td>'.'Auto Increment','<td>'.'Rows',(support("comment")?'<td>'.'Comment':''),"</thead>\n";$S=0;foreach($Sf
as$E=>$U){$Jg=($U!==null&&!preg_match('~table~i',$U));echo'<tr'.odd().'><td>'.checkbox(($Jg?"views[]":"tables[]"),$E,in_array($E,$Tf,true),"","formUncheck('check-all');"),'<th>'.(support("table")||support("indexes")?'<ahref="'.h(ME).'table='.urlencode($E).'"title="'.'Show structure'.'">'.h($E).'</a>':h($E));if($Jg){echo'<tdcolspan="6"><ahref="'.h(ME)."view=".urlencode($E).'"title="'.'Alter view'.'">'.'View'.'</a>','<tdalign="right"><ahref="'.h(ME)."select=".urlencode($E).'"title="'.'Select data'.'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",'Alter table'),"Index_length"=>array("indexes",'Alter indexes'),"Data_free"=>array("edit",'New item'),"Auto_increment"=>array("auto_increment=1&create",'Alter table'),"Rows"=>array("select",'Select data'),)as$y=>$_){$t=" id='$y-".h($E)."'";echo($_?"<tdalign='right'>".(support("table")||$y=="Rows"||(support("indexes")&&$y!="Data_length")?"<ahref='".h(ME."$_[0]=").urlencode($E)."'$ttitle='$_[1]'>?</a>":"<span$t>?</span>"):"<tdid='$y-".h($E)."'> ");}$S++;}echo(support("comment")?"<tdid='Comment-".h($E)."'> ":"");}echo"<tr><td> <th>".sprintf('%d in total',count($Sf)),"<td>".nbsp($x=="sql"?$e->result("SELECT @@storage_engine"):""),"<td>".nbsp(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$y)echo"<tdalign='right'id='sum-$y'> ";echo"</table>\n";if(!information_schema(DB)){$Fg="<inputtype='submit'value='".'Vacuum'."'".on_help("'VACUUM'")."> ";$be="<inputtype='submit'name='optimize'value='".'Optimize'."'".on_help($x=="sql"?"'OPTIMIZETABLE'":"'VACUUMOPTIMIZE'")."> ";echo"<fieldset><legend>".'Selected'." <spanid='selected'></span></legend><div>".($x=="sqlite"?$Fg:($x=="pgsql"?$Fg.$be:($x=="sql"?"<inputtype='submit'value='".'Analyze'."'".on_help("'ANALYZETABLE'")."> ".$be."<inputtype='submit'name='check'value='".'Check'."'".on_help("'CHECKTABLE'")."> "."<inputtype='submit'name='repair'value='".'Repair'."'".on_help("'REPAIRTABLE'")."> ":"")))."<inputtype='submit'name='truncate'value='".'Truncate'."'".confirm().on_help($x=="sqlite"?"'DELETE'":"'TRUNCATE".($x=="pgsql"?"'":"TABLE'"))."> "."<inputtype='submit'name='drop'value='".'Drop'."'".confirm().on_help("'DROPTABLE'").">\n";$g=(support("scheme")?$b->schemas():$b->databases());if(count($g)!=1&&$x!="sqlite"){$h=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".'Move to other database'.": ",($g?html_select("target",$g,$h):'<inputname="target"value="'.h($h).'"autocapitalize="off">')," <inputtype='submit'name='move'value='".'Move'."'>",(support("copy")?" <inputtype='submit'name='copy'value='".'Copy'."'>":""),"\n";}echo"<inputtype='hidden'name='all'value=''onclick=\"selectCount('selected',formChecked(this,/^(tables|views)\[/));".(support("table")?"selectCount('selected2',formChecked(this,/^tables\[/)||$S);":"")."\">\n";echo"<inputtype='hidden'name='token'value='$T'>\n","</div></fieldset>\n";}echo"</form>\n","<scripttype='text/javascript'>tableCheck();</script>\n";}echo'<pclass="links"><ahref="'.h(ME).'create=">'.'Create table'."</a>\n",(support("view")?'<ahref="'.h(ME).'view=">'.'Create view'."</a>\n":"");if(support("routine")){echo"<h3id='routines'>".'Routines'."</h3>\n";$kf=routines();if($kf){echo"<tablecellspacing='0'>\n",'<thead><tr><th>'.'Name'.'<td>'.'Type'.'<td>'.'Return type'."<td> </thead>\n";odd('');foreach($kf
as$E=>$U){$Jg=($U!==null&&!preg_match('~table~i',$U));echo'<tr'.odd().'><td>'.checkbox(($Jg?"views[]":"tables[]"),$E,in_array($E,$Tf,true),"","formUncheck('check-all');"),'<th>'.(support("table")||support("indexes")?'<ahref="'.h(ME).'table='.urlencode($E).'"title="'.'Show structure'.'">'.h($E).'</a>':h($E));if($Jg){echo'<tdcolspan="6"><ahref="'.h(ME)."view=".urlencode($E).'"title="'.'Alter view'.'">'.'View'.'</a>','<tdalign="right"><ahref="'.h(ME)."select=".urlencode($E).'"title="'.'Select data'.'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",'Alter table'),"Index_length"=>array("indexes",'Alter indexes'),"Data_free"=>array("edit",'New item'),"Auto_increment"=>array("auto_increment=1&create",'Alter table'),"Rows"=>array("select",'Select data'),)as$y=>$_){$t=" id='$y-".h($E)."'";echo($_?"<tdalign='right'>".(support("table")||$y=="Rows"||(support("indexes")&&$y!="Data_length")?"<ahref='".h(ME."$_[0]=").urlencode($E)."'$ttitle='$_[1]'>?</a>":"<span$t>?</span>"):"<tdid='$y-".h($E)."'> ");}$S++;}echo(support("comment")?"<tdid='Comment-".h($E)."'> ":"");}echo"<tr><td> <th>".sprintf('%d in total',count($Sf)),"<td>".nbsp($x=="sql"?$e->result("SELECT @@storage_engine"):""),"<td>".nbsp(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$y)echo"<tdalign='right'id='sum-$y'> ";echo"</table>\n";if(!information_schema(DB)){$Fg="<inputtype='submit'value='".'Vacuum'."'".on_help("'VACUUM'")."> ";$be="<inputtype='submit'name='optimize'value='".'Optimize'."'".on_help($x=="sql"?"'OPTIMIZETABLE'":"'VACUUMOPTIMIZE'")."> ";echo"<fieldset><legend>".'Selected'." <spanid='selected'></span></legend><div>".($x=="sqlite"?$Fg:($x=="pgsql"?$Fg.$be:($x=="sql"?"<inputtype='submit'value='".'Analyze'."'".on_help("'ANALYZETABLE'")."> ".$be."<inputtype='submit'name='check'value='".'Check'."'".on_help("'CHECKTABLE'")."> "."<inputtype='submit'name='repair'value='".'Repair'."'".on_help("'REPAIRTABLE'")."> ":"")))."<inputtype='submit'name='truncate'value='".'Truncate'."'".confirm().on_help($x=="sqlite"?"'DELETE'":"'TRUNCATE".($x=="pgsql"?"'":"TABLE'"))."> "."<inputtype='submit'name='drop'value='".'Drop'."'".confirm().on_help("'DROPTABLE'").">\n";$g=(support("scheme")?$b->schemas():$b->databases());if(count($g)!=1&&$x!="sqlite"){$h=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".'Move to other database'.": ",($g?html_select("target",$g,$h):'<inputname="target"value="'.h($h).'"autocapitalize="off">')," <inputtype='submit'name='move'value='".'Move'."'>",(support("copy")?" <inputtype='submit'name='copy'value='".'Copy'."'>":""),"\n";}echo"<inputtype='hidden'name='all'value=''onclick=\"selectCount('selected',formChecked(this,/^(tables|views)\[/));".(support("table")?"selectCount('selected2',formChecked(this,/^tables\[/)||$S);":"")."\">\n";echo"<inputtype='hidden'name='token'value='$T'>\n","</div></fieldset>\n";}echo"</form>\n","<scripttype='text/javascript'>tableCheck();</script>\n";}echo'<pclass="links"><ahref="'.h(ME).'create=">'.'Create table'."</a>\n",(support("view")?'<ahref="'.h(ME).'view=">'.'Create view'."</a>\n":"");if(support("routine")){echo"<h3id='routines'>".'Routines'."</h3>\n";$kf=routines();if($kf){echo"<tablecellspacing='0'>\n",'<thead><tr><th>'.'Name'.'<td>'.'Type'.'<td>'.'Return type'."<td> </thead>\n";odd('');foreach($kf