@@ -865,7 +865,7 @@ enum_input($U,$wa,$n,$Y,$Yb=null){global$c;preg_match_all("~'((?:[^']|'')*)'~",$
865
865
<input type="submit" name="clone" value=" ' ,lang (228 ),'">
866
866
<input type="submit" name="delete" value=" ' ,lang (18 ),'"> ' ,confirm (),'</div></fieldset>
867
867
' ;}$ Cc =$ c ->dumpFormat ();foreach ((array )$ _GET ["columns " ]as $ d ){if ($ d ["fun " ]){unset($ Cc ['sql ' ]);break ;}}if ($ Cc ){print_fieldset ("export " ,lang (62 )." <span id='selected2'></span> " );$ Ie =$ c ->dumpOutput ();echo ($ Ie ?html_select ("output " ,$ Ie ,$ ma ["output " ])." " :"" ),html_select ("format " ,$ Cc ,$ ma ["format " ])," <input type='submit' name='export' value=' " .lang (62 )."'> \n" ,"</div></fieldset> \n" ;}$ c ->selectEmailPrint (array_filter ($ Xb ,'strlen ' ),$ e );}echo "</div></div> \n" ;if ($ c ->selectImportPrint ()){echo "<div> " ,"<a href='#import'> " .lang (61 )."</a> " ,script ("qsl('a').onclick = partial(toggle, 'import'); " ,"" ),"<span id='import' class='hidden'>: " ,"<input type='file' name='csv_file'> " ,html_select ("separator " ,array ("csv " =>"CSV, " ,"csv; " =>"CSV; " ,"tsv " =>"TSV " ),$ ma ["format " ],1 );echo " <input type='submit' name='import' value=' " .lang (61 )."'> " ,"</span> " ,"</div> " ;}echo "<input type='hidden' name='token' value=' $ T'> \n" ,"</form> \n" ,(!$ s &&$ N ?"" :script ("tableCheck(); " ));}}}if (is_ajax ()){ob_end_clean ();exit ;}}elseif (isset ($ _GET ["variables " ])){$ ig =isset ($ _GET ["status " ]);page_header ($ ig ?lang (112 ):lang (111 ));$ sh =($ ig ?show_status ():show_variables ());if (!$ sh )echo "<p class='message'> " .lang (12 )."\n" ;else {echo "<table cellspacing='0'> \n" ;foreach ($ sh
868
- as $ z =>$ X ){echo "<tr> " ,"<th><code class='jush- " .$ y .($ ig ?"status " :"set " )."'> " .h ($ z )."</code> " ,"<td> " .h ($ X );}echo "</table> \n" ;}}elseif (isset ($ _GET ["script " ])){header ("Content-Type: text/javascript; charset=utf-8 " );if ($ _GET ["script " ]=="db " ){$ rg =array ("Data_length " =>0 ,"Index_length " =>0 ,"Data_free " =>0 );foreach (table_status ()as $ E =>$ R ){json_row ("Comment- $ E " ,h ($ R ["Comment " ]));if (!is_view ($ R )){foreach (array ("Engine " ,"Collation " )as $ z )json_row ("$ z- $ E " ,h ($ R [$ z ]));foreach ($ rg +array ("Auto_increment " =>0 ,"Rows " =>0 )as $ z =>$ X ){if ($ R [$ z ]!="" ){$ X =format_number ($ R [$ z ]);json_row ("$ z- $ E " ,($ z =="Rows " &&$ X &&$ R ["Engine " ]==($ dg =="pgsql " ?"table " :"InnoDB " )?"~ $ X " :$ X ));if (isset ($ rg [$ z ]))$ rg [$ z ]+=($ R ["Engine " ]!="InnoDB " ||$ z !="Data_free " ?$ R [$ z ]:0 );}elseif (array_key_exists ($ z ,$ R ))json_row ("$ z- $ E " );}}}foreach ($ rg
868
+ as $ z =>$ X ){echo "<tr> " ,"<th><code class='jush- " .$ y .($ ig ?"status " :"set " )."'> " .h ($ z )."</code> " ,"<td> " .h ($ X );}echo "</table> \n" ;}}elseif (isset ($ _GET ["script " ])){header ("Content-Type: text/javascript; charset=utf-8 " );if ($ _GET ["script " ]=="db " ){$ rg =array ("Data_length " =>0 ,"Index_length " =>0 ,"Data_free " =>0 );foreach (table_status ()as $ E =>$ R ){json_row ("Comment- $ E " ,h ($ R ["Comment " ]));if (!is_view ($ R )){foreach (array ("Engine " ,"Collation " )as $ z )json_row ("$ z- $ E " ,h ($ R [$ z ]));foreach ($ rg +array ("Auto_increment " =>0 ,"Rows " =>0 )as $ z =>$ X ){if ($ R [$ z ]!="" ){$ X =format_number ($ R [$ z ]);json_row ("$ z- $ E " ,($ z =="Rows " &&$ X &&$ R ["Engine " ]==($ y =="pgsql " ?"table " :"InnoDB " )?"~ $ X " :$ X ));if (isset ($ rg [$ z ]))$ rg [$ z ]+=($ R ["Engine " ]!="InnoDB " ||$ z !="Data_free " ?$ R [$ z ]:0 );}elseif (array_key_exists ($ z ,$ R ))json_row ("$ z- $ E " );}}}foreach ($ rg
869
869
as $ z =>$ X )json_row ("sum- $ z " ,format_number ($ X ));json_row ("" );}elseif ($ _GET ["script " ]=="kill " )$ g ->query ("KILL " .number ($ _POST ["kill " ]));else {foreach (count_tables ($ c ->databases ())as $ k =>$ X ){json_row ("tables- $ k " ,$ X );json_row ("size- $ k " ,db_size ($ k ));}json_row ("" );}exit ;}else {$ zg =array_merge ((array )$ _POST ["tables " ],(array )$ _POST ["views " ]);if ($ zg &&!$ m &&!$ _POST ["search " ]){$ J =true ;$ D ="" ;if ($ y =="sql " &&$ _POST ["tables " ]&&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 " ]);$ D =lang (245 );}elseif ($ _POST ["move " ]){$ J =move_tables ((array )$ _POST ["tables " ],(array )$ _POST ["views " ],$ _POST ["target " ]);$ D =lang (246 );}elseif ($ _POST ["copy " ]){$ J =copy_tables ((array )$ _POST ["tables " ],(array )$ _POST ["views " ],$ _POST ["target " ]);$ D =lang (247 );}elseif ($ _POST ["drop " ]){if ($ _POST ["views " ])$ J =drop_views ($ _POST ["views " ]);if ($ J &&$ _POST ["tables " ])$ J =drop_tables ($ _POST ["tables " ]);$ D =lang (248 );}elseif ($ y !="sql " ){$ J =($ y =="sqlite " ?queries ("VACUUM " ):apply_queries ("VACUUM " .($ _POST ["optimize " ]?"" :" ANALYZE " ),$ _POST ["tables " ]));$ D =lang (249 );}elseif (!$ _POST ["tables " ])$ D =lang (9 );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 ())$ D .="<b> " .h ($ L ["Table " ])."</b>: " .h ($ L ["Msg_text " ])."<br> " ;}queries_redirect (substr (ME ,0 ,-1 ),$ D ,$ J );}page_header (($ _GET ["ns " ]=="" ?lang (26 ).": " .h (DB ):lang (189 ).": " .h ($ _GET ["ns " ])),$ m ,true );if ($ c ->homepage ()){if ($ _GET ["ns " ]!=="" ){echo "<h3 id='tables-views'> " .lang (250 )."</h3> \n" ;$ yg =tables_list ();if (!$ yg )echo "<p class='message'> " .lang (9 )."\n" ;else {echo "<form action='' method='post'> \n" ;if (support ("table " )){echo "<fieldset><legend> " .lang (251 )." <span id='selected2'></span></legend><div> " ,"<input type='search' name='query' value=' " .h ($ _POST ["query " ])."'> " ,script ("qsl('input').onkeydown = partialArg(bodyKeydown, 'search'); " ,"" )," <input type='submit' name='search' value=' " .lang (45 )."'> \n" ,"</div></fieldset> \n" ;if ($ _POST ["search " ]&&$ _POST ["query " ]!="" ){$ _GET ["where " ][0 ]["op " ]="LIKE %% " ;search_tables ();}}echo "<div class='scrollable'> \n" ,"<table cellspacing='0' class='nowrap checkable'> \n" ,script ("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)}); " ),'<thead><tr class="wrap"> ' ,'<td><input id="check-all" type="checkbox" class="jsonly"> ' .script ("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/); " ,"" ),'<th> ' .lang (124 ),'<td> ' .lang (252 ).doc_link (array ('sql ' =>'storage-engines.html ' )),'<td> ' .lang (116 ).doc_link (array ('sql ' =>'charset-charsets.html ' ,'mariadb ' =>'supported-character-sets-and-collations/ ' )),'<td> ' .lang (253 ).doc_link (array ('sql ' =>'show-table-status.html ' ,)),'<td> ' .lang (254 ).doc_link (array ('sql ' =>'show-table-status.html ' ,)),'<td> ' .lang (255 ).doc_link (array ('sql ' =>'show-table-status.html ' )),'<td> ' .lang (40 ).doc_link (array ('sql ' =>'example-auto-increment.html ' ,'mariadb ' =>'auto_increment/ ' )),'<td> ' .lang (256 ).doc_link (array ('sql ' =>'show-table-status.html ' ,)),(support ("comment " )?'<td> ' .lang (39 ).doc_link (array ('sql ' =>'show-table-status.html ' ,)):'' ),"</thead> \n" ;$ S =0 ;foreach ($ yg
870
870
as $ E =>$ U ){$ vh =($ U !==null &&!preg_match ('~table|sequence~i ' ,$ U ));$ u =h ("Table- " .$ E );echo '<tr ' .odd ().'><td> ' .checkbox (($ vh ?"views[] " :"tables[] " ),$ E ,in_array ($ E ,$ zg ,true ),"" ,"" ,"" ,$ u ),'<th> ' .(support ("table " )||support ("indexes " )?"<a href=' " .h (ME )."table= " .urlencode ($ E )."' title=' " .lang (31 )."' id=' $ u'> " .h ($ E ).'</a> ' :h ($ E ));if ($ vh ){echo '<td colspan="6"><a href=" ' .h (ME )."view= " .urlencode ($ E ).'" title=" ' .lang (32 ).'"> ' .(preg_match ('~materialized~i ' ,$ U )?lang (122 ):lang (123 )).'</a> ' ,'<td align="right"><a href=" ' .h (ME )."select= " .urlencode ($ E ).'" title=" ' .lang (30 ).'">?</a> ' ;}else {foreach (array ("Engine " =>array (),"Collation " =>array (),"Data_length " =>array ("create " ,lang (33 )),"Index_length " =>array ("indexes " ,lang (126 )),"Data_free " =>array ("edit " ,lang (34 )),"Auto_increment " =>array ("auto_increment=1&create " ,lang (33 )),"Rows " =>array ("select " ,lang (30 )),)as $ z =>$ A ){$ u =" id=' $ z- " .h ($ E )."' " ;echo ($ A ?"<td align='right'> " .(support ("table " )||$ z =="Rows " ||(support ("indexes " )&&$ z !="Data_length " )?"<a href=' " .h (ME ."$ A [0 ]= " ).urlencode ($ E )."' $ u title=' $ A [1 ]'>?</a> " :"<span $ u>?</span> " ):"<td id=' $ z- " .h ($ E )."'> " );}$ S ++;}echo (support ("comment " )?"<td id='Comment- " .h ($ E )."'> " :"" );}echo "<tr><td><th> " .lang (229 ,count ($ yg )),"<td> " .h ($ y =="sql " ?$ g ->result ("SELECT @@default_storage_engine " ):"" ),"<td> " .h (db_collation (DB ,collations ()));foreach (array ("Data_length " ,"Index_length " ,"Data_free " )as $ z )echo "<td align='right' id='sum- $ z'> " ;echo "</table> \n" ,"</div> \n" ;if (!information_schema (DB )){echo "<div class='footer'><div> \n" ;$ qh ="<input type='submit' value=' " .lang (257 )."'> " .on_help ("'VACUUM' " );$ we ="<input type='submit' name='optimize' value=' " .lang (258 )."'> " .on_help ($ y =="sql " ?"'OPTIMIZE TABLE' " :"'VACUUM OPTIMIZE' " );echo "<fieldset><legend> " .lang (120 )." <span id='selected'></span></legend><div> " .($ y =="sqlite " ?$ qh :($ y =="pgsql " ?$ qh .$ we :($ y =="sql " ?"<input type='submit' value=' " .lang (259 )."'> " .on_help ("'ANALYZE TABLE' " ).$ we ."<input type='submit' name='check' value=' " .lang (260 )."'> " .on_help ("'CHECK TABLE' " )."<input type='submit' name='repair' value=' " .lang (261 )."'> " .on_help ("'REPAIR TABLE' " ):"" )))."<input type='submit' name='truncate' value=' " .lang (262 )."'> " .on_help ($ y =="sqlite " ?"'DELETE' " :"'TRUNCATE " .($ y =="pgsql " ?"' " :" TABLE' " )).confirm ()."<input type='submit' name='drop' value=' " .lang (121 )."'> " .on_help ("'DROP TABLE' " ).confirm ()."\n" ;$ j =(support ("scheme " )?$ c ->schemas ():$ c ->databases ());if (count ($ j )!=1 &&$ y !="sqlite " ){$ k =(isset ($ _POST ["target " ])?$ _POST ["target " ]:(support ("scheme " )?$ _GET ["ns " ]:DB ));echo "<p> " .lang (263 ).": " ,($ j ?html_select ("target " ,$ j ,$ k ):'<input name="target" value=" ' .h ($ k ).'" autocapitalize="off"> ' )," <input type='submit' name='move' value=' " .lang (264 )."'> " ,(support ("copy " )?" <input type='submit' name='copy' value=' " .lang (265 )."'> " .checkbox ("overwrite " ,1 ,$ _POST ["overwrite " ],lang (266 )):"" ),"\n" ;}echo "<input type='hidden' name='all' value=''> " ;echo
871
871
script ("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/)); " .(support ("table " )?" selectCount('selected2', formChecked(this, /^tables\[/) || $ S); " :"" )." } " ),"<input type='hidden' name='token' value=' $ T'> \n" ,"</div></fieldset> \n" ,"</div></div> \n" ;}echo "</form> \n" ,script ("tableCheck(); " );}echo '<p class="links"><a href=" ' .h (ME ).'create="> ' .lang (63 )."</a> \n" ,(support ("view " )?'<a href=" ' .h (ME ).'view="> ' .lang (195 )."</a> \n" :"" );if (support ("routine " )){echo "<h3 id='routines'> " .lang (136 )."</h3> \n" ;$ Hf =routines ();if ($ Hf ){echo "<table cellspacing='0'> \n" ,'<thead><tr><th> ' .lang (176 ).'<td> ' .lang (38 ).'<td> ' .lang (212 )."<td></thead> \n" ;odd ('' );foreach ($ Hf
0 commit comments