Changeset 87842 in spip-zone


Ignore:
Timestamp:
Mar 10, 2015, 9:19:25 PM (5 years ago)
Author:
gilles.vincent@…
Message:

Mise a jour d'Adminer avec patch is_utf8 => isutf8

Location:
_plugins_/adminer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/adminer/adminer.php

    r87383 r87842  
    66* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
    77* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
    8 * @version 4.2.0
    9 */error_reporting(6135);$Kc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Kc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Gh=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Gh)$$X=$Gh;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");if(isset($_GET["file"])){if($_SERVER["HTTP_IF_MODIFIED_SINCE"]){header("HTTP/1.1 304 Not Modified");exit;}header("Expires: ".gmdate("D, d M Y H:i:s",time()+365*24*60*60)." GMT");header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");if($_GET["file"]=="favicon.ico"){header("Content-Type: image/x-icon");echo
     8* @version 4.2.1
     9*/error_reporting(6135);$Jc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Jc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Gh=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Gh)$$X=$Gh;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");if(isset($_GET["file"])){if($_SERVER["HTTP_IF_MODIFIED_SINCE"]){header("HTTP/1.1 304 Not Modified");exit;}header("Expires: ".gmdate("D, d M Y H:i:s",time()+365*24*60*60)." GMT");header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");if($_GET["file"]=="favicon.ico"){header("Content-Type: image/x-icon");echo
    1010lzw_decompress("\0\0\0` \0„\0\n @\0´C„è\"
    1111\0`EãQ¸àÿ‡?ÀtvM'”JdÁd\\Œb0\0Ä\"™Àfӈ¤îs5›ÏçÑAXPaJ“0„¥‘8„#RŠT©‘z`ˆ#.©ÇcíXÃþȀ?À-\0¡Im? .«M¶€\0ȯ(̉ý
     
    13281328number($X){return
    13291329preg_replace('~[^0-9]+~','',$X);}function
    1330 remove_slashes($If,$Kc=false){if(get_magic_quotes_gpc()){while(list($x,$X)=each($If)){foreach($X
    1331 as$Gd=>$W){unset($If[$x][$Gd]);if(is_array($W)){$If[$x][stripslashes($Gd)]=$W;$If[]=&$If[$x][stripslashes($Gd)];}else$If[$x][stripslashes($Gd)]=($Kc?$W:stripslashes($W));}}}}function
     1330remove_slashes($If,$Jc=false){if(get_magic_quotes_gpc()){while(list($x,$X)=each($If)){foreach($X
     1331as$Gd=>$W){unset($If[$x][$Gd]);if(is_array($W)){$If[$x][stripslashes($Gd)]=$W;$If[]=&$If[$x][stripslashes($Gd)];}else$If[$x][stripslashes($Gd)]=($Jc?$W:stripslashes($W));}}}}function
    13321332bracket_escape($t,$Na=false){static$th=array(':'=>':1',']'=>':2','['=>':3');return
    13331333strtr($t,($Na?array_flip($th):$th));}function
     
    13461346select_input($Ja,$Ve,$Y="",$vf=""){return($Ve?"<select$Ja><option value=''>$vf".optionlist($Ve,$Y,true)."</select>":"<input$Ja size='10' value='".h($Y)."' placeholder='$vf'>");}function
    13471347confirm(){return" onclick=\"return confirm('".lang(0)."');\"";}function
    1348 print_fieldset($s,$Vd,$Zh=false,$Pe=""){echo"<fieldset><legend><a href='#fieldset-$s' onclick=\"".h($Pe)."return !toggle('fieldset-$s');\">$Vd</a></legend><div id='fieldset-$s'".($Zh?"":" class='hidden'").">\n";}function
     1348print_fieldset($jd,$Vd,$Zh=false,$Pe=""){echo"<fieldset><legend><a href='#fieldset-$jd' onclick=\"".h($Pe)."return !toggle('fieldset-$jd');\">$Vd</a></legend><div id='fieldset-$jd'".($Zh?"":" class='hidden'").">\n";}function
    13491349bold($Va,$ib=""){return($Va?" class='active $ib'":($ib?" class='$ib'":""));}function
    1350 odd($J=' class="odd"'){static$r=0;if(!$J)$r=-1;return($r++%2?$J:'');}function
     1350odd($J=' class="odd"'){static$s=0;if(!$J)$s=-1;return($s++%2?$J:'');}function
    13511351js_escape($P){return
    13521352addcslashes($P,"\r\n'\\/");}function
    1353 json_row($x,$X=null){static$Lc=true;if($Lc)echo"{";if($x!=""){echo($Lc?"":",")."\n\t\"".addcslashes($x,"\r\n\"\\/").'": '.($X!==null?'"'.addcslashes($X,"\r\n\"\\/").'"':'undefined');$Lc=false;}else{echo"\n}\n";$Lc=true;}}function
     1353json_row($x,$X=null){static$Kc=true;if($Kc)echo"{";if($x!=""){echo($Kc?"":",")."\n\t\"".addcslashes($x,"\r\n\"\\/").'": '.($X!==null?'"'.addcslashes($X,"\r\n\"\\/").'"':'undefined');$Kc=false;}else{echo"\n}\n";$Kc=true;}}function
    13541354ini_bool($td){$X=ini_get($td);return(preg_match('~^(on|true|yes)$~i',$X)||(int)$X);}function
    13551355sid(){static$J;if($J===null)$J=(SID&&!($_COOKIE&&ini_bool("session.use_cookies")));return$J;}function
     
    13591359get_vals($H,$e=0){global$h;$J=array();$I=$h->query($H);if(is_object($I)){while($K=$I->fetch_row())$J[]=$K[$e];}return$J;}function
    13601360get_key_vals($H,$i=null,$jh=0){global$h;if(!is_object($i))$i=$h;$J=array();$i->timeout=$jh;$I=$i->query($H);$i->timeout=0;if(is_object($I)){while($K=$I->fetch_row())$J[$K[0]]=$K[1];}return$J;}function
    1361 get_rows($H,$i=null,$m="<p class='error'>"){global$h;$ub=(is_object($i)?$i:$h);$J=array();$I=$ub->query($H);if(is_object($I)){while($K=$I->fetch_assoc())$J[]=$K;}elseif(!$I&&!is_object($i)&&$m&&defined("PAGE_HEADER"))echo$m.error()."\n";return$J;}function
     1361get_rows($H,$i=null,$n="<p class='error'>"){global$h;$ub=(is_object($i)?$i:$h);$J=array();$I=$ub->query($H);if(is_object($I)){while($K=$I->fetch_assoc())$J[]=$K;}elseif(!$I&&!is_object($i)&&$n&&defined("PAGE_HEADER"))echo$n.error()."\n";return$J;}function
    13621362unique_array($K,$v){foreach($v
    13631363as$u){if(preg_match("~PRIMARY|UNIQUE~",$u["type"])){$J=array();foreach($u["columns"]as$x){if(!isset($K[$x]))continue
     
    13651365escape_key($x){if(preg_match('(^([\w(]+)('.str_replace("_",".*",preg_quote(idf_escape("_"))).')([ \w)]+)$)',$x,$B))return$B[1].idf_escape(idf_unescape($B[2])).$B[3];return
    13661366idf_escape($x);}function
    1367 where($Z,$o=array()){global$h,$w;$J=array();foreach((array)$Z["where"]as$x=>$X){$x=bracket_escape($x,1);$e=escape_key($x);$J[]=$e.(($w=="sql"&&preg_match('~^[0-9]*\\.[0-9]*$~',$X))||$w=="mssql"?" LIKE ".q(addcslashes($X,"%_\\")):" = ".unconvert_field($o[$x],q($X)));if($w=="sql"&&preg_match('~char|text~',$o[$x]["type"])&&preg_match("~[^ -@]~",$X))$J[]="$e = ".q($X)." COLLATE ".charset($h)."_bin";}foreach((array)$Z["null"]as$x)$J[]=escape_key($x)." IS NULL";return
     1367where($Z,$p=array()){global$h,$w;$J=array();foreach((array)$Z["where"]as$x=>$X){$x=bracket_escape($x,1);$e=escape_key($x);$J[]=$e.(($w=="sql"&&preg_match('~^[0-9]*\\.[0-9]*$~',$X))||$w=="mssql"?" LIKE ".q(addcslashes($X,"%_\\")):" = ".unconvert_field($p[$x],q($X)));if($w=="sql"&&preg_match('~char|text~',$p[$x]["type"])&&preg_match("~[^ -@]~",$X))$J[]="$e = ".q($X)." COLLATE ".charset($h)."_bin";}foreach((array)$Z["null"]as$x)$J[]=escape_key($x)." IS NULL";return
    13681368implode(" AND ",$J);}function
    1369 where_check($X,$o=array()){parse_str($X,$bb);remove_slashes(array(&$bb));return
    1370 where($bb,$o);}function
    1371 where_link($r,$e,$Y,$Re="="){return"&where%5B$r%5D%5Bcol%5D=".urlencode($e)."&where%5B$r%5D%5Bop%5D=".urlencode(($Y!==null?$Re:"IS NULL"))."&where%5B$r%5D%5Bval%5D=".urlencode($Y);}function
    1372 convert_fields($f,$o,$M=array()){$J="";foreach($f
    1373 as$x=>$X){if($M&&!in_array(idf_escape($x),$M))continue;$Ga=convert_field($o[$x]);if($Ga)$J.=", $Ga AS ".idf_escape($x);}return$J;}function
     1369where_check($X,$p=array()){parse_str($X,$bb);remove_slashes(array(&$bb));return
     1370where($bb,$p);}function
     1371where_link($s,$e,$Y,$Re="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($e)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$Re:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
     1372convert_fields($f,$p,$M=array()){$J="";foreach($f
     1373as$x=>$X){if($M&&!in_array(idf_escape($x),$M))continue;$Ga=convert_field($p[$x]);if($Ga)$J.=", $Ga AS ".idf_escape($x);}return$J;}function
    13741374cookie($C,$Y,$Xd=2592000){global$ba;$F=array($C,(preg_match("~\n~",$Y)?"":$Y),($Xd?time()+$Xd:0),preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$F[]=true;return
    13751375call_user_func_array('setcookie',$F);}function
     
    13771377stop_session(){if(!ini_bool("session.use_cookies"))session_write_close();}function&get_session($x){return$_SESSION[$x][DRIVER][SERVER][$_GET["username"]];}function
    13781378set_session($x,$X){$_SESSION[$x][DRIVER][SERVER][$_GET["username"]]=$X;}function
    1379 auth_url($Vh,$N,$V,$l=null){global$Yb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($Yb))."|username|".($l!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($Vh!="server"||$N!=""?urlencode($Vh)."=".urlencode($N)."&":"")."username=".urlencode($V).($l!=""?"&db=".urlencode($l):"").($B[2]?"&$B[2]":"");}function
     1379auth_url($Vh,$N,$V,$m=null){global$Xb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($Xb))."|username|".($m!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($Vh!="server"||$N!=""?urlencode($Vh)."=".urlencode($N)."&":"")."username=".urlencode($V).($m!=""?"&db=".urlencode($m):"").($B[2]?"&$B[2]":"");}function
    13801380is_ajax(){return($_SERVER["HTTP_X_REQUESTED_WITH"]=="XMLHttpRequest");}function
    13811381redirect($A,$me=null){if($me!==null){restart_session();$_SESSION["messages"][preg_replace('~^[^?]*~','',($A!==null?$A:$_SERVER["REQUEST_URI"]))][]=$me;}if($A!==null){if($A=="")$A=".";header("Location: $A");exit;}}function
    1382 query_redirect($H,$A,$me,$Sf=true,$xc=true,$Ec=false,$ih=""){global$h,$m,$b;if($xc){$Hg=microtime(true);$Ec=!$h->query($H);$ih=format_time($Hg);}$Fg="";if($H)$Fg=$b->messageQuery($H,$ih);if($Ec){$m=error().$Fg;return
     1382query_redirect($H,$A,$me,$Sf=true,$wc=true,$Dc=false,$ih=""){global$h,$n,$b;if($wc){$Hg=microtime(true);$Dc=!$h->query($H);$ih=format_time($Hg);}$Fg="";if($H)$Fg=$b->messageQuery($H,$ih);if($Dc){$n=error().$Fg;return
    13831383false;}if($Sf)redirect($A,$me.$Fg);return
    13841384true;}function
    13851385queries($H){global$h;static$Mf=array();static$Hg;if(!$Hg)$Hg=microtime(true);if($H===null)return
    13861386array(implode("\n",$Mf),format_time($Hg));$Mf[]=(preg_match('~;$~',$H)?"DELIMITER ;;\n$H;\nDELIMITER ":$H).";";return$h->query($H);}function
    1387 apply_queries($H,$S,$tc='table'){foreach($S
    1388 as$Q){if(!queries("$H ".$tc($Q)))return
     1387apply_queries($H,$S,$sc='table'){foreach($S
     1388as$Q){if(!queries("$H ".$sc($Q)))return
    13891389false;}return
    13901390true;}function
     
    13951395remove_from_uri($jf=""){return
    13961396substr(preg_replace("~(?<=[?&])($jf".(SID?"":"|".session_name()).")=[^&]*&~",'',"$_SERVER[REQUEST_URI]&"),0,-1);}function
    1397 pagination($E,$Eb){return" ".($E==$Eb?$E+1:'<a href="'.h(remove_from_uri("page").($E?"&page=$E".($_GET["next"]?"&next=".urlencode($_GET["next"]):""):"")).'">'.($E+1)."</a>");}function
    1398 get_file($x,$Lb=false){$Ic=$_FILES[$x];if(!$Ic)return
    1399 null;foreach($Ic
    1400 as$x=>$X)$Ic[$x]=(array)$X;$J='';foreach($Ic["error"]as$x=>$m){if($m)return$m;$C=$Ic["name"][$x];$qh=$Ic["tmp_name"][$x];$wb=file_get_contents($Lb&&preg_match('~\\.gz$~',$C)?"compress.zlib://$qh":$qh);if($Lb){$Hg=substr($wb,0,3);if(function_exists("iconv")&&preg_match("~^\xFE\xFF|^\xFF\xFE~",$Hg,$Yf))$wb=iconv("utf-16","utf-8",$wb);elseif($Hg=="\xEF\xBB\xBF")$wb=substr($wb,3);$J.=$wb."\n\n";}else$J.=$wb;}return$J;}function
    1401 upload_error($m){$je=($m==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):0);return($m?lang(2).($je?" ".lang(3,$je):""):lang(4));}function
     1397pagination($E,$Db){return" ".($E==$Db?$E+1:'<a href="'.h(remove_from_uri("page").($E?"&page=$E".($_GET["next"]?"&next=".urlencode($_GET["next"]):""):"")).'">'.($E+1)."</a>");}function
     1398get_file($x,$Kb=false){$Hc=$_FILES[$x];if(!$Hc)return
     1399null;foreach($Hc
     1400as$x=>$X)$Hc[$x]=(array)$X;$J='';foreach($Hc["error"]as$x=>$n){if($n)return$n;$C=$Hc["name"][$x];$qh=$Hc["tmp_name"][$x];$wb=file_get_contents($Kb&&preg_match('~\\.gz$~',$C)?"compress.zlib://$qh":$qh);if($Kb){$Hg=substr($wb,0,3);if(function_exists("iconv")&&preg_match("~^\xFE\xFF|^\xFF\xFE~",$Hg,$Yf))$wb=iconv("utf-16","utf-8",$wb);elseif($Hg=="\xEF\xBB\xBF")$wb=substr($wb,3);$J.=$wb."\n\n";}else$J.=$wb;}return$J;}function
     1401upload_error($n){$je=($n==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):0);return($n?lang(2).($je?" ".lang(3,$je):""):lang(4));}function
    14021402repeat_pattern($tf,$y){return
    14031403str_repeat("$tf{0,65535}",$y/65535)."$tf{0,".($y%65535)."}";}function
     
    14131413echo'<input type="hidden" name="'.h($x).'" value="'.h($X).'">';}}}function
    14141414hidden_fields_get(){echo(sid()?'<input type="hidden" name="'.session_name().'" value="'.h(session_id()).'">':''),(SERVER!==null?'<input type="hidden" name="'.DRIVER.'" value="'.h(SERVER).'">':""),'<input type="hidden" name="username" value="'.h($_GET["username"]).'">';}function
    1415 table_status1($Q,$Fc=false){$J=table_status($Q,$Fc);return($J?$J:array("Name"=>$Q));}function
    1416 column_foreign_keys($Q){global$b;$J=array();foreach($b->foreignKeys($Q)as$p){foreach($p["source"]as$X)$J[$X][]=$p;}return$J;}function
    1417 enum_input($U,$Ja,$n,$Y,$nc=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$ee);$J=($nc!==null?"<label><input type='$U'$Ja value='$nc'".((is_array($Y)?in_array($nc,$Y):$Y===0)?" checked":"")."><i>".lang(7)."</i></label>":"");foreach($ee[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$db=(is_int($Y)?$Y==$r+1:(is_array($Y)?in_array($r+1,$Y):$Y===$X));$J.=" <label><input type='$U'$Ja value='".($r+1)."'".($db?' checked':'').'>'.h($b->editVal($X,$n)).'</label>';}return$J;}function
    1418 input($n,$Y,$q){global$h,$Bh,$b,$w;$C=h(bracket_escape($n["field"]));echo"<td class='function'>";if(is_array($Y)&&!$q){$Ea=array($Y);if(version_compare(PHP_VERSION,5.4)>=0)$Ea[]=JSON_PRETTY_PRINT;$Y=call_user_func_array('json_encode',$Ea);$q="json";}$bg=($w=="mssql"&&$n["auto_increment"]);if($bg&&!$_POST["save"])$q=null;$Vc=(isset($_GET["select"])||$bg?array("orig"=>lang(8)):array())+$b->editFunctions($n);$Ja=" name='fields[$C]'";if($n["type"]=="enum")echo
    1419 nbsp($Vc[""])."<td>".$b->editInput($_GET["edit"],$n,$Ja,$Y);else{$Lc=0;foreach($Vc
    1420 as$x=>$X){if($x===""||!$X)break;$Lc++;}$Oe=($Lc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($n["field"])))."]']; if ($Lc > f.selectedIndex) f.selectedIndex = $Lc;\" onkeyup='keyupChange.call(this);'":"");$Ja.=$Oe;$dd=(in_array($q,$Vc)||isset($Vc[$q]));echo(count($Vc)>1?"<select name='function[$C]' onchange='functionChange(this);'".on_help("getTarget(event).value.replace(/^SQL\$/, '')",1).">".optionlist($Vc,$q===null||$dd?$q:"")."</select>":nbsp(reset($Vc))).'<td>';$vd=$b->editInput($_GET["edit"],$n,$Ja,$Y);if($vd!="")echo$vd;elseif($n["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$ee);foreach($ee[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$db=(is_int($Y)?($Y>>$r)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$C][$r]' value='".(1<<$r)."'".($db?' checked':'')."$Oe>".h($b->editVal($X,$n)).'</label>';}}elseif(preg_match('~blob|bytea|raw|file~',$n["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$C'$Oe>";elseif(($gh=preg_match('~text|lob~',$n["type"]))||preg_match("~\n~",$Y)){if($gh&&$w!="sqlite")$Ja.=" cols='50' rows='12'";else{$L=min(12,substr_count($Y,"\n")+1);$Ja.=" cols='30' rows='$L'".($L==1?" style='height: 1.2em;'":"");}echo"<textarea$Ja>".h($Y).'</textarea>';}elseif($q=="json")echo"<textarea$Ja cols='50' rows='12' class='jush-js'>".h($Y).'</textarea>';else{$le=(!preg_match('~int~',$n["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$n["length"],$B)?((preg_match("~binary~",$n["type"])?2:1)*$B[1]+($B[3]?1:0)+($B[2]&&!$n["unsigned"]?1:0)):($Bh[$n["type"]]?$Bh[$n["type"]]+($n["unsigned"]?0:1):0));if($w=='sql'&&$h->server_info>=5.6&&preg_match('~time~',$n["type"]))$le+=7;echo"<input".((!$dd||$q==="")&&preg_match('~(?<!o)int~',$n["type"])?" type='number'":"")." value='".h($Y)."'".($le?" maxlength='$le'":"").(preg_match('~char|binary~',$n["type"])&&$le>20?" size='40'":"")."$Ja>";}}}function
    1421 process_input($n){global$b;$t=bracket_escape($n["field"]);$q=$_POST["function"][$t];$Y=$_POST["fields"][$t];if($n["type"]=="enum"){if($Y==-1)return
    1422 false;if($Y=="")return"NULL";return+$Y;}if($n["auto_increment"]&&$Y=="")return
    1423 null;if($q=="orig")return($n["on_update"]=="CURRENT_TIMESTAMP"?idf_escape($n["field"]):false);if($q=="NULL")return"NULL";if($n["type"]=="set")return
    1424 array_sum((array)$Y);if($q=="json"){$q="";$Y=json_decode($Y,true);if(!is_array($Y))return
    1425 false;return$Y;}if(preg_match('~blob|bytea|raw|file~',$n["type"])&&ini_bool("file_uploads")){$Ic=get_file("fields-$t");if(!is_string($Ic))return
     1415table_status1($Q,$Ec=false){$J=table_status($Q,$Ec);return($J?$J:array("Name"=>$Q));}function
     1416column_foreign_keys($Q){global$b;$J=array();foreach($b->foreignKeys($Q)as$q){foreach($q["source"]as$X)$J[$X][]=$q;}return$J;}function
     1417enum_input($U,$Ja,$o,$Y,$mc=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$ee);$J=($mc!==null?"<label><input type='$U'$Ja value='$mc'".((is_array($Y)?in_array($mc,$Y):$Y===0)?" checked":"")."><i>".lang(7)."</i></label>":"");foreach($ee[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$db=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$J.=" <label><input type='$U'$Ja value='".($s+1)."'".($db?' checked':'').'>'.h($b->editVal($X,$o)).'</label>';}return$J;}function
     1418input($o,$Y,$r){global$h,$Bh,$b,$w;$C=h(bracket_escape($o["field"]));echo"<td class='function'>";if(is_array($Y)&&!$r){$Ea=array($Y);if(version_compare(PHP_VERSION,5.4)>=0)$Ea[]=JSON_PRETTY_PRINT;$Y=call_user_func_array('json_encode',$Ea);$r="json";}$bg=($w=="mssql"&&$o["auto_increment"]);if($bg&&!$_POST["save"])$r=null;$Uc=(isset($_GET["select"])||$bg?array("orig"=>lang(8)):array())+$b->editFunctions($o);$Ja=" name='fields[$C]'";if($o["type"]=="enum")echo
     1419nbsp($Uc[""])."<td>".$b->editInput($_GET["edit"],$o,$Ja,$Y);else{$Kc=0;foreach($Uc
     1420as$x=>$X){if($x===""||!$X)break;$Kc++;}$Oe=($Kc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($o["field"])))."]']; if ($Kc > f.selectedIndex) f.selectedIndex = $Kc;\" onkeyup='keyupChange.call(this);'":"");$Ja.=$Oe;$cd=(in_array($r,$Uc)||isset($Uc[$r]));echo(count($Uc)>1?"<select name='function[$C]' onchange='functionChange(this);'".on_help("getTarget(event).value.replace(/^SQL\$/, '')",1).">".optionlist($Uc,$r===null||$cd?$r:"")."</select>":nbsp(reset($Uc))).'<td>';$vd=$b->editInput($_GET["edit"],$o,$Ja,$Y);if($vd!="")echo$vd;elseif($o["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$ee);foreach($ee[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$db=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$C][$s]' value='".(1<<$s)."'".($db?' checked':'')."$Oe>".h($b->editVal($X,$o)).'</label>';}}elseif(preg_match('~blob|bytea|raw|file~',$o["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$C'$Oe>";elseif(($gh=preg_match('~text|lob~',$o["type"]))||preg_match("~\n~",$Y)){if($gh&&$w!="sqlite")$Ja.=" cols='50' rows='12'";else{$L=min(12,substr_count($Y,"\n")+1);$Ja.=" cols='30' rows='$L'".($L==1?" style='height: 1.2em;'":"");}echo"<textarea$Ja>".h($Y).'</textarea>';}elseif($r=="json")echo"<textarea$Ja cols='50' rows='12' class='jush-js'>".h($Y).'</textarea>';else{$le=(!preg_match('~int~',$o["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$o["length"],$B)?((preg_match("~binary~",$o["type"])?2:1)*$B[1]+($B[3]?1:0)+($B[2]&&!$o["unsigned"]?1:0)):($Bh[$o["type"]]?$Bh[$o["type"]]+($o["unsigned"]?0:1):0));if($w=='sql'&&$h->server_info>=5.6&&preg_match('~time~',$o["type"]))$le+=7;echo"<input".((!$cd||$r==="")&&preg_match('~(?<!o)int~',$o["type"])?" type='number'":"")." value='".h($Y)."'".($le?" maxlength='$le'":"").(preg_match('~char|binary~',$o["type"])&&$le>20?" size='40'":"")."$Ja>";}}}function
     1421process_input($o){global$b;$t=bracket_escape($o["field"]);$r=$_POST["function"][$t];$Y=$_POST["fields"][$t];if($o["type"]=="enum"){if($Y==-1)return
     1422false;if($Y=="")return"NULL";return+$Y;}if($o["auto_increment"]&&$Y=="")return
     1423null;if($r=="orig")return($o["on_update"]=="CURRENT_TIMESTAMP"?idf_escape($o["field"]):false);if($r=="NULL")return"NULL";if($o["type"]=="set")return
     1424array_sum((array)$Y);if($r=="json"){$r="";$Y=json_decode($Y,true);if(!is_array($Y))return
     1425false;return$Y;}if(preg_match('~blob|bytea|raw|file~',$o["type"])&&ini_bool("file_uploads")){$Hc=get_file("fields-$t");if(!is_string($Hc))return
    14261426false;return
    1427 q($Ic);}return$b->processInput($n,$Y,$q);}function
    1428 fields_from_edit(){global$Xb;$J=array();foreach((array)$_POST["field_keys"]as$x=>$X){if($X!=""){$X=bracket_escape($X);$_POST["function"][$X]=$_POST["field_funs"][$x];$_POST["fields"][$X]=$_POST["field_vals"][$x];}}foreach((array)$_POST["fields"]as$x=>$X){$C=bracket_escape($x,1);$J[$C]=array("field"=>$C,"privileges"=>array("insert"=>1,"update"=>1),"null"=>1,"auto_increment"=>($x==$Xb->primary),);}return$J;}function
    1429 search_tables(){global$b,$h;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$Rc=false;foreach(table_status('',true)as$Q=>$R){$C=$b->tableName($R);if(isset($R["Engine"])&&$C!=""&&(!$_POST["tables"]||in_array($Q,$_POST["tables"]))){$I=$h->query("SELECT".limit("1 FROM ".table($Q)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($Q),array())),1));if(!$I||$I->fetch_row()){if(!$Rc){echo"<ul>\n";$Rc=true;}echo"<li>".($I?"<a href='".h(ME."select=".urlencode($Q)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$C</a>\n":"$C: <span class='error'>".error()."</span>\n");}}}echo($Rc?"</ul>":"<p class='message'>".lang(9))."\n";}function
     1427q($Hc);}return$b->processInput($o,$Y,$r);}function
     1428fields_from_edit(){global$Wb;$J=array();foreach((array)$_POST["field_keys"]as$x=>$X){if($X!=""){$X=bracket_escape($X);$_POST["function"][$X]=$_POST["field_funs"][$x];$_POST["fields"][$X]=$_POST["field_vals"][$x];}}foreach((array)$_POST["fields"]as$x=>$X){$C=bracket_escape($x,1);$J[$C]=array("field"=>$C,"privileges"=>array("insert"=>1,"update"=>1),"null"=>1,"auto_increment"=>($x==$Wb->primary),);}return$J;}function
     1429search_tables(){global$b,$h;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$Qc=false;foreach(table_status('',true)as$Q=>$R){$C=$b->tableName($R);if(isset($R["Engine"])&&$C!=""&&(!$_POST["tables"]||in_array($Q,$_POST["tables"]))){$I=$h->query("SELECT".limit("1 FROM ".table($Q)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($Q),array())),1));if(!$I||$I->fetch_row()){if(!$Qc){echo"<ul>\n";$Qc=true;}echo"<li>".($I?"<a href='".h(ME."select=".urlencode($Q)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$C</a>\n":"$C: <span class='error'>".error()."</span>\n");}}}echo($Qc?"</ul>":"<p class='message'>".lang(9))."\n";}function
    14301430dump_headers($kd,$ve=false){global$b;$J=$b->dumpHeaders($kd,$ve);$hf=$_POST["output"];if($hf!="text")header("Content-Disposition: attachment; filename=".$b->dumpFilename($kd).".$J".($hf!="file"&&!preg_match('~[^0-9a-z]~',$hf)?".$hf":""));session_write_close();ob_flush();flush();return$J;}function
    14311431dump_csv($K){foreach($K
    14321432as$x=>$X){if(preg_match("~[\"\n,;\t]~",$X)||$X==="")$K[$x]='"'.str_replace('"','""',$X).'"';}echo
    14331433implode(($_POST["format"]=="csv"?",":($_POST["format"]=="tsv"?"\t":";")),$K)."\r\n";}function
    1434 apply_sql_function($q,$e){return($q?($q=="unixepoch"?"DATETIME($e, '$q')":($q=="count distinct"?"COUNT(DISTINCT ":strtoupper("$q("))."$e)"):$e);}function
    1435 get_temp_dir(){$J=ini_get("upload_tmp_dir");if(!$J){if(function_exists('sys_get_temp_dir'))$J=sys_get_temp_dir();else{$Jc=@tempnam("","");if(!$Jc)return
    1436 false;$J=dirname($Jc);unlink($Jc);}}return$J;}function
    1437 password_file($Bb){$Jc=get_temp_dir()."/adminer.key";$J=@file_get_contents($Jc);if($J||!$Bb)return$J;$Tc=@fopen($Jc,"w");if($Tc){chmod($Jc,0660);$J=rand_string();fwrite($Tc,$J);fclose($Tc);}return$J;}function
     1434apply_sql_function($r,$e){return($r?($r=="unixepoch"?"DATETIME($e, '$r')":($r=="count distinct"?"COUNT(DISTINCT ":strtoupper("$r("))."$e)"):$e);}function
     1435get_temp_dir(){$J=ini_get("upload_tmp_dir");if(!$J){if(function_exists('sys_get_temp_dir'))$J=sys_get_temp_dir();else{$Ic=@tempnam("","");if(!$Ic)return
     1436false;$J=dirname($Ic);unlink($Ic);}}return$J;}function
     1437password_file($j){$Ic=get_temp_dir()."/adminer.key";$J=@file_get_contents($Ic);if($J||!$j)return$J;$Sc=@fopen($Ic,"w");if($Sc){chmod($Ic,0660);$J=rand_string();fwrite($Sc,$J);fclose($Sc);}return$J;}function
    14381438rand_string(){return
    14391439md5(uniqid(mt_rand(),true));}function
    1440 select_value($X,$_,$n,$hh){global$b,$ba;if(is_array($X)){$J="";foreach($X
    1441 as$Gd=>$W)$J.="<tr>".($X!=array_values($X)?"<th>".h($Gd):"")."<td>".select_value($W,$_,$n,$hh);return"<table cellspacing='0'>$J</table>";}if(!$_)$_=$b->selectLink($X,$n);if($_===null){if(is_mail($X))$_="mailto:$X";if($Kf=is_url($X))$_=(($Kf=="http"&&$ba)||preg_match('~WebKit~i',$_SERVER["HTTP_USER_AGENT"])?$X:"$Kf://www.adminer.org/redirect/?url=".urlencode($X));}$J=$b->editVal($X,$n);if($J!==null){if($J==="")$J="&nbsp;";elseif(!is__utf8($J))$J="\0";elseif($hh!=""&&is_shortable($n))$J=shorten_utf8($J,max(0,+$hh));else$J=h($J);}return$b->selectVal($J,$_,$n,$X);}function
    1442 is_mail($kc){$Ha='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$Wb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$tf="$Ha+(\\.$Ha+)*@($Wb?\\.)+$Wb";return
    1443 is_string($kc)&&preg_match("(^$tf(,\\s*$tf)*\$)i",$kc);}function
    1444 is_url($P){$Wb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return(preg_match("~^(https?)://($Wb?\\.)+$Wb(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$P,$B)?strtolower($B[1]):"");}function
    1445 is_shortable($n){return
    1446 preg_match('~char|text|lob|geometry|point|linestring|polygon|string~',$n["type"]);}function
    1447 count_rows($Q,$Z,$Ad,$Yc){global$w;$H=" FROM ".table($Q).($Z?" WHERE ".implode(" AND ",$Z):"");return($Ad&&($w=="sql"||count($Yc)==1)?"SELECT COUNT(DISTINCT ".implode(", ",$Yc).")$H":"SELECT COUNT(*)".($Ad?" FROM (SELECT 1$H$Zc) x":$H));}function
    1448 slow_query($H){global$b,$T;$l=$b->database();$jh=$b->queryTimeout();if(support("kill")&&is_object($i=connect())&&($l==""||$i->select_db($l))){$Ld=$i->result("SELECT CONNECTION_ID()");echo'<script type="text/javascript">
     1440select_value($X,$_,$o,$hh){global$b,$ba;if(is_array($X)){$J="";foreach($X
     1441as$Gd=>$W)$J.="<tr>".($X!=array_values($X)?"<th>".h($Gd):"")."<td>".select_value($W,$_,$o,$hh);return"<table cellspacing='0'>$J</table>";}if(!$_)$_=$b->selectLink($X,$o);if($_===null){if(is_mail($X))$_="mailto:$X";if($Kf=is_url($X))$_=(($Kf=="http"&&$ba)||preg_match('~WebKit~i',$_SERVER["HTTP_USER_AGENT"])?$X:"$Kf://www.adminer.org/redirect/?url=".urlencode($X));}$J=$b->editVal($X,$o);if($J!==null){if($J==="")$J="&nbsp;";elseif(!is__utf8($J))$J="\0";elseif($hh!=""&&is_shortable($o))$J=shorten_utf8($J,max(0,+$hh));else$J=h($J);}return$b->selectVal($J,$_,$o,$X);}function
     1442is_mail($jc){$Ha='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$Vb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$tf="$Ha+(\\.$Ha+)*@($Vb?\\.)+$Vb";return
     1443is_string($jc)&&preg_match("(^$tf(,\\s*$tf)*\$)i",$jc);}function
     1444is_url($P){$Vb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return(preg_match("~^(https?)://($Vb?\\.)+$Vb(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$P,$B)?strtolower($B[1]):"");}function
     1445is_shortable($o){return
     1446preg_match('~char|text|lob|geometry|point|linestring|polygon|string~',$o["type"]);}function
     1447count_rows($Q,$Z,$Ad,$Xc){global$w;$H=" FROM ".table($Q).($Z?" WHERE ".implode(" AND ",$Z):"");return($Ad&&($w=="sql"||count($Xc)==1)?"SELECT COUNT(DISTINCT ".implode(", ",$Xc).")$H":"SELECT COUNT(*)".($Ad?" FROM (SELECT 1$H$Yc) x":$H));}function
     1448slow_query($H){global$b,$T;$m=$b->database();$jh=$b->queryTimeout();if(support("kill")&&is_object($i=connect())&&($m==""||$i->select_db($m))){$Ld=$i->result("SELECT CONNECTION_ID()");echo'<script type="text/javascript">
    14491449var timeout = setTimeout(function () {
    14501450        ajax(\'',js_escape(ME),'script=kill\', function () {
     
    14561456get_token(){$Pf=rand(1,1e6);return($Pf^$_SESSION["token"]).":$Pf";}function
    14571457verify_token(){list($T,$Pf)=explode(":",$_POST["token"]);return($Pf^$_SESSION["token"])==$T;}function
    1458 lzw_decompress($Ra){$Sb=256;$Sa=8;$kb=array();$dg=0;$eg=0;for($r=0;$r<strlen($Ra);$r++){$dg=($dg<<8)+ord($Ra[$r]);$eg+=8;if($eg>=$Sa){$eg-=$Sa;$kb[]=$dg>>$eg;$dg&=(1<<$eg)-1;$Sb++;if($Sb>>$Sa)$Sa++;}}$Rb=range("\0","\xFF");$J="";foreach($kb
    1459 as$r=>$jb){$jc=$Rb[$jb];if(!isset($jc))$jc=$di.$di[0];$J.=$jc;if($r)$Rb[]=$di.$jc[0];$di=$jc;}return$J;}function
     1458lzw_decompress($Ra){$Rb=256;$Sa=8;$kb=array();$dg=0;$eg=0;for($s=0;$s<strlen($Ra);$s++){$dg=($dg<<8)+ord($Ra[$s]);$eg+=8;if($eg>=$Sa){$eg-=$Sa;$kb[]=$dg>>$eg;$dg&=(1<<$eg)-1;$Rb++;if($Rb>>$Sa)$Sa++;}}$Qb=range("\0","\xFF");$J="";foreach($kb
     1459as$s=>$jb){$ic=$Qb[$jb];if(!isset($ic))$ic=$di.$di[0];$J.=$ic;if($s)$Qb[]=$di.$ic[0];$di=$ic;}return$J;}function
    14601460on_help($pb,$Ag=0){return" onmouseover='helpMouseover(this, event, ".h($pb).", $Ag);' onmouseout='helpMouseout(this, event);'";}function
    1461 edit_form($a,$o,$K,$Jh){global$b,$w,$T,$m;$Tg=$b->tableName(table_status1($a,true));page_header(($Jh?lang(10):lang(11)),$m,array("select"=>array($a,$Tg)),$Tg);if($K===false)echo"<p class='error'>".lang(12)."\n";echo'<form action="" method="post" enctype="multipart/form-data" id="form">
    1462 ';if(!$o)echo"<p class='error'>".lang(13)."\n";else{echo"<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";foreach($o
    1463 as$C=>$n){echo"<tr><th>".$b->fieldName($n);$Mb=$_GET["set"][bracket_escape($C)];if($Mb===null){$Mb=$n["default"];if($n["type"]=="bit"&&preg_match("~^b'([01]*)'\$~",$Mb,$Yf))$Mb=$Yf[1];}$Y=($K!==null?($K[$C]!=""&&$w=="sql"&&preg_match("~enum|set~",$n["type"])?(is_array($K[$C])?array_sum($K[$C]):+$K[$C]):$K[$C]):(!$Jh&&$n["auto_increment"]?"":(isset($_GET["select"])?false:$Mb)));if(!$_POST["save"]&&is_string($Y))$Y=$b->editVal($Y,$n);$q=($_POST["save"]?(string)$_POST["function"][$C]:($Jh&&$n["on_update"]=="CURRENT_TIMESTAMP"?"now":($Y===false?null:($Y!==null?'':'NULL'))));if(preg_match("~time~",$n["type"])&&$Y=="CURRENT_TIMESTAMP"){$Y="";$q="now";}input($n,$Y,$q);echo"\n";}if(!support("table"))echo"<tr>"."<th><input name='field_keys[]' onkeyup='keyupChange.call(this);' onchange='fieldChange(this);' value=''>"."<td class='function'>".html_select("field_funs[]",$b->editFunctions(array("null"=>isset($_GET["select"]))))."<td><input name='field_vals[]'>"."\n";echo"</table>\n";}echo"<p>\n";if($o){echo"<input type='submit' value='".lang(14)."'>\n";if(!isset($_GET["select"]))echo"<input type='submit' name='insert' value='".($Jh?lang(15)."' onclick='return !ajaxForm(this.form, \"".lang(16).'...", this)':lang(17))."' title='Ctrl+Shift+Enter'>\n";}echo($Jh?"<input type='submit' name='delete' value='".lang(18)."'".confirm().">\n":($_POST||!$o?"":"<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n"));if(isset($_GET["select"]))hidden_fields(array("check"=>(array)$_POST["check"],"clone"=>$_POST["clone"],"all"=>$_POST["all"]));echo'<input type="hidden" name="referer" value="',h(isset($_POST["referer"])?$_POST["referer"]:$_SERVER["HTTP_REFERER"]),'">
     1461edit_form($a,$p,$K,$Jh){global$b,$w,$T,$n;$Tg=$b->tableName(table_status1($a,true));page_header(($Jh?lang(10):lang(11)),$n,array("select"=>array($a,$Tg)),$Tg);if($K===false)echo"<p class='error'>".lang(12)."\n";echo'<form action="" method="post" enctype="multipart/form-data" id="form">
     1462';if(!$p)echo"<p class='error'>".lang(13)."\n";else{echo"<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";foreach($p
     1463as$C=>$o){echo"<tr><th>".$b->fieldName($o);$Lb=$_GET["set"][bracket_escape($C)];if($Lb===null){$Lb=$o["default"];if($o["type"]=="bit"&&preg_match("~^b'([01]*)'\$~",$Lb,$Yf))$Lb=$Yf[1];}$Y=($K!==null?($K[$C]!=""&&$w=="sql"&&preg_match("~enum|set~",$o["type"])?(is_array($K[$C])?array_sum($K[$C]):+$K[$C]):$K[$C]):(!$Jh&&$o["auto_increment"]?"":(isset($_GET["select"])?false:$Lb)));if(!$_POST["save"]&&is_string($Y))$Y=$b->editVal($Y,$o);$r=($_POST["save"]?(string)$_POST["function"][$C]:($Jh&&$o["on_update"]=="CURRENT_TIMESTAMP"?"now":($Y===false?null:($Y!==null?'':'NULL'))));if(preg_match("~time~",$o["type"])&&$Y=="CURRENT_TIMESTAMP"){$Y="";$r="now";}input($o,$Y,$r);echo"\n";}if(!support("table"))echo"<tr>"."<th><input name='field_keys[]' onkeyup='keyupChange.call(this);' onchange='fieldChange(this);' value=''>"."<td class='function'>".html_select("field_funs[]",$b->editFunctions(array("null"=>isset($_GET["select"]))))."<td><input name='field_vals[]'>"."\n";echo"</table>\n";}echo"<p>\n";if($p){echo"<input type='submit' value='".lang(14)."'>\n";if(!isset($_GET["select"]))echo"<input type='submit' name='insert' value='".($Jh?lang(15)."' onclick='return !ajaxForm(this.form, \"".lang(16).'...", this)':lang(17))."' title='Ctrl+Shift+Enter'>\n";}echo($Jh?"<input type='submit' name='delete' value='".lang(18)."'".confirm().">\n":($_POST||!$p?"":"<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n"));if(isset($_GET["select"]))hidden_fields(array("check"=>(array)$_POST["check"],"clone"=>$_POST["clone"],"all"=>$_POST["all"]));echo'<input type="hidden" name="referer" value="',h(isset($_POST["referer"])?$_POST["referer"]:$_SERVER["HTTP_REFERER"]),'">
    14641464<input type="hidden" name="save" value="1">
    14651465<input type="hidden" name="token" value="',$T,'">
    14661466</form>
    1467 ';}global$b,$h,$Yb,$gc,$qc,$m,$Vc,$ad,$ba,$ud,$w,$ca,$Pd,$Ne,$uf,$Lg,$ed,$T,$vh,$Bh,$Ih,$ia;if(!$_SERVER["REQUEST_URI"])$_SERVER["REQUEST_URI"]=$_SERVER["ORIG_PATH_INFO"];if(!strpos($_SERVER["REQUEST_URI"],'?')&&$_SERVER["QUERY_STRING"]!="")$_SERVER["REQUEST_URI"].="?$_SERVER[QUERY_STRING]";$ba=$_SERVER["HTTPS"]&&strcasecmp($_SERVER["HTTPS"],"off");@ini_set("session.use_trans_sid",false);session_cache_limiter("");if(!defined("SID")){session_name("adminer_sid");$F=array(0,preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$F[]=true;call_user_func_array('session_set_cookie_params',$F);session_start();}remove_slashes(array(&$_GET,&$_POST,&$_COOKIE),$Kc);if(get_magic_quotes_runtime())set_magic_quotes_runtime(false);@set_time_limit(0);@ini_set("zend.ze1_compatibility_mode",false);@ini_set("precision",20);$Pd=array('en'=>'English','ar'=>'العربية','bn'=>'বাংলা','ca'=>'Català','cs'=>'ČeÅ¡tina','da'=>'Dansk','de'=>'Deutsch','es'=>'Español','et'=>'Eesti','fa'=>'فارسی','fr'=>'Français','hu'=>'Magyar','id'=>'Bahasa Indonesia','it'=>'Italiano','ja'=>'日本語','ko'=>'한국어','lt'=>'Lietuvių','nl'=>'Nederlands','no'=>'Norsk','pl'=>'Polski','pt'=>'Português','pt-br'=>'Português (Brazil)','ro'=>'Limba Română','ru'=>'Русский язык','sk'=>'Slovenčina','sl'=>'Slovenski','sr'=>'Српски','ta'=>'த‌மிழ்','th'=>'ภาษาไทย','tr'=>'Türkçe','uk'=>'Українська','vi'=>'Tiếng Việt','zh'=>'简体中文','zh-tw'=>'繁體中文',);function
     1467';}global$b,$h,$Xb,$fc,$pc,$n,$Uc,$Zc,$ba,$ud,$w,$ca,$Pd,$Ne,$uf,$Lg,$dd,$T,$vh,$Bh,$Ih,$ia;if(!$_SERVER["REQUEST_URI"])$_SERVER["REQUEST_URI"]=$_SERVER["ORIG_PATH_INFO"];if(!strpos($_SERVER["REQUEST_URI"],'?')&&$_SERVER["QUERY_STRING"]!="")$_SERVER["REQUEST_URI"].="?$_SERVER[QUERY_STRING]";$ba=$_SERVER["HTTPS"]&&strcasecmp($_SERVER["HTTPS"],"off");@ini_set("session.use_trans_sid",false);session_cache_limiter("");if(!defined("SID")){session_name("adminer_sid");$F=array(0,preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$F[]=true;call_user_func_array('session_set_cookie_params',$F);session_start();}remove_slashes(array(&$_GET,&$_POST,&$_COOKIE),$Jc);if(get_magic_quotes_runtime())set_magic_quotes_runtime(false);@set_time_limit(0);@ini_set("zend.ze1_compatibility_mode",false);@ini_set("precision",20);$Pd=array('en'=>'English','ar'=>'العربية','bn'=>'বাংলা','ca'=>'Català','cs'=>'ČeÅ¡tina','da'=>'Dansk','de'=>'Deutsch','es'=>'Español','et'=>'Eesti','fa'=>'فارسی','fr'=>'Français','hu'=>'Magyar','id'=>'Bahasa Indonesia','it'=>'Italiano','ja'=>'日本語','ko'=>'한국어','lt'=>'Lietuvių','nl'=>'Nederlands','no'=>'Norsk','pl'=>'Polski','pt'=>'Português','pt-br'=>'Português (Brazil)','ro'=>'Limba Română','ru'=>'Русский язык','sk'=>'Slovenčina','sl'=>'Slovenski','sr'=>'Српски','ta'=>'த‌மிழ்','th'=>'ภาษาไทย','tr'=>'Türkçe','uk'=>'Українська','vi'=>'Tiếng Việt','zh'=>'简体中文','zh-tw'=>'繁體中文',);function
    14681468get_lang(){global$ca;return$ca;}function
    1469 lang($t,$Ee=null){if(is_string($t)){$xf=array_search($t,get_translations("en"));if($xf!==false)$t=$xf;}global$ca,$vh;$uh=($vh[$t]?$vh[$t]:$t);if(is_array($uh)){$xf=($Ee==1?0:($ca=='cs'||$ca=='sk'?($Ee&&$Ee<5?1:2):($ca=='fr'?(!$Ee?0:1):($ca=='pl'?($Ee%10>1&&$Ee%10<5&&$Ee/10%10!=1?1:2):($ca=='sl'?($Ee%100==1?0:($Ee%100==2?1:($Ee%100==3||$Ee%100==4?2:3))):($ca=='lt'?($Ee%10==1&&$Ee%100!=11?0:($Ee%10>1&&$Ee/10%10!=1?1:2)):($ca=='ru'||$ca=='sr'||$ca=='uk'?($Ee%10==1&&$Ee%100!=11?0:($Ee%10>1&&$Ee%10<5&&$Ee/10%10!=1?1:2)):1)))))));$uh=$uh[$xf];}$Ea=func_get_args();array_shift($Ea);$Qc=str_replace("%d","%s",$uh);if($Qc!=$uh)$Ea[0]=format_number($Ee);return
    1470 vsprintf($Qc,$Ea);}function
     1469lang($t,$Ee=null){if(is_string($t)){$xf=array_search($t,get_translations("en"));if($xf!==false)$t=$xf;}global$ca,$vh;$uh=($vh[$t]?$vh[$t]:$t);if(is_array($uh)){$xf=($Ee==1?0:($ca=='cs'||$ca=='sk'?($Ee&&$Ee<5?1:2):($ca=='fr'?(!$Ee?0:1):($ca=='pl'?($Ee%10>1&&$Ee%10<5&&$Ee/10%10!=1?1:2):($ca=='sl'?($Ee%100==1?0:($Ee%100==2?1:($Ee%100==3||$Ee%100==4?2:3))):($ca=='lt'?($Ee%10==1&&$Ee%100!=11?0:($Ee%10>1&&$Ee/10%10!=1?1:2)):($ca=='ru'||$ca=='sr'||$ca=='uk'?($Ee%10==1&&$Ee%100!=11?0:($Ee%10>1&&$Ee%10<5&&$Ee/10%10!=1?1:2)):1)))))));$uh=$uh[$xf];}$Ea=func_get_args();array_shift($Ea);$Pc=str_replace("%d","%s",$uh);if($Pc!=$uh)$Ea[0]=format_number($Ee);return
     1470vsprintf($Pc,$Ea);}function
    14711471switch_lang(){global$ca,$Pd;echo"<form action='' method='post'>\n<div id='lang'>",lang(19).": ".html_select("lang",$Pd,$ca,"this.form.submit();")," <input type='submit' value='".lang(20)."' class='hidden'>\n","<input type='hidden' name='token' value='".get_token()."'>\n";echo"</div>\n</form>\n";}if(isset($_POST["lang"])&&verify_token()){cookie("adminer_lang",$_POST["lang"]);$_SESSION["lang"]=$_POST["lang"];$_SESSION["translations"]=array();redirect(remove_from_uri());}$ca="en";if(isset($Pd[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($Pd[$_SESSION["lang"]]))$ca=$_SESSION["lang"];else{$ua=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$ee,PREG_SET_ORDER);foreach($ee
    14721472as$B)$ua[$B[1]]=(isset($B[3])?$B[3]:1);arsort($ua);foreach($ua
    1473 as$x=>$Lf){if(isset($Pd[$x])){$ca=$x;break;}$x=preg_replace('~-.*~','',$x);if(!isset($ua[$x])&&isset($Pd[$x])){$ca=$x;break;}}}$vh=&$_SESSION["translations"];if($_SESSION["translations_version"]!=882138372){$vh=array();$_SESSION["translations_version"]=882138372;}function
     1473as$x=>$Lf){if(isset($Pd[$x])){$ca=$x;break;}$x=preg_replace('~-.*~','',$x);if(!isset($ua[$x])&&isset($Pd[$x])){$ca=$x;break;}}}$vh=&$_SESSION["translations"];if($_SESSION["translations_version"]!=646742810){$vh=array();$_SESSION["translations_version"]=646742810;}function
    14741474get_translations($Od){switch($Od){case"en":$g="A9D“yÔ@s:ÀGà¡(¸ffƒ‚Š¦ã ˆÙ:ÄS°Þa2
    14751475\"1¦..L'ƒI´êm‘#Çs,†KƒšOP#IÌ@%9¥i4Èo2ύÆó €Ë,9%ÀPÀb2£a¸àr\n2›NCÈ(Þr4™Í1C`(:Ebç9AÈi:‰&㙔åy·ˆFó½ÐY‚ˆ\r´\n– 8ZÔS=\$Aœ
     
    19731973\n‰Ö°àʉ\"z@PMƒ
    19741974œ)ÆåÅP.mnG20ʯÂþb{GoJ)
    1975 ÷d¼Dï1#Åf\n\nÐxP\n5B.\r@";break;case"de":$g="S4›Œ‚”@s4˜ÍS€~\n‹†fh8(o
    1976 
    1977 &C)¸@v7Lj†¡”Ò 3MÃ9”ç0ËMÂàQ4Âx4›L&Á24u1ID9)¤Îra­Žg81¤æt   Nd)¥M=œSÍ0ʁºh:M\0¡€Äd3\rFÃqÀäl2ÃDó•;äÆè1PÂb2›.0S\r   †¢ÐÑÔÌÃ^L¯7¸5[Y7Dƒ        Ú
    1978 n7ˆS±¦á-9ˆš©ÀÉ\$ƒ
    1979 \ríUþá4)œ\$ЬH+s»
    1980 œ£ÇX€ï&’Ãp–\0Ó%Åó°>ûu_Ĉ83s\rI\n§ÇsxÌvC\$E7
    1981 %<(ïXäaވQÓ©Ónꐹô,¤z8†ªÎxòÝ#ʐ@À\rϨôŽª­‚N2«#¢¶9*    xА¦œû!j83 0š„*@oh´0¥ojˆ:¡\0Þÿ„ӐFNÀÜ5Œ££ ù .ðä  ÑÈôãŽCX#Œ£xÛ
    1982 ®£(&)ÑÛ,1
    1983 1º<¼#k|†3Ñü5.B€Â¥Žã|(Jr¬Œ&\rã:LS\$Í\nºíã
    1984 46ðÂ:Žc»½º# ä:c ê†Ê°ZŒöŠÊØî;ÌDî¿0
    1985 \rH¿ìT‚:¡Š
    1986 ò9¤ƒÒ ˆCÊJ„µ%L—O€AE&HúBÎ%\n4¤/h‚£Œ£:I\\/ŽˆêÞ1Tª¶1(˘ä2X RþðÑhå^ŽHëîꊐ€è6R)h ÖõjÁ6£àƒŒr«|(‰h£NC;úáh“Ú²[Óg\rՄUU¨ì©+S\rè¦Þ'TIISC-8ÔàèZu€Ø×
    1987 
    1988 ¸˜¤2¡I(\$£„ç  ½¢(ñ‘B™&N£s¡\r,ÅM1»}„
    1989  UüÅ\r”Ì3Nb
    1990 7ŒÃ0؀Œ© ‚1Icb8Å\nƒ{B\rÃË´7vƗc0êž\r“j9
    1991 Uâ&#\nmuH@6 /¨ÊaJh!Šb–ñÆü2êŒÔtƒ
    1992 ŠØ@#LÃn¾æ5õs‡*z„ïÚV˜ÀŒŽ ΎC0ޖZªûpçÚã›_xmZŸ¥#vËdpýøúív›§¦‰³Â†Ž
    1993 û3 p€à4Ú£'
    1994 
    1995 ,ݪ3¡À:Ð^ŽþÈ\\î
    1996 àäLÃ8^Žücà„\$!xDڎIhéè‹÷4ÔÙ\0à¸_C xŒ!ò¢jRY²Eæ©©†pÛ\nºMPŽ–|ê
    1997 ñâ\r¦@¥ž(
    1998 „)\\ å욦(r8ç<†A<Øá;håpÉÁô`qIO2ÙW\0l!„g&\0PTKl)êÈ9Ãa«€Ž–‚\0‚îœàe^Á¹Ñ@µ~®L DqD蜢xO“ÙA Ñ<=\"‚xŒ4Q!©EH
    1999 Ã\0
    2000 ±upäÍŸ²
    2001 ˆ`h)\$,’(
    2002 LÈ q'p7¡R:@͑´Z¡Å‡•\0Ì
    2003 ’TN
    2004 uN›#ÄÛ        L5FÌÔ¼ZM€O\naRAGšcAG\rå-Â1·:
    2005 ™QqN\$ƒrR¤Ò/S©t£”˜*p¥“ˆ<A^\r f֌Y!DCÅs/ WIÃ~Ἅ¶„Qˆ\"ì%˜ƒWš‚ Pw\$
    2006 œ²‚ sÉDE¥09%Òh—ÈdBËp^APØ^]BJÌ'„à@B€D!P\"—9ü(L´ë³ ƒ\nKHFa”Ä{à
    2007 1H8\$õº“‚xpŸk4\"P̞Ùé'jr|×òs
    2008 Zý<¦Dö„ãàr¢d)«£³Ðzœ›4O,Y«†w„ƒ:\r:
    2009 Xñ@ÓÖzjSMM¡>'áH 2µ\r5'       ‚Ê[G< (+
    2010 ÀÒmhS
    2011 *9ÖFb°ø:핸m!ÑȄ§áÿ­óðÆb‹•\rÎ¹%¾¡C©;)̨9ó3¨Ùeõ¤4 »’ƒƒrKeÀ1’PÈ©ýO­,àæ;*j;ƒ¬Š:È©RáCYêN^î&°1òeIs\na€(*ÇF瑡[žæÝÏ3<ˆÌ)„ðÙÓ#Mu
    2012 äµ
    2013 K¥u
    2014 Î<ËýxÀÌrAPfЄ–†\"½[\\dV•x7 ·:µLT!\$Ážó”Æ)V]b_Cˆþ4¢˜Ö”èS]€µ¥Èòb“›p/,m¸Ë*ìª
    2015 \r;Èqo†,\rSØs%·<4!F˃ú¡@é1¢;\\p)ïà ó\r™
    2016 :
    2017 0þSøMâ5‰Pd-#Ó&—%PÈhIEÇØç.ÕÞC±
    2018 tNàUL5I±rÄí»\"®åàVÍNJtjð¯äìZ/1{JO˜rø\$òs:\$€w­¨¶2FCköÍ÷ÁY\$
    2019 q.!T9
    2020 “F@Aár˜Šv%Õ<QkîlÃ9öŸ2OK‚ˆ\rÆrØ©¥âÉV‘w,ìŔô̼©ùpÎ( ©kt¦X¦R¤ÀËæ;TZÆ\"%¬)j•B®iËáž2íMSŒN½²Z›Y°³ÿ°­qf\$”Á@êl’ä×ּߝ€åOÃH¬†É\$B„JJy§=´]      R9b‹ÌÜ«šÑM¢Cw!ÏX\0*b!Kemë¬Ö:Ù¡\0[G-B2‚š'D™¨k'§¦§ÀîvƒjJµAŠTM–Ëøu\\JÛIl굡ê“6b,eæ‡uG5bÜ)Z¾ü[žFÂx¾Í7“Žl|Å#ÌqíǍS͐™—²†`ÃÅG>|D`1»EA€'ããC‘zdÆ
    2021 5ŒhAºDéFãېJîQáu\0á@î»×ç¤öß[®Nùã<û
    2022 _Ž1ž›‡ƒ¥v‰©·¡ÎߟƒRvûÊ1¸Væ      ÏR˜G‰-
    2023 åÁuPè€àÙl¾>wóÒ§Z‚0=ó>âö7èx+        GsœYh
    2024 ~£–pñfßØ|òe]ºã÷
    2025 `n      
    2026 ;\$˜}PnsåÙ1·<É(ÐÊ£ù¯mµ±ðÒiñ”1î¼´}@̌
    2027  t·ÐÚlÊM/‘F¼ý¯Žþ·øþ”ü?pÔëKãùþïs²juZ‚Pe#”îœ#\0‚Ìl¢sÇ@҄v\n\n¾ÿM.ûÎ)\0ËÛù-k‹Ý/äæEhVÊFÔã{P
    2028 DîSb
    2029 V¤n¤o©‹Þ£o #ƒR\nC
    2030 `ÖWÃ\0ÛÅX\n`ʑ
    2031 ¬å-\\,i\rÅúúîèÐiÍW
    2032 ¥9ïÜú‡       %D£påpu\0á0&¡      p úCںŒ»×«®S°
    2033 Æ!¯Ó
    2034 Ð¾S°µ
    2035 ï„¦c\$F§©´¾kÎZd6ApÐፂC#è¿oÈæÐðLѯ¦ Æ!k>\nCêÛHB'êt\nÂYr=¦Ý‚–Ս<\nDÊb 45Wˆ
    2036         fÂY¦ÜlcP¢+։𠠠Â&RGxë,p0€†P@Ø`Öhð\\UäXp Ê9ƒœUÐT\rê\$ æé¸mäø*\0m‚<\n ¨ÀZ
    2037 d^:‚hČ>ÌڜÄEΪn®8ÎN<IÊÎh
    2038 ÿäúŒÍÞe­†\\âR%cP&\$    ±¶
    2039 Åäciô݃        kôAb< ­¢#ËÄáCE¯ôÞMFL°·1’%Ãp¯BÞHF<M‚6:„žš‚\r¤Ìq       LHâ]‚¼°îÚcÄ!Š­DBƒŒxƒÄ8
    2040 Ò\$¦ìµ¯æ#æb!@ÞA±
    2041 cÄäŖ<@Ö\rçŽùRT#҈ó0‡ÀȒ\0á'%(.R3ƒ<ÄcÅ)\$n
    2042 Ý(-’oâú\nÚ\ne†!q¥
    2043 RÂ&©\nLÆ(—©pÞâ8à‚¥ht¥:>gJ!MRêâj6ê±KÜú«X¬ Æ­Ð¤2º±ˆž'd°±
    2044 2bF6x\$šÌ­B.,é&
    2045 \rÒn
    2046 ®
    2047 ^éÆΪ¨„ºBŎQ’z6`ʧI“),Êeª6ß0\nÎhóƒ îKpˆFƒ~åÔ
    2048 M.J¢Z¼¢:<Pä\"À@š       t\n`¦";break;case"es":$g="E9jÌÊg:œãðP”\\33AADãx€Ês
     1975÷d¼Dï1#Åf\n\nÐxP\n5B.\r@";break;case"de":$g="S4›Œ‚”@s4˜ÍSü%
     1976ÌÐpQ ß\n6L†Sp€ìoŽ‘
     1977'C)¤@f2š\r†s)Î0a–
     1978À¢i„ði6˜M‚ddêb’\$RCIœäÃ[0ÓðcIÌè œÈS:
     1979–y7§a”ót\$Ðt™ˆCˆÈf4†ãÈ(Øe†‰ç*,t\n%ÉMÐb¡„Äe6[æ@¢”Âr¿šd†àQfa¯&7‹Ôªn9°Ô‡Cіg/ÑÁ¯* )aRA`€êm+G;æ=
     1980DYÐë:¦ÖŽQÌùÂK\n†c\n|j÷']
     1981ä²C‚ÿ‡ÄâÁ\\¾</‡ÛærQÓ¯@ݚ
     1982S´—¬†J97
     1983%
     1984?,äaäa#‡\\ç”ÎÂ1J
     1985*Ž£nªªÅ.2:¨ºÏÛ8âP:®¦ŽŽž—\r    fÏã:9#c2
     1986/KÞ-
     1987)SÞ¡µîz-:`T`æÍ0èíH
     198849BpÊÎ:CÖã(Þ6Çë Ê   ¤V‘£ƒÃ ƒËÔ6»h`ì¸Ãòâ(
     1989#˜æ;ãéÊt¥Éƒx΀SÅ2LÈ;Âï1Œ»v:ÌlÔT僐êގ®¬¦Î¨¯x¬­á49 Rú¿¶ôqIH<qèÊ:¡ŠÒ9¤cÒ
     1990ˆCÊH„µ%L–Í
     1991XAD&(ò@Ï+z4¤x‚3¨Ã(Α×
     1992۔:¹
     1993e(­
     1994J*åX@RüõQ(õ^ÍÈÜÿŠƒ(ð:\r”zX5½gZ°!\0è¿-è8Ç)»bˆ˜‰r:r\r÷ø7
     1995¢Ljáɍj¤¬œVÊ2˜×KSSœá.
     1996áˆcÔÛÏ3LÖ5Ã*r5-\\–\$£„Ë\n¡xŠ<dS3„÷ÒlӉ\$˜¦ 5`ÎÞ0UƒÞ6P.Ú´ƒ (Þ3
     1997ÃbÏ\\6#l`´ÝÊÖ^9
     1998ÃzV6\rí @&MÈZ+bV\"Ìnƒßdä¨ë@–„\n ‰¨
     1999øƒ\rȸО )ÈØ:z=© Èf««ë(6¹7ÚþÂäl›2ƒ´íy^ݟî•Rn°í]¼¡[àÝ¿&b¦)Á\0¨7´Ï%®ÈçŠ/#\0 Í’
     2000#L£hêŒÄJxú?ØÅ
     2001!=jf éL\0Èÿwü=z¯3ìU¬3Žc ÃNPÃXŸ%s[dìýú÷àÊz^šªL<äÂ곔Ǒî*w
     2002íúþîȃ
     2003BáŒÁèDWàp@¼‡x
     2004
     2005ˆÐmháÈ&PÎ
     2006ÈØ/[F,„\0^—1‡%ÑÿðÄFQ¨\"̀8õúÉn€¼0ƒâÏݱPnq¡’6kQkp8ÁÉy‘žnA9X¤Ì*Ÿ`d^™'2'T(€ 
     2007B™-‚¦b §Èfo«Q+d
     2008½2òÑÁ\0EGHÅÃüi      N'M­™HÀNyÔ)ÆDÎ*è›ãd:‘œŽ‚‚¢\n_‰O#áÈÑ)C;°B¤°Fòƒ*ù\rÍV
     2009,r`Â#?'\$Ý¿;ò|P4ŽH¤Ç\0\$ªQÂð¿‡\$0]92l®Ò;ðÐRYƒ\näqË»Sg(d™÷‘
     2010tÕ«\":C\$\n/gT–E SÍ{˨•¢”i\r¶kQF2“0 Â˜T©è„
     2011€QƒyJl†¥å‡§-
     2012åñå
     2013¤”°@ã‚[E¤MsÇ<\r‰¤—iÕ7(à¼d™EP²XÁš\0ÖRrÂtDtMr»§P\$Ðì`¨\r
     2014z#-5¦GHù°Š!Ê}7BÈܱ3Ëð2!
     2015º/€/\rXŒ¡UfÂp \n¡@\"¨K•A&ZŽx  ы\rÁ
     2016\$#Ú¨í[‚`>é\"9)\$“òK  áŸ,ЭA)ä §ó&¼Cl'0äT€›“ÚdÂqøom¬÷חByNÐE>'Íf™v.säH¼v!ô¶.iº
     2017¤úÂgaÞº}‰þË°g~ÄÌqmFu14cԂ±‡\r+ ú®s|
     2018íCX0È
     2019KXSã¸-'N3-xd¸»’<;jTW„8!¶Ó³C‘¶´3Î~”°ÉÐkwnY{2X
     2020Óó<Ivù
     2021“êÍÁÄ+à‚Äزf¢Ã(wº*P·Õ
     2022ėѲ´—à›HÃTˆU•Í¤ÿ#&¤†„a*ҚSc#NIØh®¡Ö»²Âè¯
     2023ˆTÂä°êá%«
     2024
     2025‹zä0Ñc¨ÖÈ\nCŒD°1Û`î\$ªg\nA¼þ4s˜.6ŒÌý9ä?gٍ¡”èªT E:èÃÈ
     2026Ó       %¹°^XœÙ—TqT<¤f{IÉdÀƒY’X{CBf5¹EOª Zö9+&'»¼sbnjz\neƒ;™ÛSDB|Ž×æz²‰Mó®Õߛ2ãÍjÏ=Ðåìàds  `Ê´_C†,¶¬\\6‹8e{7eý ™ž:|Î)?:™¼î_Ö¡b¥—2˜P{á%0m³:SH_¦i\nª(þ÷¤r–‹Œ»x{Q«~„¬Î£1†“d2Þ¡ƒq¢¼F0'(Z:Jvy»`
     2027FºäÊ
     2028k\0¶c&0 ©S®b-æ«#™L=
     2029%E
     2030HC[)fk\"ˆ7‚@»Ó2™Ä½ÈÛ¢ÓÆJË2Õ+À
     2031-ƒ9<én{.ú+dσ.ž
     2032Ìu–¯)\"€^*’ÎáÍVék´{QZ
     2033ýj Õ±n+ãßV­eæ½8˜~b°kíW㠃˜¥‚¨\$¿—é¸Î%¨:Ú¡R¯œ½v@L¬ ¦«U[\rg¸¿\n<{òÇuÞkƒlÒ¤ýq‚¥N/+²df›¯ôe/¾ìoe`üa™;ÑÃÞÞò5f»õþèÏ;ã]ãˆöþ&½²^=øϗ½Ý¾4G1åmû»KþhÏDÈøÄ+ã¸~ŽÎ!ÓÊëS1ˆ7™Ï/Û1ªjF0y´'}fòõºeƒ}
     20348ö^?€öå1e©Ÿ®ÁÞèÀ{Ç
     2035Ú8É3\n*pÀ‚ÚJšs쎆ßbi)Mì-èÓÓD    ­né1G;I>€ú_QÑ
     2036ò¶™YÖg”ÃøÛgq[4‰ëë|B:[D(¦/Z\r¯^%O®\rŒ
     20370ξ„–Á,éËÄ4,&£¾ðŽŽ²Ð,øÂxëCâ½åŽÿPBïæLÓ`ÎÅÐEË,NjP0ðΑÐR)°Dù°QNŽÆðwÐLPl>6@”
     2038°Š¯ÆöŽ\0‚ÔM>yŒHú†8Ə>áÎý‚fóÈÁ/
     2039
     2040ný\0V
     2041l¬¬\0S  ´pÚÐ{
     2042„k
     2043Ђ´@Þ3§–:°âé€à (f\nC\"
     2044`ÖWîRÿK`Š âS
     2045«ŽòÜNöK1\n#Úìë@²Ñ     Ñ
     2046í¯
     2047
     2048±Î9@˱ï¾ð
     2049»B¾â‘C
     20501#Ðó\r°ðÈ\\ŠÐVö°>RL6S°¸îm1qÒâ‘n:±Y1\\fDf€0Ê1°~¶ºAãªö‹*Cd
     2051Çñrðñ›‘|ù\"*L\"
     2052¦ñ«ÆI>=à®\r\$\nPGºTny\rOʙ è\ràଇ\0spÓh¤Þ\r½
     2053+,      f°Y§6)šª„Αͤ;G6&T4ÂvõLÒB\0†P Øqøx¥^E£\n;\rÓ@@è\"Z*†~BOȆ`ª\n€Œ p4©ðBÏÀ0lȂìëâpÕÄ-
     2054o,Ô¤
     2055øÂ;&-déšLiHçn>\$í°×\"T˃Æ
     2056cƒ\0¡ƒÞÜã²=ñ®›`4„šJƒr6.ÝÊ@‰~†r8c>·‚ÜGàôè@˜#D–       ¢RØ¥\\¤cÞH¥@\r£¨ÅŒ\\¾q^#®#§¶.ê<¥Ö\$€R⎥\$!Jø0n?/\rÞ# ×
     2057g.Æ)';‚ž\0Èm@á0s\$0S)
     2058*O1jKÑlB˜#³<º!ŽHq„–2éøž¦>R\0ñ6i®õ£„l¦J+Æf3-M-\$ .ƒ€AËP?\0êæŠÇ4+¸‘ÂtJ˹\r##
     2059#Rúd”
     2060\$™/ƒI/Å\rÓ
     2061®¨_M´@£,bË<ŸGˆ
     2062©¤¶)\\!E=åâ
     2063¸c†Jƒ8kVhӌ‹Kåq
     2064D㦄¥Øií %ŒX#ƒIà/b";break;case"es":$g="E9jÌÊg:œãðP”\\33AADãx€Ês
    20492065\rç3IˆØeM±£‘ÐÂr‹s Òv7‹DYT˜Úaa¬b¦ØâE2H%’é„Z0%9¦P\nÊ[/Š›¢¦YôË2†Ìh5\rǐQ¸Òn3°×U Q¼äi3ÙÌ&ȝNªt2›„hñ„ç2&›Ì†“1¤Ç'Lç(>\")»ÞDˌMçQ ÂvT£6ó±¦>g‹Þâ§SÃx½Ë£ÈüȎu“ëŽ@­¾æN <ˆ
    20502066fóqÒϸ”prcqÞ\n)çìæ}ç#u› Ò]üri¼Þ&fÉËvIÁ›æࢩÏP·
     
    228923052\r°˜0ˆæ~T¨s&Ž¡á#b{™ÀÙ­3œ£¢
    22902306Ö»×e@Ï>#÷*舣ƼLjz
    2291 TÂÖK8¨NéN§>`ÃF€@É=†3ƒä
    2292 ­‚ü@Œ*t\"]óÎB]Cxᄻ¿=£5Ea»¨B+אòÕa#rÉ(_Ã%çØk¸ÀH¨±ñs‡Â¨¼‚!ÉT|¬
    2293 
    2294 ×͵s‡=[t        OFXáL7AÈt*\rã^<b˜¤#=«,¤º°D óŒ¨Üƒsjêd3%Ãk<‡²©ÓÍ
    2295 ¨4–3'uBDc„—=ó<Î ÈF@Ÿ˜ò‰DFü;óR”PûÆ\r鼔ÒFJ ë\0~Ë`êƒÂz
    2296 ¨f ˆ4Ààx/ðŒÈñÉÉ.
    2297 à½BƆŽÈ/JÈ95°éÂù&^a¬àšnÍé^3!½‡c*xaÍ4ž†Ô®
    2298 YS!!„š”àӟ`n6P5G/8‰žÓû5gè횗ÄR¹\$C‡*Æ£2XK¶ViôÌ't.†cq       \n (Àê
    2299 òš\0 ªCLWÌ`s\$!¸’œ”ú¡à\n`ç„Ì®ø ÅÌ  sÈÕ¿2ŠùƒkŒHd€§œòRdàq’/eÆ'þÕé0CÄx‡–øcž*(-ânBL«%”ÎI\0ƒ ȁ0’d1†ÂDa¥úqkn\r·Ç žÂ¡>u€k¯4,uRp©
    2300 ˆ)¸°OÞáR63U`¯ä£,\"üæ'¯Y~'¨ðŒ‹1q¤Ðÿ‡%¶ÂcØP4FÖ9ô
    2301 &t&&    Ák’\"–VÊp c18•ÐŒ#ê<cÆu{“VKIy])!ÂrPƒ’g:‰]Š’•çñþL)0°Éšœƒ*½A<'\0ª A\nÓЈB`E¨hÊbÅrzv&sŽ©’†qÑPÃ
    2302 A½Dè¥|/§*tBxp’ˆà2Ÿ“<T^²\0hÑ^¾†pžLg5‡Í!‘\0áM?DÂ3òPÐuw•\r8ýªÊ\"Lš÷?'í:3Dà͙ÁJ\"X¼\"b°B[a±O
    2303 ÞA
    2304 ’¢•Ìœ~
    2305 ®'5BtÖcZ
    2306 Å¶5+8Õ{lä¢ÖØùª–‘,ê®k  ݀ƒ\nëVitÐX
    2307 £s      žàéâ’îOP“\0Ò€ÜÙ
    2308 ¢\r¡yä9²PAs\n¢MŠ“ù\"•³¢TŠàiÐ>K†‰È{ÜH%
    2309 Á†ÄÉjd¥‘̦Hþ|‰an-ê”{*hîmU®¨˜S RCÃ.1jÂ3’!„!Ã!iFªl&ªLpkàUÌÛCL˜g¦jJ¼LÖ<§Â›ÄM+.òN±ü'e%\0pÉ\rK+K\"ôšÂæI
    2310 b\$;&\n¯QÅ·l¶Ë”XZ0lÈʛ‰ðkÉìÁbŒYI<P^ù1/†c,Ò;blU†0ރ“Û 5!Ž?0Ƙ]ÃÄÍÙ¬”Ü>SÛ©[¹Ï2\"<î
    2311 3ɨY¹÷?ŠñszGJ£DZhé‰kdÞ7Ç;\n“×ÉÓÅÌYÑ
    2312 ‡¤sޔЧU1,Ɨ4v¦Ï\rS=i3;Ÿµ™ÒÕÚ鯥§LTKw#­t—b6ŠVŠiü£íz§\r ˆ¤AœŒ§&ɚîi\"¤Äq3#ð‘
    2313 ²6+ú”R @Ã(bØZ=KPý¢`2æ¬+¯=ƒ›NC2éÑ1GhønC=N`\r&)ùq‘А–ËÛ%±Uìè¼Ä
    2314 ¦ð¡;ê鎱ò{hM¢À”«ñ±SKUë W\"§Hr
    2315 \r§
    2316 Ÿ%ã\"\0Ï~?Ë-   •PP°ågʹ^?ëDóÖÒL¹¿-ãÓ¢“Ώ9_Jc‚§¢£:¨J'<sÐÙjߔ~Ee8©¬Êø(\\·~I­:=—!V:§(¯gq\0“ã
    2317 
    2318 À:^o.®’W˜A\rø4”Š¢¾ÍÅýêÝÚÙ»#ú¡3¶Œ–t֟c¼t‚é6
    2319 ïVÏ,̼Ãnµå+Íò
    2320 §çüo¢ñýœríÑr›9¶~¨ÛoFGJÃFnM žú^Ei9‰;¤í/ÞùL¶>¹gÞí¦{î_veY€”“ŸÌÒG¾Ôºüh,՜4/¯“ '§G·ö~6¹ûŒåÌiB~LÓÝ;r
    2321 QL
    2322 C~û]?íï襮¢¦,Tÿ. è/âÓ«,©ð\0þðÿOÒôïü)J pË4#Œ4GhOÎÚ ÞێΆüª¨œCt'ʸs€mÃh\0òÏP:lãÚÂü¢ðp(f¢ /É(=ƒ`õI[\0Ì=ì^E1Æ>päJ¥`‡nY\0LV¾ÎU„\nOl\$Ӄ,Æogj¤éÅ[\0¯Zï/?
    2323 ¯XéJʱpÂ;°Æ´0 DÏbƂQ
    2324 ®42lš
    2325 žá/|ònFù.MpêãÏÓ\0ðõLœáüè0 1-ƎW‘WÐۑ°OxáŽ*Qɒ:\$„
    2326 .\$­c\"Ü¢ºbi½¢@¥®ZèÏ̙0Òä0ðøüúäXý
    2327 üP3O±
    2328 Î¤ù\r¼geb|Œp’ªÂ†b>E„;åJ¶/dÊ¢²Zqñ”·oúœd€ETa#*dDbéÉTd¬q\$¿ñ]±¶;±»bQÄ2q¸!qÍw'ÄTÕ
    2329 Œ7ÅW
    2330 l^_
    2331 ï°ï
    2332 *ú/r‘ùñu¬®REQ‘RNÂÅÌpG̽¯(ä
    2333 !ìnÇ1ÚüH]ÍM#2\$+¯}ñ‚f‹#Ò Ç,Baq%@ÜÀ¨§ àÉL™jt       „&Aì²_÷
    2334 Ò'\$ÔM’Eò8ãL®E̵
    2335 ÒH      ô÷l%\$êbWź ǜÍ1ˆ!bFÏ|¸#6bÎbͱ ·¢³ÏÓ+Ìè3‚u        c²1çŠJ&!Ëì-ò̃¢x®få/#’Å/(,¦?n`¥ÒÖ,@Øiš\r&J5c:öièËÃo
    2336 .ò'/„!-®¢0Š53bÆüÅãGž\n ¨ÀZ\rRÐoÁ
    2337 ÅÈÙ­,M2)RÌè3V!¥4'M˜\$l:a)TnÎÑ2F
    2338 ÃÍ8’g[¦œíÐ1äÒË8&DyàE8àä†s#2cˆˆÞëÃp'NÊkeÚ!‰        ñ6†±'<&¶> ØÏlñà[:3ä^ˆC¶1ë.éó\0³ð¾,C²Îoæ)S>¯Ó#Êôÿ§•2³èX3
    2339 ã°~Ók@“û@Óí
    2340 ùAsçA²Ì
    2341 Lvý';gL•TÁPzGº#¥º\\%ÂËî>Œ\$ë
    2342 ò?ʾ·K SBv«ÉêëþÃ\0Š‘Jö=²Ž•D´ü:        ¤t¸D@ÊX\0¬'\0î·ë*§jÄ^ÊP0\0Ü(ä¾@ãÞã)ÂíC
    2343 usò;£¢¯¯Š\"UfBoÏSEëaKËl‡]†ÊJ(f¾\r,\rH
    2344 €.àËI+P1ÖO€%ÊÜA†
    2345 ªNR>EÞ@ sÀÜ";break;case"hu":$g="B4žŽ†ó˜€Äe7Œ£ðP”\\33\r¬5    ÌÞd8NF0Q8Êm
     2307TÂÖK8¨NéN§>`ÃF€@É=†3î‹F„W8²”4%Ízø§B%ß<à%Ô7ŽK±›ñ0årT¦È=4+אòÕW.\0ܲJðÉyö\0Úî Ap*,|láÇ°ª/%wð¦©Ì s_6Õ·á?[t)OHXáN7AÈt*\rã^<b˜¤#=«,¤º°D óŒ¨Üƒsjêd3%Ãk<‡²©ÓÍ
     2308¨4–3'sBDc„—=ó<Î ÛæB¢]w®üÔ¥>ñƒzo%´‘’‚zÀ²Ø: ðž†ƒ*è\"\rð8 ^
     2309ü!Á„2<rrKƒ8/cЩ€¡£²
     2310Á²Ml:A¾I—˜k@ù®«¶Çˆz€¼0ƒæbR»€NQC2œ    “Þ6P-G/8€hKû5gè횗ÄR1#PÌåBÒH£
     2311        cVÊÍ>™„î
     2312ÐÌg2 €(€ G¨pkÊh‚¨E\r1_1Ì†âJrSꇈ\nƒž2í
     2313³9€î}™WŒQ      `u\r®9!’žsÉI“†HT½˜²÷\"Øu
     2314êô˜!äÈUa¤wƜԚ¸Wžøo&L
     2315¶eX›a
     2316\$8 ¢a)!Ž`£¸f£œáÅa†µ­¸VÞBB€O\naPŸ:Ð@µ×š:©8T†IŒçr²eHØÍu‚¿’Œ«ˆ ž½eù͋Ý.<šðä¶ØLu\nŠYyj#Èl\r𑢕®HŠY[&
     2317`&'º‚¤wGŒxίrbJÉi/+³cPƒ’g:‰”¯?ÏòaI
     2318„†6Uè\n      á8P T´êž@Š-BFHѦ“Ó±Bœ
     2319K“sš‹*\rê'E+á}
     2320ÔbĎ#¡X£¯Ã[H̙ùAÉ+×ÐÀŽÉ‹æ°ù¤2 œ0©\r8ýªÂI‘ë!¯Š¾¼kÉCP>çäý§Fhœ³8)DAë„LVKl6)á›ÇòTR¼¼3±éuƨN‚šÌ`‹A˜¶Æ¥gZ£BOmžÄØû9dˆêõD³²º,'rB\0Ud]jÍ.š\nւ”ra10
     2321<B]Éê`ÅúP+\"`4—<‡1öJ.iTI¡„3OôŠVΈIR+‚› jr.\"'!ïq ”s%ª‘ÖH0R™#Éò%†=¸´ªQì±¢@Áµ0ßT
     2322))!ᗸIˆIÂiá´ƒ!Õ6U&¸µúÚ)´¼¥ëÌ3Ó%%^i³
     2323SÆáMâZ(\\¡'\rØÌþƒ2Šƒ’ˆp†¥•¥QzMas(ŽŒ1
     2324“       
     2325W¨âkÛ&rÙèBMhÁ°#*n
     2326s3Š7å~x Ìè3˜UŒ°3bGb3¿\"5ރ“Û 5!Ž<0ƘC›˜x¹Ä”ÜDSÛª[¹Ñ†0
     2327î
     23283ɨY¹÷?Šñ3ƒƒ)ZTh‹OUYØ\rª=8;Ý
     2329å+‘:x¹’a#°ñ£ôŽ{ҚÕj¶%™RævÕAªg­&gsö´:Z¿]˜õêéñ1°&:hŽµÒ]‰š)Z)§ò5ê\0œ6’\"Fr.œ¡\$«Àe˜¨ÀRŠT‚2!•¦ÅneøÃ(bØz=KQ
     2330¦`2ö­+¯=ƒ›NC2ùÑ1GhøÄIÕî+Ùy‘А–ËÛ%±gèǼÄ
     23314îÆê鎱ò{hELx´„°É•~6*a÷       ãâ§^q
     2332ÉIß'å1&r¾ZD%\$'l9Y²'ËC)ø?Z'¶’eÍ¥æœåû€žth
     2333Ïåã
     2334=Õ2Q:Xz’ÐÙràÖ\\iE±ÅjWÁ@0ä[öL+8\n읚1Õ*›EŽÜŽë¤Ÿa&ˮЩŒ•i’V°Þ Uön/ÿU趺ÈNî‘Èm
     2335´Ö]§ÛfÝl\nW}’Sɕ*Ô|o˜!>k©tN›ã-¼|ó]+¼¢fËlñ=µô
     2336¦Ø•†ŒÜšA=ó^FÒólϽÃLô‹cßRv—!õšyõG ÊIÏá=Gm´y­N`õàeÐZg6è]¢@OMús+Ÿr\ruöƘÙt„üµ5çˆT>çôʉ-õºé•;ùbºbþΞüÏÜÿoâÅNXþŒ\\ü®Xê/ˆé‚”©ç³b8ävIØú®\rí¼ˆú7¥úxÆ*7B|«g0(Ü6€@,õL°ÃNî3¨¾!0 r\$BÐ0‘ÃØÙK\"
     2337°
     2338ÃÞÆHøS6cçDªVoû\0ìXÅËä,åX@¤ö®2: ‚ÆËh!L
     2339qŠU°o”ûð     
     2340èòôÉê;°Çƒ&è^ÊïbU„\0 ŽNÊPÊP8÷l÷©Jæ#'ìãϒSÀÊåQô°öglo¬£ì‡\r±±
     2341§*ò(n: ¨Qɔ:\$„
     2342.\$ÁÃ\"LÂ`biÃ
     2343@‡Íxè¯Æú±÷ŽI\0‘[
     2344®[\0o(3L—ÏÍDM‡Ä'§ÈÇnåÆb>E„;åJÊÊ+%¦îQ%\nñŒÿIÌHPï¤à2¦DF.š”†JÇqh´Pó1oƒ»ÐÒä1xþÈÆQ¿
     2345í:葈1×ѕ\nñæÃÏlŠ·
     2346îDòO‹núøp×mÞ±ôEQêÄò\0_*]ìtǑù
     2347L€åÜÇ,dGÌÀõpÁ\"’
     2348\"åù N§ §!R*Æ,w#©\nÒI#²NGäOààɬŸ¬‡DX@Œ·#ñè+÷Ä&ËDØ+²5
     2349ð÷&ҀˑùBt     ô÷
     2350”EŒ\"ê`Wź ǜÌñ¢·ïG.Ê3f,ä¬Þ·¢\$fø³ò¸ß2¾ïBu   ²1çŠJ&!Ëð2ÐkìÎãˆ#rÃ/
     2351¦X&?/rˆï`†,@Øjl\r&J5pa\réìÌoñ'\"v)M²¯ð„53bÉ,ÆC3‰p§ ¨ÀZ\rTû‘u
     2352ÂÀ¤/²Ö³P)RÌüÅÈÙïÞ#ÂZŒPœN        HnÎÏ2N³\nI[f\"iÊÄO–1äÓ'        Ðêì|\0E8àä†3#2cˆ—ÂQ1êV솶]¢Ð™ègÓ<¶> ØoB·\0[:3ä^—¶Ø”ë\"63T,C²˜->³>³5R*¯n‡?s渓\0´T;í6³ù>”'pË@‚AÒÌ
     2353SšüÇ;gN”‡•     ­”G¸#¥º\\%ÂÌ+BkâMÒ\\_#ü«ÊFRì«EEê?Ì(©âƒÛ&ð \$´ý‹ƒ\r†×‹‡'¢\nË,§JÂ^ÊP0\0Ü(ä¾@ãހ\$š”NÊâ¢Æ\rÆJ:*ó@Jú°ðÞd),õ/=Tº°±<q
     2354Ùó
     2355HD_JlC‹ò1»,` \\­àa!M
     2356á#ä]ä\nG>\rÀ";break;case"hu":$g="B4žŽ†ó˜€Äe7Œ£ðP”\\33\r¬5     ÌÞd8NF0Q8Êm
    23462357¦C|€Ìe6
    23472358kiL Ò 0ˆ
     
    42584269PDO{var$_result,$server_info,$affected_rows,$errno,$error;function
    42594270__construct(){global$b;$xf=array_search("SQL",$b->operators);if($xf!==false)unset($b->operators[$xf]);}function
    4260 dsn($dc,$V,$G){try{parent::__construct($dc,$V,$G);}catch(Exception$vc){auth_error($vc->getMessage());}$this->setAttribute(13,array('Min_PDOStatement'));$this->server_info=$this->getAttribute(4);}function
     4271dsn($cc,$V,$G){try{parent::__construct($cc,$V,$G);}catch(Exception$uc){auth_error($uc->getMessage());}$this->setAttribute(13,array('Min_PDOStatement'));$this->server_info=$this->getAttribute(4);}function
    42614272query($H,$Ch=false){$I=parent::query($H);$this->error="";if(!$I){list(,$this->errno,$this->error)=$this->errorInfo();return
    42624273false;}$this->store_result($I);return$I;}function
     
    42674278next_result(){if(!$this->_result)return
    42684279false;$this->_result->_offset=0;return@$this->_result->nextRowset();}function
    4269 result($H,$n=0){$I=$this->query($H);if(!$I)return
    4270 false;$K=$I->fetch();return$K[$n];}}class
     4280result($H,$o=0){$I=$this->query($H);if(!$I)return
     4281false;$K=$I->fetch();return$K[$o];}}class
    42714282Min_PDOStatement
    42724283extends
     
    42744285fetch_assoc(){return$this->fetch(2);}function
    42754286fetch_row(){return$this->fetch(3);}function
    4276 fetch_field(){$K=(object)$this->getColumnMeta($this->_offset++);$K->orgtable=$K->table;$K->orgname=$K->name;$K->charsetnr=(in_array("blob",(array)$K->flags)?63:0);return$K;}}}$Yb=array();class
     4287fetch_field(){$K=(object)$this->getColumnMeta($this->_offset++);$K->orgtable=$K->table;$K->orgname=$K->name;$K->charsetnr=(in_array("blob",(array)$K->flags)?63:0);return$K;}}}$Xb=array();class
    42774288Min_SQL{var$_conn;function
    42784289Min_SQL($h){$this->_conn=$h;}function
    4279 select($Q,$M,$Z,$Yc,$Xe=array(),$z=1,$E=0,$Ef=false){global$b,$w;$Ad=(count($Yc)<count($M));$H=$b->selectQueryBuild($M,$Z,$Yc,$Xe,$z,$E);if(!$H)$H="SELECT".limit(($_GET["page"]!="last"&&+$z&&$Yc&&$Ad&&$w=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$M)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($Yc&&$Ad?"\nGROUP BY ".implode(", ",$Yc):"").($Xe?"\nORDER BY ".implode(", ",$Xe):""),($z!=""?+$z:null),($E?$z*$E:0),"\n");$Hg=microtime(true);$J=$this->_conn->query($H);if($Ef)echo$b->selectQuery($H,format_time($Hg));return$J;}function
     4290select($Q,$M,$Z,$Xc,$Xe=array(),$z=1,$E=0,$Ef=false){global$b,$w;$Ad=(count($Xc)<count($M));$H=$b->selectQueryBuild($M,$Z,$Xc,$Xe,$z,$E);if(!$H)$H="SELECT".limit(($_GET["page"]!="last"&&+$z&&$Xc&&$Ad&&$w=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$M)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($Xc&&$Ad?"\nGROUP BY ".implode(", ",$Xc):"").($Xe?"\nORDER BY ".implode(", ",$Xe):""),($z!=""?+$z:null),($E?$z*$E:0),"\n");$Hg=microtime(true);$J=$this->_conn->query($H);if($Ef)echo$b->selectQuery($H,format_time($Hg));return$J;}function
    42804291delete($Q,$Nf,$z=0){$H="FROM ".table($Q);return
    42814292queries("DELETE".($z?limit1($H,$Nf):" $H$Nf"));}function
     
    42924303queries("COMMIT");}function
    42934304rollback(){return
    4294 queries("ROLLBACK");}}$Yb["sqlite"]="SQLite 3";$Yb["sqlite2"]="SQLite 2";if(isset($_GET["sqlite"])||isset($_GET["sqlite2"])){$_f=array((isset($_GET["sqlite"])?"SQLite3":"SQLite"),"PDO_SQLite");define("DRIVER",(isset($_GET["sqlite"])?"sqlite":"sqlite2"));if(class_exists(isset($_GET["sqlite"])?"SQLite3":"SQLiteDatabase")){if(isset($_GET["sqlite"])){class
     4305queries("ROLLBACK");}}$Xb["sqlite"]="SQLite 3";$Xb["sqlite2"]="SQLite 2";if(isset($_GET["sqlite"])||isset($_GET["sqlite2"])){$_f=array((isset($_GET["sqlite"])?"SQLite3":"SQLite"),"PDO_SQLite");define("DRIVER",(isset($_GET["sqlite"])?"sqlite":"sqlite2"));if(class_exists(isset($_GET["sqlite"])?"SQLite3":"SQLiteDatabase")){if(isset($_GET["sqlite"])){class
    42954306Min_SQLite{var$extension="SQLite3",$server_info,$affected_rows,$errno,$error,$_link;function
    4296 Min_SQLite($Jc){$this->_link=new
    4297 SQLite3($Jc);$Wh=$this->_link->version();$this->server_info=$Wh["versionString"];}function
     4307Min_SQLite($Ic){$this->_link=new
     4308SQLite3($Ic);$Wh=$this->_link->version();$this->server_info=$Wh["versionString"];}function
    42984309query($H){$I=@$this->_link->query($H);$this->error="";if(!$I){$this->errno=$this->_link->lastErrorCode();$this->error=$this->_link->lastErrorMsg();return
    42994310false;}elseif($I->numColumns())return
     
    43034314quote($P){return(is__utf8($P)?"'".$this->_link->escapeString($P)."'":"x'".reset(unpack('H*',$P))."'");}function
    43044315store_result(){return$this->_result;}function
    4305 result($H,$n=0){$I=$this->query($H);if(!is_object($I))return
    4306 false;$K=$I->_result->fetchArray();return$K[$n];}}class
     4316result($H,$o=0){$I=$this->query($H);if(!is_object($I))return
     4317false;$K=$I->_result->fetchArray();return$K[$o];}}class
    43074318Min_Result{var$_result,$_offset=0,$num_rows;function
    43084319Min_Result($I){$this->_result=$I;}function
     
    43124323__desctruct(){return$this->_result->finalize();}}}else{class
    43134324Min_SQLite{var$extension="SQLite",$server_info,$affected_rows,$error,$_link;function
    4314 Min_SQLite($Jc){$this->server_info=sqlite_libversion();$this->_link=new
    4315 SQLiteDatabase($Jc);}function
    4316 query($H,$Ch=false){$se=($Ch?"unbufferedQuery":"query");$I=@$this->_link->$se($H,SQLITE_BOTH,$m);$this->error="";if(!$I){$this->error=$m;return
     4325Min_SQLite($Ic){$this->server_info=sqlite_libversion();$this->_link=new
     4326SQLiteDatabase($Ic);}function
     4327query($H,$Ch=false){$se=($Ch?"unbufferedQuery":"query");$I=@$this->_link->$se($H,SQLITE_BOTH,$n);$this->error="";if(!$I){$this->error=$n;return
    43174328false;}elseif($I===true){$this->affected_rows=$this->changes();return
    43184329true;}return
     
    43214332quote($P){return"'".sqlite_escape_string($P)."'";}function
    43224333store_result(){return$this->_result;}function
    4323 result($H,$n=0){$I=$this->query($H);if(!is_object($I))return
    4324 false;$K=$I->_result->fetch();return$K[$n];}}class
     4334result($H,$o=0){$I=$this->query($H);if(!is_object($I))return
     4335false;$K=$I->_result->fetch();return$K[$o];}}class
    43254336Min_Result{var$_result,$_offset=0,$num_rows;function
    43264337Min_Result($I){$this->_result=$I;if(method_exists($I,'numRows'))$this->num_rows=$I->numRows();}function
     
    43334344extends
    43344345Min_PDO{var$extension="PDO_SQLite";function
    4335 Min_SQLite($Jc){$this->dsn(DRIVER.":$Jc","","");}}}if(class_exists("Min_SQLite")){class
     4346Min_SQLite($Ic){$this->dsn(DRIVER.":$Ic","","");}}}if(class_exists("Min_SQLite")){class
    43364347Min_DB
    43374348extends
    43384349Min_SQLite{function
    43394350Min_DB(){$this->Min_SQLite(":memory:");}function
    4340 select_db($Jc){if(is_readable($Jc)&&$this->query("ATTACH ".$this->quote(preg_match("~(^[/\\\\]|:)~",$Jc)?$Jc:dirname($_SERVER["SCRIPT_FILENAME"])."/$Jc")." AS a")){$this->Min_SQLite($Jc);return
     4351select_db($Ic){if(is_readable($Ic)&&$this->query("ATTACH ".$this->quote(preg_match("~(^[/\\\\]|:)~",$Ic)?$Ic:dirname($_SERVER["SCRIPT_FILENAME"])."/$Ic")." AS a")){$this->Min_SQLite($Ic);return
    43414352true;}return
    43424353false;}function
     
    43604371limit($H,$Z,$z,$D=0,$vg=" "){return" $H$Z".($z!==null?$vg."LIMIT $z".($D?" OFFSET $D":""):"");}function
    43614372limit1($H,$Z){global$h;return($h->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')")?limit($H,$Z,1):" $H$Z");}function
    4362 db_collation($l,$nb){global$h;return$h->result("PRAGMA encoding");}function
     4373db_collation($m,$nb){global$h;return$h->result("PRAGMA encoding");}function
    43634374engines(){return
    43644375array();}function
     
    43674378tables_list(){return
    43684379get_key_vals("SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY (name = 'sqlite_sequence'), name",1);}function
    4369 count_tables($k){return
     4380count_tables($l){return
    43704381array();}function
    43714382table_status($C=""){global$h;$J=array();foreach(get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view') ".($C!=""?"AND name = ".q($C):"ORDER BY name"))as$K){$K["Oid"]=1;$K["Auto_increment"]="";$K["Rows"]=$h->result("SELECT COUNT(*) FROM ".idf_escape($K["Name"]));$J[$K["Name"]]=$K;}foreach(get_rows("SELECT * FROM sqlite_sequence",null,"")as$K)$J[$K["name"]]["Auto_increment"]=$K["seq"];return($C!=""?$J[$C]:$J);}function
    43724383is_view($R){return$R["Engine"]=="view";}function
    43734384fk_support($R){global$h;return!$h->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");}function
    4374 fields($Q){global$h;$J=array();$Cf="";foreach(get_rows("PRAGMA table_info(".table($Q).")")as$K){$C=$K["name"];$U=strtolower($K["type"]);$Mb=$K["dflt_value"];$J[$C]=array("field"=>$C,"type"=>(preg_match('~int~i',$U)?"integer":(preg_match('~char|clob|text~i',$U)?"text":(preg_match('~blob~i',$U)?"blob":(preg_match('~real|floa|doub~i',$U)?"real":"numeric")))),"full_type"=>$U,"default"=>(preg_match("~'(.*)'~",$Mb,$B)?str_replace("''","'",$B[1]):($Mb=="NULL"?null:$Mb)),"null"=>!$K["notnull"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$K["pk"],);if($K["pk"]){if($Cf!="")$J[$Cf]["auto_increment"]=false;elseif(preg_match('~^integer$~i',$U))$J[$C]["auto_increment"]=true;$Cf=$C;}}$Fg=$h->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ".q($Q));preg_match_all('~(("[^"]*+")+|[a-z0-9_]+)\s+text\s+COLLATE\s+(\'[^\']+\'|\S+)~i',$Fg,$ee,PREG_SET_ORDER);foreach($ee
     4385fields($Q){global$h;$J=array();$Cf="";foreach(get_rows("PRAGMA table_info(".table($Q).")")as$K){$C=$K["name"];$U=strtolower($K["type"]);$Lb=$K["dflt_value"];$J[$C]=array("field"=>$C,"type"=>(preg_match('~int~i',$U)?"integer":(preg_match('~char|clob|text~i',$U)?"text":(preg_match('~blob~i',$U)?"blob":(preg_match('~real|floa|doub~i',$U)?"real":"numeric")))),"full_type"=>$U,"default"=>(preg_match("~'(.*)'~",$Lb,$B)?str_replace("''","'",$B[1]):($Lb=="NULL"?null:$Lb)),"null"=>!$K["notnull"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$K["pk"],);if($K["pk"]){if($Cf!="")$J[$Cf]["auto_increment"]=false;elseif(preg_match('~^integer$~i',$U))$J[$C]["auto_increment"]=true;$Cf=$C;}}$Fg=$h->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ".q($Q));preg_match_all('~(("[^"]*+")+|[a-z0-9_]+)\s+text\s+COLLATE\s+(\'[^\']+\'|\S+)~i',$Fg,$ee,PREG_SET_ORDER);foreach($ee
    43754386as$B){$C=str_replace('""','"',preg_replace('~^"|"$~','',$B[1]));if($J[$C])$J[$C]["collation"]=trim($B[3],"'");}return$J;}function
    43764387indexes($Q,$i=null){global$h;if(!is_object($i))$i=$h;$J=array();$Fg=$i->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ".q($Q));if(preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*")++)~i',$Fg,$B)){$J[""]=array("type"=>"PRIMARY","columns"=>array(),"lengths"=>array(),"descs"=>array());preg_match_all('~((("[^"]*+")+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i',$B[1],$ee,PREG_SET_ORDER);foreach($ee
    4377 as$B){$J[""]["columns"][]=idf_unescape($B[2]).$B[4];$J[""]["descs"][]=(preg_match('~DESC~i',$B[5])?'1':null);}}if(!$J){foreach(fields($Q)as$C=>$n){if($n["primary"])$J[""]=array("type"=>"PRIMARY","columns"=>array($C),"lengths"=>array(),"descs"=>array(null));}}$Gg=get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ".q($Q),$i);foreach(get_rows("PRAGMA index_list(".table($Q).")",$i)as$K){$C=$K["name"];$u=array("type"=>($K["unique"]?"UNIQUE":"INDEX"));$u["lengths"]=array();$u["descs"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($C).")",$i)as$lg){$u["columns"][]=$lg["name"];$u["descs"][]=null;}if(preg_match('~^CREATE( UNIQUE)? INDEX '.preg_quote(idf_escape($C).' ON '.idf_escape($Q),'~').' \((.*)\)$~i',$Gg[$C],$Yf)){preg_match_all('/("[^"]*+")+( DESC)?/',$Yf[2],$ee);foreach($ee[2]as$x=>$X){if($X)$u["descs"][$x]='1';}}if(!$J[""]||$u["type"]!="UNIQUE"||$u["columns"]!=$J[""]["columns"]||$u["descs"]!=$J[""]["descs"]||!preg_match("~^sqlite_~",$C))$J[$C]=$u;}return$J;}function
    4378 foreign_keys($Q){$J=array();foreach(get_rows("PRAGMA foreign_key_list(".table($Q).")")as$K){$p=&$J[$K["id"]];if(!$p)$p=$K;$p["source"][]=$K["from"];$p["target"][]=$K["to"];}return$J;}function
     4388as$B){$J[""]["columns"][]=idf_unescape($B[2]).$B[4];$J[""]["descs"][]=(preg_match('~DESC~i',$B[5])?'1':null);}}if(!$J){foreach(fields($Q)as$C=>$o){if($o["primary"])$J[""]=array("type"=>"PRIMARY","columns"=>array($C),"lengths"=>array(),"descs"=>array(null));}}$Gg=get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ".q($Q),$i);foreach(get_rows("PRAGMA index_list(".table($Q).")",$i)as$K){$C=$K["name"];$u=array("type"=>($K["unique"]?"UNIQUE":"INDEX"));$u["lengths"]=array();$u["descs"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($C).")",$i)as$lg){$u["columns"][]=$lg["name"];$u["descs"][]=null;}if(preg_match('~^CREATE( UNIQUE)? INDEX '.preg_quote(idf_escape($C).' ON '.idf_escape($Q),'~').' \((.*)\)$~i',$Gg[$C],$Yf)){preg_match_all('/("[^"]*+")+( DESC)?/',$Yf[2],$ee);foreach($ee[2]as$x=>$X){if($X)$u["descs"][$x]='1';}}if(!$J[""]||$u["type"]!="UNIQUE"||$u["columns"]!=$J[""]["columns"]||$u["descs"]!=$J[""]["descs"]||!preg_match("~^sqlite_~",$C))$J[$C]=$u;}return$J;}function
     4389foreign_keys($Q){$J=array();foreach(get_rows("PRAGMA foreign_key_list(".table($Q).")")as$K){$q=&$J[$K["id"]];if(!$q)$q=$K;$q["source"][]=$K["from"];$q["target"][]=$K["to"];}return$J;}function
    43794390view($C){global$h;return
    43804391array("select"=>preg_replace('~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\\s+~iU','',$h->result("SELECT sql FROM sqlite_master WHERE name = ".q($C))));}function
    43814392collations(){return(isset($_GET["create"])?get_vals("PRAGMA collation_list",1):array());}function
    4382 information_schema($l){return
     4393information_schema($m){return
    43834394false;}function
    43844395error(){global$h;return
    43854396h($h->error);}function
    4386 check_sqlite_name($C){global$h;$Dc="db|sdb|sqlite";if(!preg_match("~^[^\\0]*\\.($Dc)\$~",$C)){$h->error=lang(21,str_replace("|",", ",$Dc));return
     4397check_sqlite_name($C){global$h;$Cc="db|sdb|sqlite";if(!preg_match("~^[^\\0]*\\.($Cc)\$~",$C)){$h->error=lang(21,str_replace("|",", ",$Cc));return
    43874398false;}return
    43884399true;}function
    4389 create_database($l,$d){global$h;if(file_exists($l)){$h->error=lang(22);return
    4390 false;}if(!check_sqlite_name($l))return
     4400create_database($m,$d){global$h;if(file_exists($m)){$h->error=lang(22);return
     4401false;}if(!check_sqlite_name($m))return
    43914402false;try{$_=new
    4392 Min_SQLite($l);}catch(Exception$vc){$h->error=$vc->getMessage();return
     4403Min_SQLite($m);}catch(Exception$uc){$h->error=$uc->getMessage();return
    43934404false;}$_->query('PRAGMA encoding = "UTF-8"');$_->query('CREATE TABLE adminer (i)');$_->query('DROP TABLE adminer');return
    43944405true;}function
    4395 drop_databases($k){global$h;$h->Min_SQLite(":memory:");foreach($k
    4396 as$l){if(!@unlink($l)){$h->error=lang(22);return
     4406drop_databases($l){global$h;$h->Min_SQLite(":memory:");foreach($l
     4407as$m){if(!@unlink($m)){$h->error=lang(22);return
    43974408false;}}return
    43984409true;}function
     
    44004411false;$h->Min_SQLite(":memory:");$h->error=lang(22);return@rename(DB,$C);}function
    44014412auto_increment(){return" PRIMARY KEY".(DRIVER=="sqlite"?" AUTOINCREMENT":"");}function
    4402 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){$Nh=($Q==""||$Nc);foreach($o
    4403 as$n){if($n[0]!=""||!$n[1]||$n[2]){$Nh=true;break;}}$c=array();$ff=array();foreach($o
    4404 as$n){if($n[1]){$c[]=($Nh?$n[1]:"ADD ".implode($n[1]));if($n[0]!="")$ff[$n[0]]=$n[1][0];}}if(!$Nh){foreach($c
     4413alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){$Nh=($Q==""||$Mc);foreach($p
     4414as$o){if($o[0]!=""||!$o[1]||$o[2]){$Nh=true;break;}}$c=array();$ff=array();foreach($p
     4415as$o){if($o[1]){$c[]=($Nh?$o[1]:"ADD ".implode($o[1]));if($o[0]!="")$ff[$o[0]]=$o[1][0];}}if(!$Nh){foreach($c
    44054416as$X){if(!queries("ALTER TABLE ".table($Q)." $X"))return
    44064417false;}if($Q!=$C&&!queries("ALTER TABLE ".table($Q)." RENAME TO ".table($C)))return
    4407 false;}elseif(!recreate_table($Q,$C,$c,$ff,$Nc))return
     4418false;}elseif(!recreate_table($Q,$C,$c,$ff,$Mc))return
    44084419false;if($La)queries("UPDATE sqlite_sequence SET seq = $La WHERE name = ".q($C));return
    44094420true;}function
    4410 recreate_table($Q,$C,$o,$ff,$Nc,$v=array()){if($Q!=""){if(!$o){foreach(fields($Q)as$x=>$n){$o[]=process_field($n,$n);$ff[$x]=idf_escape($x);}}$Df=false;foreach($o
    4411 as$n){if($n[6])$Df=true;}$bc=array();foreach($v
    4412 as$x=>$X){if($X[2]=="DROP"){$bc[$X[1]]=true;unset($v[$x]);}}foreach(indexes($Q)as$Jd=>$u){$f=array();foreach($u["columns"]as$x=>$e){if(!$ff[$e])continue
    4413 2;$f[]=$ff[$e].($u["descs"][$x]?" DESC":"");}if(!$bc[$Jd]){if($u["type"]!="PRIMARY"||!$Df)$v[]=array($u["type"],$Jd,$f);}}foreach($v
    4414 as$x=>$X){if($X[0]=="PRIMARY"){unset($v[$x]);$Nc[]="  PRIMARY KEY (".implode(", ",$X[2]).")";}}foreach(foreign_keys($Q)as$Jd=>$p){foreach($p["source"]as$x=>$e){if(!$ff[$e])continue
    4415 2;$p["source"][$x]=idf_unescape($ff[$e]);}if(!isset($Nc[" $Jd"]))$Nc[]=" ".format_foreign_key($p);}queries("BEGIN");}foreach($o
    4416 as$x=>$n)$o[$x]="  ".implode($n);$o=array_merge($o,array_filter($Nc));if(!queries("CREATE TABLE ".table($Q!=""?"adminer_$C":$C)." (\n".implode(",\n",$o)."\n)"))return
     4421recreate_table($Q,$C,$p,$ff,$Mc,$v=array()){if($Q!=""){if(!$p){foreach(fields($Q)as$x=>$o){$p[]=process_field($o,$o);$ff[$x]=idf_escape($x);}}$Df=false;foreach($p
     4422as$o){if($o[6])$Df=true;}$ac=array();foreach($v
     4423as$x=>$X){if($X[2]=="DROP"){$ac[$X[1]]=true;unset($v[$x]);}}foreach(indexes($Q)as$Jd=>$u){$f=array();foreach($u["columns"]as$x=>$e){if(!$ff[$e])continue
     44242;$f[]=$ff[$e].($u["descs"][$x]?" DESC":"");}if(!$ac[$Jd]){if($u["type"]!="PRIMARY"||!$Df)$v[]=array($u["type"],$Jd,$f);}}foreach($v
     4425as$x=>$X){if($X[0]=="PRIMARY"){unset($v[$x]);$Mc[]="  PRIMARY KEY (".implode(", ",$X[2]).")";}}foreach(foreign_keys($Q)as$Jd=>$q){foreach($q["source"]as$x=>$e){if(!$ff[$e])continue
     44262;$q["source"][$x]=idf_unescape($ff[$e]);}if(!isset($Mc[" $Jd"]))$Mc[]=" ".format_foreign_key($q);}queries("BEGIN");}foreach($p
     4427as$x=>$o)$p[$x]="  ".implode($o);$p=array_merge($p,array_filter($Mc));if(!queries("CREATE TABLE ".table($Q!=""?"adminer_$C":$C)." (\n".implode(",\n",$p)."\n)"))return
    44174428false;if($Q!=""){if($ff&&!queries("INSERT INTO ".table("adminer_$C")." (".implode(", ",$ff).") SELECT ".implode(", ",array_map('idf_escape',array_keys($ff)))." FROM ".table($Q)))return
    44184429false;$zh=array();foreach(triggers($Q)as$xh=>$kh){$wh=trigger($xh);$zh[]="CREATE TRIGGER ".idf_escape($xh)." ".implode(" ",$kh)." ON ".table($C)."\n$wh[Statement]";}if(!queries("DROP TABLE ".table($Q)))return
     
    44484459queries("BEGIN");}function
    44494460last_id(){global$h;return$h->result("SELECT LAST_INSERT_ROWID()");}function
    4450 explain($h,$H){return$h->query("EXPLAIN $H");}function
     4461explain($h,$H){return$h->query("EXPLAIN QUERY PLAN $H");}function
    44514462found_rows($R,$Z){}function
    44524463types(){return
     
    44594470create_sql($Q,$La){global$h;$J=$h->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = ".q($Q));foreach(indexes($Q)as$C=>$u){if($C=='')continue;$J.=";\n\n".index_sql($Q,$u['type'],$C,"(".implode(", ",array_map('idf_escape',$u['columns'])).")");}return$J;}function
    44604471truncate_sql($Q){return"DELETE FROM ".table($Q);}function
    4461 use_sql($Hb){}function
     4472use_sql($Gb){}function
    44624473trigger_sql($Q,$Mg){return
    44634474implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = ".q($Q)));}function
    44644475show_variables(){global$h;$J=array();foreach(array("auto_vacuum","cache_size","count_changes","default_cache_size","empty_result_callbacks","encoding","foreign_keys","full_column_names","fullfsync","journal_mode","journal_size_limit","legacy_file_format","locking_mode","page_size","max_page_count","read_uncommitted","recursive_triggers","reverse_unordered_selects","secure_delete","short_column_names","synchronous","temp_store","temp_store_directory","schema_version","integrity_check","quick_check")as$x)$J[$x]=$h->result("PRAGMA $x");return$J;}function
    44654476show_status(){$J=array();foreach(get_vals("PRAGMA compile_options")as$Ue){list($x,$X)=explode("=",$Ue,2);$J[$x]=$X;}return$J;}function
    4466 convert_field($n){}function
    4467 unconvert_field($n,$J){return$J;}function
    4468 support($Gc){return
    4469 preg_match('~^(columns|database|drop_col|dump|indexes|move_col|sql|status|table|trigger|variables|view|view_trigger)$~',$Gc);}$w="sqlite";$Bh=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$Lg=array_keys($Bh);$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$Vc=array("hex","length","lower","round","unixepoch","upper");$ad=array("avg","count","count distinct","group_concat","max","min","sum");$gc=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$Yb["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$_f=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
     4477convert_field($o){}function
     4478unconvert_field($o,$J){return$J;}function
     4479support($Fc){return
     4480preg_match('~^(columns|database|drop_col|dump|indexes|move_col|sql|status|table|trigger|variables|view|view_trigger)$~',$Fc);}$w="sqlite";$Bh=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$Lg=array_keys($Bh);$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$Uc=array("hex","length","lower","round","unixepoch","upper");$Zc=array("avg","count","count distinct","group_concat","max","min","sum");$fc=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$Xb["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$_f=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
    44704481Min_DB{var$extension="PgSQL",$_link,$_result,$_string,$_database=true,$server_info,$affected_rows,$error;function
    4471 _error($rc,$m){if(ini_bool("html_errors"))$m=html_entity_decode(strip_tags($m));$m=preg_replace('~^[^:]*: ~','',$m);$this->error=$m;}function
    4472 connect($N,$V,$G){global$b;$l=$b->database();set_error_handler(array($this,'_error'));$this->_string="host='".str_replace(":","' port='",addcslashes($N,"'\\"))."' user='".addcslashes($V,"'\\")."' password='".addcslashes($G,"'\\")."'";$this->_link=@pg_connect("$this->_string dbname='".($l!=""?addcslashes($l,"'\\"):"postgres")."'",PGSQL_CONNECT_FORCE_NEW);if(!$this->_link&&$l!=""){$this->_database=false;$this->_link=@pg_connect("$this->_string dbname='postgres'",PGSQL_CONNECT_FORCE_NEW);}restore_error_handler();if($this->_link){$Wh=pg_version($this->_link);$this->server_info=$Wh["server"];pg_set_client_encoding($this->_link,"UTF8");}return(bool)$this->_link;}function
     4482_error($qc,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
     4483connect($N,$V,$G){global$b;$m=$b->database();set_error_handler(array($this,'_error'));$this->_string="host='".str_replace(":","' port='",addcslashes($N,"'\\"))."' user='".addcslashes($V,"'\\")."' password='".addcslashes($G,"'\\")."'";$this->_link=@pg_connect("$this->_string dbname='".($m!=""?addcslashes($m,"'\\"):"postgres")."'",PGSQL_CONNECT_FORCE_NEW);if(!$this->_link&&$m!=""){$this->_database=false;$this->_link=@pg_connect("$this->_string dbname='postgres'",PGSQL_CONNECT_FORCE_NEW);}restore_error_handler();if($this->_link){$Wh=pg_version($this->_link);$this->server_info=$Wh["server"];pg_set_client_encoding($this->_link,"UTF8");}return(bool)$this->_link;}function
    44734484quote($P){return"'".pg_escape_string($this->_link,$P)."'";}function
    4474 select_db($Hb){global$b;if($Hb==$b->database())return$this->_database;$J=@pg_connect("$this->_string dbname='".addcslashes($Hb,"'\\")."'",PGSQL_CONNECT_FORCE_NEW);if($J)$this->_link=$J;return$J;}function
     4485select_db($Gb){global$b;if($Gb==$b->database())return$this->_database;$J=@pg_connect("$this->_string dbname='".addcslashes($Gb,"'\\")."'",PGSQL_CONNECT_FORCE_NEW);if($J)$this->_link=$J;return$J;}function
    44754486close(){$this->_link=@pg_connect("$this->_string dbname='postgres'");}function
    44764487query($H,$Ch=false){$I=@pg_query($this->_link,$H);$this->error="";if(!$I){$this->error=pg_last_error($this->_link);return
     
    44834494next_result(){return
    44844495false;}function
    4485 result($H,$n=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
     4496result($H,$o=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
    44864497false;return
    4487 pg_fetch_result($I->_result,0,$n);}}class
     4498pg_fetch_result($I->_result,0,$o);}}class
    44884499Min_Result{var$_result,$_offset=0,$num_rows;function
    44894500Min_Result($I){$this->_result=$I;$this->num_rows=pg_num_rows($I);}function
     
    44984509extends
    44994510Min_PDO{var$extension="PDO_PgSQL";function
    4500 connect($N,$V,$G){global$b;$l=$b->database();$P="pgsql:host='".str_replace(":","' port='",addcslashes($N,"'\\"))."' options='-c client_encoding=utf8'";$this->dsn("$P dbname='".($l!=""?addcslashes($l,"'\\"):"postgres")."'",$V,$G);return
     4511connect($N,$V,$G){global$b;$m=$b->database();$P="pgsql:host='".str_replace(":","' port='",addcslashes($N,"'\\"))."' options='-c client_encoding=utf8'";$this->dsn("$P dbname='".($m!=""?addcslashes($m,"'\\"):"postgres")."'",$V,$G);return
    45014512true;}function
    4502 select_db($Hb){global$b;return($b->database()==$Hb);}function
     4513select_db($Gb){global$b;return($b->database()==$Gb);}function
    45034514close(){}}}class
    45044515Min_Driver
     
    45144525idf_escape($t);}function
    45154526connect(){global$b;$h=new
    4516 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2])){if($h->server_info>=9)$h->query("SET application_name = 'Adminer'");return$h;}return$h->error;}function
     4527Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2])){if($h->server_info>=9)$h->query("SET application_name = 'Adminer'");return$h;}return$h->error;}function
    45174528get_databases(){return
    45184529get_vals("SELECT datname FROM pg_database ORDER BY datname");}function
    45194530limit($H,$Z,$z,$D=0,$vg=" "){return" $H$Z".($z!==null?$vg."LIMIT $z".($D?" OFFSET $D":""):"");}function
    45204531limit1($H,$Z){return" $H$Z";}function
    4521 db_collation($l,$nb){global$h;return$h->result("SHOW LC_COLLATE");}function
     4532db_collation($m,$nb){global$h;return$h->result("SHOW LC_COLLATE");}function
    45224533engines(){return
    45234534array();}function
     
    45304541ORDER BY 1";return
    45314542get_key_vals($H);}function
    4532 count_tables($k){return
     4543count_tables($l){return
    45334544array();}function
    45344545table_status($C=""){$J=array();foreach(get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' WHEN 'mv' THEN 'materialized view' WHEN 'f' THEN 'foreign table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
     
    45614572collations(){return
    45624573array();}function
    4563 information_schema($l){return($l=="information_schema");}function
     4574information_schema($m){return($m=="information_schema");}function
    45644575error(){global$h;$J=h($h->error);if(preg_match('~^(.*\\n)?([^\\n]*)\\n( *)\\^(\\n.*)?$~s',$J,$B))$J=$B[1].preg_replace('~((?:[^&]|&[^;]*;){'.strlen($B[3]).'})(.*)~','\\1<b>\\2</b>',$B[2]).$B[4];return
    45654576nl_br($J);}function
    4566 create_database($l,$d){return
    4567 queries("CREATE DATABASE ".idf_escape($l).($d?" ENCODING ".idf_escape($d):""));}function
    4568 drop_databases($k){global$h;$h->close();return
    4569 apply_queries("DROP DATABASE",$k,'idf_escape');}function
     4577create_database($m,$d){return
     4578queries("CREATE DATABASE ".idf_escape($m).($d?" ENCODING ".idf_escape($d):""));}function
     4579drop_databases($l){global$h;$h->close();return
     4580apply_queries("DROP DATABASE",$l,'idf_escape');}function
    45704581rename_database($C,$d){return
    45714582queries("ALTER DATABASE ".idf_escape(DB)." RENAME TO ".idf_escape($C));}function
    45724583auto_increment(){return"";}function
    4573 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){$c=array();$Mf=array();foreach($o
    4574 as$n){$e=idf_escape($n[0]);$X=$n[1];if(!$X)$c[]="DROP $e";else{$Sh=$X[5];unset($X[5]);if(isset($X[6])&&$n[0]=="")$X[1]=($X[1]=="bigint"?" big":" ")."serial";if($n[0]=="")$c[]=($Q!=""?"ADD ":"  ").implode($X);else{if($e!=$X[0])$Mf[]="ALTER TABLE ".table($Q)." RENAME $e TO $X[0]";$c[]="ALTER $e TYPE$X[1]";if(!$X[6]){$c[]="ALTER $e ".($X[3]?"SET$X[3]":"DROP DEFAULT");$c[]="ALTER $e ".($X[2]==" NULL"?"DROP NOT":"SET").$X[2];}}if($n[0]!=""||$Sh!="")$Mf[]="COMMENT ON COLUMN ".table($Q).".$X[0] IS ".($Sh!=""?substr($Sh,9):"''");}}$c=array_merge($c,$Nc);if($Q=="")array_unshift($Mf,"CREATE TABLE ".table($C)." (\n".implode(",\n",$c)."\n)");elseif($c)array_unshift($Mf,"ALTER TABLE ".table($Q)."\n".implode(",\n",$c));if($Q!=""&&$Q!=$C)$Mf[]="ALTER TABLE ".table($Q)." RENAME TO ".table($C);if($Q!=""||$rb!="")$Mf[]="COMMENT ON TABLE ".table($C)." IS ".q($rb);if($La!=""){}foreach($Mf
     4584alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){$c=array();$Mf=array();foreach($p
     4585as$o){$e=idf_escape($o[0]);$X=$o[1];if(!$X)$c[]="DROP $e";else{$Sh=$X[5];unset($X[5]);if(isset($X[6])&&$o[0]=="")$X[1]=($X[1]=="bigint"?" big":" ")."serial";if($o[0]=="")$c[]=($Q!=""?"ADD ":"  ").implode($X);else{if($e!=$X[0])$Mf[]="ALTER TABLE ".table($Q)." RENAME $e TO $X[0]";$c[]="ALTER $e TYPE$X[1]";if(!$X[6]){$c[]="ALTER $e ".($X[3]?"SET$X[3]":"DROP DEFAULT");$c[]="ALTER $e ".($X[2]==" NULL"?"DROP NOT":"SET").$X[2];}}if($o[0]!=""||$Sh!="")$Mf[]="COMMENT ON COLUMN ".table($Q).".$X[0] IS ".($Sh!=""?substr($Sh,9):"''");}}$c=array_merge($c,$Mc);if($Q=="")array_unshift($Mf,"CREATE TABLE ".table($C)." (\n".implode(",\n",$c)."\n)");elseif($c)array_unshift($Mf,"ALTER TABLE ".table($Q)."\n".implode(",\n",$c));if($Q!=""&&$Q!=$C)$Mf[]="ALTER TABLE ".table($Q)." RENAME TO ".table($C);if($Q!=""||$rb!="")$Mf[]="COMMENT ON TABLE ".table($C)." IS ".q($rb);if($La!=""){}foreach($Mf
    45754586as$H){if(!queries($H))return
    45764587false;}return
    45774588true;}function
    4578 alter_indexes($Q,$c){$Bb=array();$Zb=array();$Mf=array();foreach($c
    4579 as$X){if($X[0]!="INDEX")$Bb[]=($X[2]=="DROP"?"\nDROP CONSTRAINT ".idf_escape($X[1]):"\nADD".($X[1]!=""?" CONSTRAINT ".idf_escape($X[1]):"")." $X[0] ".($X[0]=="PRIMARY"?"KEY ":"")."(".implode(", ",$X[2]).")");elseif($X[2]=="DROP")$Zb[]=idf_escape($X[1]);else$Mf[]="CREATE INDEX ".idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q)." (".implode(", ",$X[2]).")";}if($Bb)array_unshift($Mf,"ALTER TABLE ".table($Q).implode(",",$Bb));if($Zb)array_unshift($Mf,"DROP INDEX ".implode(", ",$Zb));foreach($Mf
     4589alter_indexes($Q,$c){$j=array();$Yb=array();$Mf=array();foreach($c
     4590as$X){if($X[0]!="INDEX")$j[]=($X[2]=="DROP"?"\nDROP CONSTRAINT ".idf_escape($X[1]):"\nADD".($X[1]!=""?" CONSTRAINT ".idf_escape($X[1]):"")." $X[0] ".($X[0]=="PRIMARY"?"KEY ":"")."(".implode(", ",$X[2]).")");elseif($X[2]=="DROP")$Yb[]=idf_escape($X[1]);else$Mf[]="CREATE INDEX ".idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q)." (".implode(", ",$X[2]).")";}if($j)array_unshift($Mf,"ALTER TABLE ".table($Q).implode(",",$j));if($Yb)array_unshift($Mf,"DROP INDEX ".implode(", ",$Yb));foreach($Mf
    45804591as$H){if(!queries($H))return
    45814592false;}return
     
    46224633get_schema(){global$h;return$h->result("SELECT current_schema()");}function
    46234634set_schema($og){global$h,$Bh,$Lg;$J=$h->query("SET search_path TO ".idf_escape($og));foreach(types()as$U){if(!isset($Bh[$U])){$Bh[$U]=0;$Lg[lang(23)][]=$U;}}return$J;}function
    4624 use_sql($Hb){return"\connect ".idf_escape($Hb);}function
     4635use_sql($Gb){return"\connect ".idf_escape($Gb);}function
    46254636show_variables(){return
    46264637get_key_vals("SHOW ALL");}function
     
    46284639get_rows("SELECT * FROM pg_stat_activity ORDER BY ".($h->server_info<9.2?"procpid":"pid"));}function
    46294640show_status(){}function
    4630 convert_field($n){}function
    4631 unconvert_field($n,$J){return$J;}function
    4632 support($Gc){global$h;return
    4633 preg_match('~^(database|table|columns|sql|indexes|comment|view|'.($h->server_info>=9.3?'materializedview|':'').'scheme|processlist|sequence|trigger|type|variables|drop_col)$~',$Gc);}$w="pgsql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("smallint"=>5,"integer"=>10,"bigint"=>19,"boolean"=>1,"numeric"=>0,"real"=>7,"double precision"=>16,"money"=>20),lang(25)=>array("date"=>13,"time"=>17,"timestamp"=>20,"timestamptz"=>21,"interval"=>0),lang(26)=>array("character"=>0,"character varying"=>0,"text"=>0,"tsquery"=>0,"tsvector"=>0,"uuid"=>0,"xml"=>0),lang(27)=>array("bit"=>0,"bit varying"=>0,"bytea"=>0),lang(28)=>array("cidr"=>43,"inet"=>43,"macaddr"=>17,"txid_snapshot"=>0),lang(29)=>array("box"=>0,"circle"=>0,"line"=>0,"lseg"=>0,"path"=>0,"point"=>0,"polygon"=>0),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","ILIKE","ILIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$Vc=array("char_length","lower","round","to_hex","to_timestamp","upper");$ad=array("avg","count","count distinct","max","min","sum");$gc=array(array("char"=>"md5","date|time"=>"now",),array("int|numeric|real|money"=>"+/-","date|time"=>"+ interval/- interval","char|text"=>"||",));}$Yb["oracle"]="Oracle";if(isset($_GET["oracle"])){$_f=array("OCI8","PDO_OCI");define("DRIVER","oracle");if(extension_loaded("oci8")){class
     4641convert_field($o){}function
     4642unconvert_field($o,$J){return$J;}function
     4643support($Fc){global$h;return
     4644preg_match('~^(database|table|columns|sql|indexes|comment|view|'.($h->server_info>=9.3?'materializedview|':'').'scheme|processlist|sequence|trigger|type|variables|drop_col)$~',$Fc);}$w="pgsql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("smallint"=>5,"integer"=>10,"bigint"=>19,"boolean"=>1,"numeric"=>0,"real"=>7,"double precision"=>16,"money"=>20),lang(25)=>array("date"=>13,"time"=>17,"timestamp"=>20,"timestamptz"=>21,"interval"=>0),lang(26)=>array("character"=>0,"character varying"=>0,"text"=>0,"tsquery"=>0,"tsvector"=>0,"uuid"=>0,"xml"=>0),lang(27)=>array("bit"=>0,"bit varying"=>0,"bytea"=>0),lang(28)=>array("cidr"=>43,"inet"=>43,"macaddr"=>17,"txid_snapshot"=>0),lang(29)=>array("box"=>0,"circle"=>0,"line"=>0,"lseg"=>0,"path"=>0,"point"=>0,"polygon"=>0),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","ILIKE","ILIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$Uc=array("char_length","lower","round","to_hex","to_timestamp","upper");$Zc=array("avg","count","count distinct","max","min","sum");$fc=array(array("char"=>"md5","date|time"=>"now",),array("int|numeric|real|money"=>"+/-","date|time"=>"+ interval/- interval","char|text"=>"||",));}$Xb["oracle"]="Oracle";if(isset($_GET["oracle"])){$_f=array("OCI8","PDO_OCI");define("DRIVER","oracle");if(extension_loaded("oci8")){class
    46344645Min_DB{var$extension="oci8",$_link,$_result,$server_info,$affected_rows,$errno,$error;function
    4635 _error($rc,$m){if(ini_bool("html_errors"))$m=html_entity_decode(strip_tags($m));$m=preg_replace('~^[^:]*: ~','',$m);$this->error=$m;}function
     4646_error($qc,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
    46364647connect($N,$V,$G){$this->_link=@oci_new_connect($V,$G,$N,"AL32UTF8");if($this->_link){$this->server_info=oci_server_version($this->_link);return
    4637 true;}$m=oci_error();$this->error=$m["message"];return
     4648true;}$n=oci_error();$this->error=$n["message"];return
    46384649false;}function
    46394650quote($P){return"'".str_replace("'","''",$P)."'";}function
    4640 select_db($Hb){return
     4651select_db($Gb){return
    46414652true;}function
    4642 query($H,$Ch=false){$I=oci_parse($this->_link,$H);$this->error="";if(!$I){$m=oci_error($this->_link);$this->errno=$m["code"];$this->error=$m["message"];return
     4653query($H,$Ch=false){$I=oci_parse($this->_link,$H);$this->error="";if(!$I){$n=oci_error($this->_link);$this->errno=$n["code"];$this->error=$n["message"];return
    46434654false;}set_error_handler(array($this,'_error'));$J=@oci_execute($I);restore_error_handler();if($J){if(oci_num_fields($I))return
    46444655new
     
    46484659next_result(){return
    46494660false;}function
    4650 result($H,$n=1){$I=$this->query($H);if(!is_object($I)||!oci_fetch($I->_result))return
     4661result($H,$o=1){$I=$this->query($H);if(!is_object($I)||!oci_fetch($I->_result))return
    46514662false;return
    4652 oci_result($I->_result,$n);}}class
     4663oci_result($I->_result,$o);}}class
    46534664Min_Result{var$_result,$_offset=1,$num_rows;function
    46544665Min_Result($I){$this->_result=$I;}function
     
    46654676connect($N,$V,$G){$this->dsn("oci:dbname=//$N;charset=AL32UTF8",$V,$G);return
    46664677true;}function
    4667 select_db($Hb){return
     4678select_db($Gb){return
    46684679true;}}}class
    46694680Min_Driver
     
    46764687idf_escape($t);}function
    46774688connect(){global$b;$h=new
    4678 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2]))return$h;return$h->error;}function
     4689Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2]))return$h;return$h->error;}function
    46794690get_databases(){return
    46804691get_vals("SELECT tablespace_name FROM user_tablespaces");}function
    46814692limit($H,$Z,$z,$D=0,$vg=" "){return($D?" * FROM (SELECT t.*, rownum AS rnum FROM (SELECT $H$Z) t WHERE rownum <= ".($z+$D).") WHERE rnum > $D":($z!==null?" * FROM (SELECT $H$Z) WHERE rownum <= ".($z+$D):" $H$Z"));}function
    46824693limit1($H,$Z){return" $H$Z";}function
    4683 db_collation($l,$nb){global$h;return$h->result("SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'");}function
     4694db_collation($m,$nb){global$h;return$h->result("SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'");}function
    46844695engines(){return
    46854696array();}function
     
    46894700UNION SELECT view_name, 'view' FROM user_views
    46904701ORDER BY 1");}function
    4691 count_tables($k){return
     4702count_tables($l){return
    46924703array();}function
    46934704table_status($C=""){$J=array();$qg=q($C);foreach(get_rows('SELECT table_name "Name", \'table\' "Engine", avg_row_len * num_rows "Data_length", num_rows "Rows" FROM all_tables WHERE tablespace_name = '.q(DB).($C!=""?" AND table_name = $qg":"")."
     
    47074718collations(){return
    47084719array();}function
    4709 information_schema($l){return
     4720information_schema($m){return
    47104721false;}function
    47114722error(){global$h;return
     
    47134724explain($h,$H){$h->query("EXPLAIN PLAN FOR $H");return$h->query("SELECT * FROM plan_table");}function
    47144725found_rows($R,$Z){}function
    4715 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){$c=$Zb=array();foreach($o
    4716 as$n){$X=$n[1];if($X&&$n[0]!=""&&idf_escape($n[0])!=$X[0])queries("ALTER TABLE ".table($Q)." RENAME COLUMN ".idf_escape($n[0])." TO $X[0]");if($X)$c[]=($Q!=""?($n[0]!=""?"MODIFY (":"ADD ("):"  ").implode($X).($Q!=""?")":"");else$Zb[]=idf_escape($n[0]);}if($Q=="")return
    4717 queries("CREATE TABLE ".table($C)." (\n".implode(",\n",$c)."\n)");return(!$c||queries("ALTER TABLE ".table($Q)."\n".implode("\n",$c)))&&(!$Zb||queries("ALTER TABLE ".table($Q)." DROP (".implode(", ",$Zb).")"))&&($Q==$C||queries("ALTER TABLE ".table($Q)." RENAME TO ".table($C)));}function
     4726alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){$c=$Yb=array();foreach($p
     4727as$o){$X=$o[1];if($X&&$o[0]!=""&&idf_escape($o[0])!=$X[0])queries("ALTER TABLE ".table($Q)." RENAME COLUMN ".idf_escape($o[0])." TO $X[0]");if($X)$c[]=($Q!=""?($o[0]!=""?"MODIFY (":"ADD ("):"  ").implode($X).($Q!=""?")":"");else$Yb[]=idf_escape($o[0]);}if($Q=="")return
     4728queries("CREATE TABLE ".table($C)." (\n".implode(",\n",$c)."\n)");return(!$c||queries("ALTER TABLE ".table($Q)."\n".implode("\n",$c)))&&(!$Yb||queries("ALTER TABLE ".table($Q)." DROP (".implode(", ",$Yb).")"))&&($Q==$C||queries("ALTER TABLE ".table($Q)." RENAME TO ".table($C)));}function
    47184729foreign_keys($Q){$J=array();$H="SELECT c_list.CONSTRAINT_NAME as NAME,
    47194730c_src.COLUMN_NAME as SRC_COLUMN,
     
    47504761show_status(){$L=get_rows('SELECT * FROM v$instance');return
    47514762reset($L);}function
    4752 convert_field($n){}function
    4753 unconvert_field($n,$J){return$J;}function
    4754 support($Gc){return
    4755 preg_match('~^(columns|database|drop_col|indexes|processlist|scheme|sql|status|table|variables|view|view_trigger)$~',$Gc);}$w="oracle";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(25)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(26)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(27)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$Vc=array("length","lower","round","upper");$ad=array("avg","count","count distinct","max","min","sum");$gc=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$Yb["mssql"]="MS SQL";if(isset($_GET["mssql"])){$_f=array("SQLSRV","MSSQL");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
     4763convert_field($o){}function
     4764unconvert_field($o,$J){return$J;}function
     4765support($Fc){return
     4766preg_match('~^(columns|database|drop_col|indexes|processlist|scheme|sql|status|table|variables|view|view_trigger)$~',$Fc);}$w="oracle";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(25)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(26)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(27)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$Uc=array("length","lower","round","upper");$Zc=array("avg","count","count distinct","max","min","sum");$fc=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$Xb["mssql"]="MS SQL";if(isset($_GET["mssql"])){$_f=array("SQLSRV","MSSQL");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
    47564767Min_DB{var$extension="sqlsrv",$_link,$_result,$server_info,$affected_rows,$errno,$error;function
    4757 _get_error(){$this->error="";foreach(sqlsrv_errors()as$m){$this->errno=$m["code"];$this->error.="$m[message]\n";}$this->error=rtrim($this->error);}function
     4768_get_error(){$this->error="";foreach(sqlsrv_errors()as$n){$this->errno=$n["code"];$this->error.="$n[message]\n";}$this->error=rtrim($this->error);}function
    47584769connect($N,$V,$G){$this->_link=@sqlsrv_connect($N,array("UID"=>$V,"PWD"=>$G,"CharacterSet"=>"UTF-8"));if($this->_link){$sd=sqlsrv_server_info($this->_link);$this->server_info=$sd['SQLServerVersion'];}else$this->_get_error();return(bool)$this->_link;}function
    47594770quote($P){return"'".str_replace("'","''",$P)."'";}function
    4760 select_db($Hb){return$this->query("USE ".idf_escape($Hb));}function
     4771select_db($Gb){return$this->query("USE ".idf_escape($Gb));}function
    47614772query($H,$Ch=false){$I=sqlsrv_query($this->_link,$H);$this->error="";if(!$I){$this->_get_error();return
    47624773false;}return$this->store_result($I);}function
     
    47704781true;}function
    47714782next_result(){return$this->_result?sqlsrv_next_result($this->_result):null;}function
    4772 result($H,$n=0){$I=$this->query($H);if(!is_object($I))return
    4773 false;$K=$I->fetch_row();return$K[$n];}}class
     4783result($H,$o=0){$I=$this->query($H);if(!is_object($I))return
     4784false;$K=$I->fetch_row();return$K[$o];}}class
    47744785Min_Result{var$_result,$_offset=0,$_fields,$num_rows;function
    47754786Min_Result($I){$this->_result=$I;}function
     
    47784789fetch_assoc(){return$this->_convert(sqlsrv_fetch_array($this->_result,SQLSRV_FETCH_ASSOC,SQLSRV_SCROLL_NEXT));}function
    47794790fetch_row(){return$this->_convert(sqlsrv_fetch_array($this->_result,SQLSRV_FETCH_NUMERIC,SQLSRV_SCROLL_NEXT));}function
    4780 fetch_field(){if(!$this->_fields)$this->_fields=sqlsrv_field_metadata($this->_result);$n=$this->_fields[$this->_offset++];$J=new
    4781 stdClass;$J->name=$n["Name"];$J->orgname=$n["Name"];$J->type=($n["Type"]==1?254:0);return$J;}function
    4782 seek($D){for($r=0;$r<$D;$r++)sqlsrv_fetch($this->_result);}function
     4791fetch_field(){if(!$this->_fields)$this->_fields=sqlsrv_field_metadata($this->_result);$o=$this->_fields[$this->_offset++];$J=new
     4792stdClass;$J->name=$o["Name"];$J->orgname=$o["Name"];$J->type=($o["Type"]==1?254:0);return$J;}function
     4793seek($D){for($s=0;$s<$D;$s++)sqlsrv_fetch($this->_result);}function
    47834794__destruct(){sqlsrv_free_stmt($this->_result);}}}elseif(extension_loaded("mssql")){class
    47844795Min_DB{var$extension="MSSQL",$_link,$_result,$server_info,$affected_rows,$error;function
    47854796connect($N,$V,$G){$this->_link=@mssql_connect($N,$V,$G);if($this->_link){$I=$this->query("SELECT SERVERPROPERTY('ProductLevel'), SERVERPROPERTY('Edition')");$K=$I->fetch_row();$this->server_info=$this->result("sp_server_info 2",2)." [$K[0]] $K[1]";}else$this->error=mssql_get_last_message();return(bool)$this->_link;}function
    47864797quote($P){return"'".str_replace("'","''",$P)."'";}function
    4787 select_db($Hb){return
    4788 mssql_select_db($Hb);}function
     4798select_db($Gb){return
     4799mssql_select_db($Gb);}function
    47894800query($H,$Ch=false){$I=mssql_query($H,$this->_link);$this->error="";if(!$I){$this->error=mssql_get_last_message();return
    47904801false;}if($I===true){$this->affected_rows=mssql_rows_affected($this->_link);return
     
    47964807next_result(){return
    47974808mssql_next_result($this->_result);}function
    4798 result($H,$n=0){$I=$this->query($H);if(!is_object($I))return
     4809result($H,$o=0){$I=$this->query($H);if(!is_object($I))return
    47994810false;return
    4800 mssql_result($I->_result,0,$n);}}class
     4811mssql_result($I->_result,0,$o);}}class
    48014812Min_Result{var$_result,$_offset=0,$_fields,$num_rows;function
    48024813Min_Result($I){$this->_result=$I;$this->num_rows=mssql_num_rows($I);}function
     
    48234834table($t){return($_GET["ns"]!=""?idf_escape($_GET["ns"]).".":"").idf_escape($t);}function
    48244835connect(){global$b;$h=new
    4825 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2]))return$h;return$h->error;}function
     4836Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2]))return$h;return$h->error;}function
    48264837get_databases(){return
    48274838get_vals("EXEC sp_databases");}function
     
    48294840limit1($H,$Z){return
    48304841limit($H,$Z,1);}function
    4831 db_collation($l,$nb){global$h;return$h->result("SELECT collation_name FROM sys.databases WHERE name =  ".q($l));}function
     4842db_collation($m,$nb){global$h;return$h->result("SELECT collation_name FROM sys.databases WHERE name =  ".q($m));}function
    48324843engines(){return
    48334844array();}function
     
    48354846tables_list(){return
    48364847get_key_vals("SELECT name, type_desc FROM sys.all_objects WHERE schema_id = SCHEMA_ID(".q(get_schema()).") AND type IN ('S', 'U', 'V') ORDER BY name");}function
    4837 count_tables($k){global$h;$J=array();foreach($k
    4838 as$l){$h->select_db($l);$J[$l]=$h->result("SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES");}return$J;}function
     4848count_tables($l){global$h;$J=array();foreach($l
     4849as$m){$h->select_db($m);$J[$m]=$h->result("SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES");}return$J;}function
    48394850table_status($C=""){$J=array();foreach(get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(".q(get_schema()).") AND type IN ('S', 'U', 'V') ".($C!=""?"AND name = ".q($C):"ORDER BY name"))as$K){if($C!="")return$K;$J[$K["Name"]]=$K;}return$J;}function
    48404851is_view($R){return$R["Engine"]=="VIEW";}function
     
    48554866array("select"=>preg_replace('~^(?:[^[]|\\[[^]]*])*\\s+AS\\s+~isU','',$h->result("SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = SCHEMA_NAME() AND TABLE_NAME = ".q($C))));}function
    48564867collations(){$J=array();foreach(get_vals("SELECT name FROM fn_helpcollations()")as$d)$J[preg_replace('~_.*~','',$d)][]=$d;return$J;}function
    4857 information_schema($l){return
     4868information_schema($m){return
    48584869false;}function
    48594870error(){global$h;return
    48604871nl_br(h(preg_replace('~^(\\[[^]]*])+~m','',$h->error)));}function
    4861 create_database($l,$d){return
    4862 queries("CREATE DATABASE ".idf_escape($l).(preg_match('~^[a-z0-9_]+$~i',$d)?" COLLATE $d":""));}function
    4863 drop_databases($k){return
    4864 queries("DROP DATABASE ".implode(", ",array_map('idf_escape',$k)));}function
     4872create_database($m,$d){return
     4873queries("CREATE DATABASE ".idf_escape($m).(preg_match('~^[a-z0-9_]+$~i',$d)?" COLLATE $d":""));}function
     4874drop_databases($l){return
     4875queries("DROP DATABASE ".implode(", ",array_map('idf_escape',$l)));}function
    48654876rename_database($C,$d){if(preg_match('~^[a-z0-9_]+$~i',$d))queries("ALTER DATABASE ".idf_escape(DB)." COLLATE $d");queries("ALTER DATABASE ".idf_escape(DB)." MODIFY NAME = ".idf_escape($C));return
    48664877true;}function
    48674878auto_increment(){return" IDENTITY".($_POST["Auto_increment"]!=""?"(".number($_POST["Auto_increment"]).",1)":"")." PRIMARY KEY";}function
    4868 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){$c=array();foreach($o
    4869 as$n){$e=idf_escape($n[0]);$X=$n[1];if(!$X)$c["DROP"][]=" COLUMN $e";else{$X[1]=preg_replace("~( COLLATE )'(\\w+)'~","\\1\\2",$X[1]);if($n[0]=="")$c["ADD"][]="\n  ".implode("",$X).($Q==""?substr($Nc[$X[0]],16+strlen($X[0])):"");else{unset($X[6]);if($e!=$X[0])queries("EXEC sp_rename ".q(table($Q).".$e").", ".q(idf_unescape($X[0])).", 'COLUMN'");$c["ALTER COLUMN ".implode("",$X)][]="";}}}if($Q=="")return
    4870 queries("CREATE TABLE ".table($C)." (".implode(",",(array)$c["ADD"])."\n)");if($Q!=$C)queries("EXEC sp_rename ".q(table($Q)).", ".q($C));if($Nc)$c[""]=$Nc;foreach($c
     4879alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){$c=array();foreach($p
     4880as$o){$e=idf_escape($o[0]);$X=$o[1];if(!$X)$c["DROP"][]=" COLUMN $e";else{$X[1]=preg_replace("~( COLLATE )'(\\w+)'~","\\1\\2",$X[1]);if($o[0]=="")$c["ADD"][]="\n  ".implode("",$X).($Q==""?substr($Mc[$X[0]],16+strlen($X[0])):"");else{unset($X[6]);if($e!=$X[0])queries("EXEC sp_rename ".q(table($Q).".$e").", ".q(idf_unescape($X[0])).", 'COLUMN'");$c["ALTER COLUMN ".implode("",$X)][]="";}}}if($Q=="")return
     4881queries("CREATE TABLE ".table($C)." (".implode(",",(array)$c["ADD"])."\n)");if($Q!=$C)queries("EXEC sp_rename ".q(table($Q)).", ".q($C));if($Mc)$c[""]=$Mc;foreach($c
    48714882as$x=>$X){if(!queries("ALTER TABLE ".idf_escape($C)." $x".implode(",",$X)))return
    48724883false;}return
    48734884true;}function
    4874 alter_indexes($Q,$c){$u=array();$Zb=array();foreach($c
    4875 as$X){if($X[2]=="DROP"){if($X[0]=="PRIMARY")$Zb[]=idf_escape($X[1]);else$u[]=idf_escape($X[1])." ON ".table($Q);}elseif(!queries(($X[0]!="PRIMARY"?"CREATE $X[0] ".($X[0]!="INDEX"?"INDEX ":"").idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q):"ALTER TABLE ".table($Q)." ADD PRIMARY KEY")." (".implode(", ",$X[2]).")"))return
    4876 false;}return(!$u||queries("DROP INDEX ".implode(", ",$u)))&&(!$Zb||queries("ALTER TABLE ".table($Q)." DROP ".implode(", ",$Zb)));}function
     4885alter_indexes($Q,$c){$u=array();$Yb=array();foreach($c
     4886as$X){if($X[2]=="DROP"){if($X[0]=="PRIMARY")$Yb[]=idf_escape($X[1]);else$u[]=idf_escape($X[1])." ON ".table($Q);}elseif(!queries(($X[0]!="PRIMARY"?"CREATE $X[0] ".($X[0]!="INDEX"?"INDEX ":"").idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q):"ALTER TABLE ".table($Q)." ADD PRIMARY KEY")." (".implode(", ",$X[2]).")"))return
     4887false;}return(!$u||queries("DROP INDEX ".implode(", ",$u)))&&(!$Yb||queries("ALTER TABLE ".table($Q)." DROP ".implode(", ",$Yb)));}function
    48774888last_id(){global$h;return$h->result("SELECT SCOPE_IDENTITY()");}function
    48784889explain($h,$H){$h->query("SET SHOWPLAN_ALL ON");$J=$h->query($H);$h->query("SET SHOWPLAN_ALL OFF");return$J;}function
    48794890found_rows($R,$Z){}function
    4880 foreign_keys($Q){$J=array();foreach(get_rows("EXEC sp_fkeys @fktable_name = ".q($Q))as$K){$p=&$J[$K["FK_NAME"]];$p["table"]=$K["PKTABLE_NAME"];$p["source"][]=$K["FKCOLUMN_NAME"];$p["target"][]=$K["PKCOLUMN_NAME"];}return$J;}function
     4891foreign_keys($Q){$J=array();foreach(get_rows("EXEC sp_fkeys @fktable_name = ".q($Q))as$K){$q=&$J[$K["FK_NAME"]];$q["table"]=$K["PKTABLE_NAME"];$q["source"][]=$K["FKCOLUMN_NAME"];$q["target"][]=$K["PKCOLUMN_NAME"];}return$J;}function
    48814892truncate_tables($S){return
    48824893apply_queries("TRUNCATE TABLE",$S);}function
     
    49084919set_schema($og){return
    49094920true;}function
    4910 use_sql($Hb){return"USE ".idf_escape($Hb);}function
     4921use_sql($Gb){return"USE ".idf_escape($Gb);}function
    49114922show_variables(){return
    49124923array();}function
    49134924show_status(){return
    49144925array();}function
    4915 convert_field($n){}function
    4916 unconvert_field($n,$J){return$J;}function
    4917 support($Gc){return
    4918 preg_match('~^(columns|database|drop_col|indexes|scheme|sql|table|trigger|view|view_trigger)$~',$Gc);}$w="mssql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(25)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(26)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(27)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$Vc=array("len","lower","round","upper");$ad=array("avg","count","count distinct","max","min","sum");$gc=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$Yb['firebird']='Firebird (alpha)';if(isset($_GET["firebird"])){$_f=array("interbase");define("DRIVER","firebird");if(extension_loaded("interbase")){class
     4926convert_field($o){}function
     4927unconvert_field($o,$J){return$J;}function
     4928support($Fc){return
     4929preg_match('~^(columns|database|drop_col|indexes|scheme|sql|table|trigger|view|view_trigger)$~',$Fc);}$w="mssql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(25)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(26)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(27)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array();$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$Uc=array("len","lower","round","upper");$Zc=array("avg","count","count distinct","max","min","sum");$fc=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$Xb['firebird']='Firebird (alpha)';if(isset($_GET["firebird"])){$_f=array("interbase");define("DRIVER","firebird");if(extension_loaded("interbase")){class
    49194930Min_DB{var$extension="Firebird",$server_info,$affected_rows,$errno,$error,$_link,$_result;function
    49204931connect($N,$V,$G){$this->_link=ibase_connect($N,$V,$G);if($this->_link){$Lh=explode(':',$N);$this->service_link=ibase_service_attach($Lh[0],$V,$G);$this->server_info=ibase_server_info($this->service_link,IBASE_SVC_SERVER_VERSION);}else{$this->errno=ibase_errcode();$this->error=ibase_errmsg();}return(bool)$this->_link;}function
    49214932quote($P){return"'".str_replace("'","''",$P)."'";}function
    4922 select_db($Hb){return($Hb=="domain");}function
     4933select_db($Gb){return($Gb=="domain");}function
    49234934query($H,$Ch=false){$I=ibase_query($H,$this->_link);if(!$I){$this->errno=ibase_errcode();$this->error=ibase_errmsg();return
    49244935false;}$this->error="";if($I===true){$this->affected_rows=ibase_affected_rows($this->_link);return
     
    49304941next_result(){return
    49314942false;}function
    4932 result($H,$n=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
    4933 false;$K=$I->fetch_row();return$K[$n];}}class
     4943result($H,$o=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
     4944false;$K=$I->fetch_row();return$K[$o];}}class
    49344945Min_Result{var$num_rows,$_result,$_offset=0;function
    49354946Min_Result($I){$this->_result=$I;}function
     
    49384949fetch_row(){return
    49394950ibase_fetch_row($this->_result);}function
    4940 fetch_field(){$n=ibase_field_info($this->_result,$this->_offset++);return(object)array('name'=>$n['name'],'orgname'=>$n['name'],'type'=>$n['type'],'charsetnr'=>$n['length'],);}function
     4951fetch_field(){$o=ibase_field_info($this->_result,$this->_offset++);return(object)array('name'=>$o['name'],'orgname'=>$o['name'],'type'=>$o['type'],'charsetnr'=>$o['length'],);}function
    49414952__destruct(){ibase_free_result($this->_result);}}}class
    49424953Min_Driver
     
    49474958idf_escape($t);}function
    49484959connect(){global$b;$h=new
    4949 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2]))return$h;return$h->error;}function
    4950 get_databases($Mc){return
     4960Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2]))return$h;return$h->error;}function
     4961get_databases($Lc){return
    49514962array("domain");}function
    49524963limit($H,$Z,$z,$D=0,$vg=" "){$J='';$J.=($z!==null?$vg."FIRST $z".($D?" SKIP $D":""):"");$J.=" $H$Z";return$J;}function
    49534964limit1($H,$Z){return
    49544965limit($H,$Z,1);}function
    4955 db_collation($l,$nb){}function
     4966db_collation($m,$nb){}function
    49564967engines(){return
    49574968array();}function
    4958 logged_user(){global$b;$j=$b->credentials();return$j[1];}function
     4969logged_user(){global$b;$k=$b->credentials();return$k[1];}function
    49594970tables_list(){global$h;$H='SELECT RDB$RELATION_NAME FROM rdb$relations WHERE rdb$system_flag = 0';$I=ibase_query($h->_link,$H);$J=array();while($K=ibase_fetch_assoc($I))$J[$K['RDB$RELATION_NAME']]='table';ksort($J);return$J;}function
    4960 count_tables($k){return
     4971count_tables($l){return
    49614972array();}function
    4962 table_status($C="",$Fc=false){global$h;$J=array();$Fb=tables_list();foreach($Fb
     4973table_status($C="",$Ec=false){global$h;$J=array();$Eb=tables_list();foreach($Eb
    49634974as$u=>$X){$u=trim($u);$J[$u]=array('Name'=>$u,'Engine'=>'standard',);if($C==$u)return$J[$u];}return$J;}function
    49644975is_view($R){return
     
    50045015collations(){return
    50055016array();}function
    5006 information_schema($l){return
     5017information_schema($m){return
    50075018false;}function
    50085019error(){global$h;return
     
    50155026set_schema($og){return
    50165027true;}function
    5017 support($Gc){return
    5018 preg_match("~^(columns|sql|status|table)$~",$Gc);}$w="firebird";$Se=array("=");$Vc=array();$ad=array();$gc=array();}$Yb["simpledb"]="SimpleDB";if(isset($_GET["simpledb"])){$_f=array("SimpleXML");define("DRIVER","simpledb");if(class_exists('SimpleXMLElement')){class
     5028support($Fc){return
     5029preg_match("~^(columns|sql|status|table)$~",$Fc);}$w="firebird";$Se=array("=");$Uc=array();$Zc=array();$fc=array();}$Xb["simpledb"]="SimpleDB";if(isset($_GET["simpledb"])){$_f=array("SimpleXML");define("DRIVER","simpledb");if(class_exists('SimpleXMLElement')){class
    50195030Min_DB{var$extension="SimpleXML",$server_info='2009-04-15',$error,$timeout,$next,$affected_rows,$_result;function
    5020 select_db($Hb){return($Hb=="domain");}function
     5031select_db($Gb){return($Gb=="domain");}function
    50215032query($H,$Ch=false){$F=array('SelectExpression'=>$H,'ConsistentRead'=>'true');if($this->next)$F['NextToken']=$this->next;$I=sdb_request_all('Select','Item',$F,$this->timeout);if($I===false)return$I;if(preg_match('~^\s*SELECT\s+COUNT\(~i',$H)){$Pg=0;foreach($I
    50225033as$Ed)$Pg+=$Ed->Attribute->Value;$I=array((object)array('Attribute'=>array((object)array('Name'=>'Count','Value'=>$Pg,))));}return
     
    50335044as$Ia){$C=$this->_processValue($Ia->Name);$Y=$this->_processValue($Ia->Value);if(isset($K[$C])){$K[$C]=(array)$K[$C];$K[$C][]=$Y;}else$K[$C]=$Y;}$this->_rows[]=$K;foreach($K
    50345045as$x=>$X){if(!isset($this->_rows[0][$x]))$this->_rows[0][$x]=null;}}$this->num_rows=count($this->_rows);}function
    5035 _processValue($jc){return(is_object($jc)&&$jc['encoding']=='base64'?base64_decode($jc):(string)$jc);}function
     5046_processValue($ic){return(is_object($ic)&&$ic['encoding']=='base64'?base64_decode($ic):(string)$ic);}function
    50365047fetch_assoc(){$K=current($this->_rows);if(!$K)return$K;$J=array();foreach($this->_rows[0]as$x=>$X)$J[$x]=$K[$x];next($this->_rows);return$J;}function
    50375048fetch_row(){$J=$this->fetch_assoc();if(!$J)return$J;return
     
    50415052extends
    50425053Min_SQL{public$Cf="itemName()";function
    5043 _chunkRequest($ld,$va,$F,$zc=array()){global$h;foreach(array_chunk($ld,25)as$gb){$kf=$F;foreach($gb
    5044 as$r=>$s){$kf["Item.$r.ItemName"]=$s;foreach($zc
    5045 as$x=>$X)$kf["Item.$r.$x"]=$X;}if(!sdb_request($va,$kf))return
     5054_chunkRequest($ld,$va,$F,$yc=array()){global$h;foreach(array_chunk($ld,25)as$gb){$kf=$F;foreach($gb
     5055as$s=>$jd){$kf["Item.$s.ItemName"]=$jd;foreach($yc
     5056as$x=>$X)$kf["Item.$s.$x"]=$X;}if(!sdb_request($va,$kf))return
    50465057false;}$h->affected_rows=count($ld);return
    50475058true;}function
    50485059_extractIds($Q,$Nf,$z){$J=array();if(preg_match_all("~itemName\(\) = (('[^']*+')+)~",$Nf,$ee))$J=array_map('idf_unescape',$ee[1]);else{foreach(sdb_request_all('Select','Item',array('SelectExpression'=>'SELECT itemName() FROM '.table($Q).$Nf.($z?" LIMIT 1":"")))as$Ed)$J[]=$Ed->Name;}return$J;}function
    5049 select($Q,$M,$Z,$Yc,$Xe=array(),$z=1,$E=0,$Ef=false){global$h;$h->next=$_GET["next"];$J=parent::select($Q,$M,$Z,$Yc,$Xe,$z,$E,$Ef);$h->next=0;return$J;}function
     5060select($Q,$M,$Z,$Xc,$Xe=array(),$z=1,$E=0,$Ef=false){global$h;$h->next=$_GET["next"];$J=parent::select($Q,$M,$Z,$Xc,$Xe,$z,$E,$Ef);$h->next=0;return$J;}function
    50505061delete($Q,$Nf,$z=0){return$this->_chunkRequest($this->_extractIds($Q,$Nf,$z),'BatchDeleteAttributes',array('DomainName'=>$Q));}function
    5051 update($Q,$O,$Nf,$z=0,$vg="\n"){$Nb=array();$wd=array();$r=0;$ld=$this->_extractIds($Q,$Nf,$z);$s=idf_unescape($O["`itemName()`"]);unset($O["`itemName()`"]);foreach($O
    5052 as$x=>$X){$x=idf_unescape($x);if($X=="NULL"||($s!=""&&array($s)!=$ld))$Nb["Attribute.".count($Nb).".Name"]=$x;if($X!="NULL"){foreach((array)$X
    5053 as$Gd=>$W){$wd["Attribute.$r.Name"]=$x;$wd["Attribute.$r.Value"]=(is_array($X)?$W:idf_unescape($W));if(!$Gd)$wd["Attribute.$r.Replace"]="true";$r++;}}}$F=array('DomainName'=>$Q);return(!$wd||$this->_chunkRequest(($s!=""?array($s):$ld),'BatchPutAttributes',$F,$wd))&&(!$Nb||$this->_chunkRequest($ld,'BatchDeleteAttributes',$F,$Nb));}function
    5054 insert($Q,$O){$F=array("DomainName"=>$Q);$r=0;foreach($O
     5062update($Q,$O,$Nf,$z=0,$vg="\n"){$Mb=array();$wd=array();$s=0;$ld=$this->_extractIds($Q,$Nf,$z);$jd=idf_unescape($O["`itemName()`"]);unset($O["`itemName()`"]);foreach($O
     5063as$x=>$X){$x=idf_unescape($x);if($X=="NULL"||($jd!=""&&array($jd)!=$ld))$Mb["Attribute.".count($Mb).".Name"]=$x;if($X!="NULL"){foreach((array)$X
     5064as$Gd=>$W){$wd["Attribute.$s.Name"]=$x;$wd["Attribute.$s.Value"]=(is_array($X)?$W:idf_unescape($W));if(!$Gd)$wd["Attribute.$s.Replace"]="true";$s++;}}}$F=array('DomainName'=>$Q);return(!$wd||$this->_chunkRequest(($jd!=""?array($jd):$ld),'BatchPutAttributes',$F,$wd))&&(!$Mb||$this->_chunkRequest($ld,'BatchDeleteAttributes',$F,$Mb));}function
     5065insert($Q,$O){$F=array("DomainName"=>$Q);$s=0;foreach($O
    50555066as$C=>$Y){if($Y!="NULL"){$C=idf_unescape($C);if($C=="itemName()")$F["ItemName"]=idf_unescape($Y);else{foreach((array)$Y
    5056 as$X){$F["Attribute.$r.Name"]=$C;$F["Attribute.$r.Value"]=(is_array($Y)?$X:idf_unescape($Y));$r++;}}}}return
     5067as$X){$F["Attribute.$s.Name"]=$C;$F["Attribute.$s.Value"]=(is_array($Y)?$X:idf_unescape($Y));$s++;}}}}return
    50575068sdb_request('PutAttributes',$F);}function
    50585069insertUpdate($Q,$L,$Cf){foreach($L
     
    50695080new
    50705081Min_DB;}function
    5071 support($Gc){return
    5072 preg_match('~sql~',$Gc);}function
    5073 logged_user(){global$b;$j=$b->credentials();return$j[1];}function
     5082support($Fc){return
     5083preg_match('~sql~',$Fc);}function
     5084logged_user(){global$b;$k=$b->credentials();return$k[1];}function
    50745085get_databases(){return
    50755086array("domain");}function
    50765087collations(){return
    50775088array();}function
    5078 db_collation($l,$nb){}function
     5089db_collation($m,$nb){}function
    50795090tables_list(){global$h;$J=array();foreach(sdb_request_all('ListDomains','DomainName')as$Q)$J[(string)$Q]='table';if($h->error&&defined("PAGE_HEADER"))echo"<p class='error'>".error()."\n";return$J;}function
    5080 table_status($C="",$Fc=false){$J=array();foreach(($C!=""?array($C=>true):tables_list())as$Q=>$U){$K=array("Name"=>$Q,"Auto_increment"=>"");if(!$Fc){$re=sdb_request('DomainMetadata',array('DomainName'=>$Q));if($re){foreach(array("Rows"=>"ItemCount","Data_length"=>"ItemNamesSizeBytes","Index_length"=>"AttributeValuesSizeBytes","Data_free"=>"AttributeNamesSizeBytes",)as$x=>$X)$K[$x]=(string)$re->$X;}}if($C!="")return$K;$J[$Q]=$K;}return$J;}function
     5091table_status($C="",$Ec=false){$J=array();foreach(($C!=""?array($C=>true):tables_list())as$Q=>$U){$K=array("Name"=>$Q,"Auto_increment"=>"");if(!$Ec){$re=sdb_request('DomainMetadata',array('DomainName'=>$Q));if($re){foreach(array("Rows"=>"ItemCount","Data_length"=>"ItemNamesSizeBytes","Index_length"=>"AttributeValuesSizeBytes","Data_free"=>"AttributeNamesSizeBytes",)as$x=>$X)$K[$x]=(string)$re->$X;}}if($C!="")return$K;$J[$Q]=$K;}return$J;}function
    50815092explain($h,$H){}function
    50825093error(){global$h;return
     
    50945105idf_escape($t){return"`".str_replace("`","``",$t)."`";}function
    50955106limit($H,$Z,$z,$D=0,$vg=" "){return" $H$Z".($z!==null?$vg."LIMIT $z":"");}function
    5096 unconvert_field($n,$J){return$J;}function
     5107unconvert_field($o,$J){return$J;}function
    50975108fk_support($R){}function
    50985109engines(){return
    50995110array();}function
    5100 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){return($Q==""&&sdb_request('CreateDomain',array('DomainName'=>$C)));}function
     5111alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){return($Q==""&&sdb_request('CreateDomain',array('DomainName'=>$C)));}function
    51015112drop_tables($S){foreach($S
    51025113as$Q){if(!sdb_request('DeleteDomain',array('DomainName'=>$Q)))return
    51035114false;}return
    51045115true;}function
    5105 count_tables($k){foreach($k
    5106 as$l)return
    5107 array($l=>count(tables_list()));}function
     5116count_tables($l){foreach($l
     5117as$m)return
     5118array($m=>count(tables_list()));}function
    51085119found_rows($R,$Z){return($Z?null:$R["Rows"]);}function
    51095120last_id(){}function
    5110 hmac($Ba,$Fb,$x,$Rf=false){$Ua=64;if(strlen($x)>$Ua)$x=pack("H*",$Ba($x));$x=str_pad($x,$Ua,"\0");$Hd=$x^str_repeat("\x36",$Ua);$Id=$x^str_repeat("\x5C",$Ua);$J=$Ba($Id.pack("H*",$Ba($Hd.$Fb)));if($Rf)$J=pack("H*",$J);return$J;}function
    5111 sdb_request($va,$F=array()){global$b,$h;list($id,$F['AWSAccessKeyId'],$rg)=$b->credentials();$F['Action']=$va;$F['Timestamp']=gmdate('Y-m-d\TH:i:s+00:00');$F['Version']='2009-04-15';$F['SignatureVersion']=2;$F['SignatureMethod']='HmacSHA1';ksort($F);$H='';foreach($F
    5112 as$x=>$X)$H.='&'.rawurlencode($x).'='.rawurlencode($X);$H=str_replace('%7E','~',substr($H,1));$H.="&Signature=".urlencode(base64_encode(hmac('sha1',"POST\n".preg_replace('~^https?://~','',$id)."\n/\n$H",$rg,true)));@ini_set('track_errors',1);$Ic=@file_get_contents((preg_match('~^https?://~',$id)?$id:"http://$id"),false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$H,'ignore_errors'=>1,))));if(!$Ic){$h->error=$php_errormsg;return
    5113 false;}libxml_use_internal_errors(true);$ei=simplexml_load_string($Ic);if(!$ei){$m=libxml_get_last_error();$h->error=$m->message;return
    5114 false;}if($ei->Errors){$m=$ei->Errors->Error;$h->error="$m->Message ($m->Code)";return
     5121hmac($Ba,$Eb,$x,$Rf=false){$Ua=64;if(strlen($x)>$Ua)$x=pack("H*",$Ba($x));$x=str_pad($x,$Ua,"\0");$Hd=$x^str_repeat("\x36",$Ua);$Id=$x^str_repeat("\x5C",$Ua);$J=$Ba($Id.pack("H*",$Ba($Hd.$Eb)));if($Rf)$J=pack("H*",$J);return$J;}function
     5122sdb_request($va,$F=array()){global$b,$h;list($hd,$F['AWSAccessKeyId'],$rg)=$b->credentials();$F['Action']=$va;$F['Timestamp']=gmdate('Y-m-d\TH:i:s+00:00');$F['Version']='2009-04-15';$F['SignatureVersion']=2;$F['SignatureMethod']='HmacSHA1';ksort($F);$H='';foreach($F
     5123as$x=>$X)$H.='&'.rawurlencode($x).'='.rawurlencode($X);$H=str_replace('%7E','~',substr($H,1));$H.="&Signature=".urlencode(base64_encode(hmac('sha1',"POST\n".preg_replace('~^https?://~','',$hd)."\n/\n$H",$rg,true)));@ini_set('track_errors',1);$Hc=@file_get_contents((preg_match('~^https?://~',$hd)?$hd:"http://$hd"),false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$H,'ignore_errors'=>1,))));if(!$Hc){$h->error=$php_errormsg;return
     5124false;}libxml_use_internal_errors(true);$ei=simplexml_load_string($Hc);if(!$ei){$n=libxml_get_last_error();$h->error=$n->message;return
     5125false;}if($ei->Errors){$n=$ei->Errors->Error;$h->error="$n->Message ($n->Code)";return
    51155126false;}$h->error='';$ah=$va."Result";return($ei->$ah?$ei->$ah:true);}function
    51165127sdb_request_all($va,$ah,$F=array(),$jh=0){$J=array();$Hg=($jh?microtime(true):0);$z=(preg_match('~LIMIT\s+(\d+)\s*$~i',$F['SelectExpression'],$B)?$B[1]:0);do{$ei=sdb_request($va,$F);if(!$ei)break;foreach($ei->$ah
    5117 as$jc)$J[]=$jc;if($z&&count($J)>=$z){$_GET["next"]=$ei->NextToken;break;}if($jh&&microtime(true)-$Hg>$jh)return
    5118 false;$F['NextToken']=$ei->NextToken;if($z)$F['SelectExpression']=preg_replace('~\d+\s*$~',$z-count($J),$F['SelectExpression']);}while($ei->NextToken);return$J;}$w="simpledb";$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","IS NOT NULL");$Vc=array();$ad=array("count");$gc=array(array("json"));}$Yb["mongo"]="MongoDB (beta)";if(isset($_GET["mongo"])){$_f=array("mongo");define("DRIVER","mongo");if(class_exists('MongoDB')){class
     5128as$ic)$J[]=$ic;if($z&&count($J)>=$z){$_GET["next"]=$ei->NextToken;break;}if($jh&&microtime(true)-$Hg>$jh)return
     5129false;$F['NextToken']=$ei->NextToken;if($z)$F['SelectExpression']=preg_replace('~\d+\s*$~',$z-count($J),$F['SelectExpression']);}while($ei->NextToken);return$J;}$w="simpledb";$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","IS NOT NULL");$Uc=array();$Zc=array("count");$fc=array(array("json"));}$Xb["mongo"]="MongoDB (beta)";if(isset($_GET["mongo"])){$_f=array("mongo");define("DRIVER","mongo");if(class_exists('MongoDB')){class
    51195130Min_DB{var$extension="Mongo",$error,$last_id,$_link,$_db;function
    5120 connect($N,$V,$G){global$b;$l=$b->database();$Ve=array();if($V!=""){$Ve["username"]=$V;$Ve["password"]=$G;}if($l!="")$Ve["db"]=$l;try{$this->_link=@new
     5131connect($N,$V,$G){global$b;$m=$b->database();$Ve=array();if($V!=""){$Ve["username"]=$V;$Ve["password"]=$G;}if($m!="")$Ve["db"]=$m;try{$this->_link=@new
    51215132MongoClient("mongodb://$N",$Ve);return
    5122 true;}catch(Exception$vc){$this->error=$vc->getMessage();return
     5133true;}catch(Exception$uc){$this->error=$uc->getMessage();return
    51235134false;}}function
    51245135query($H){return
    51255136false;}function
    5126 select_db($Hb){try{$this->_db=$this->_link->selectDB($Hb);return
    5127 true;}catch(Exception$vc){$this->error=$vc->getMessage();return
     5137select_db($Gb){try{$this->_db=$this->_link->selectDB($Gb);return
     5138true;}catch(Exception$uc){$this->error=$uc->getMessage();return
    51285139false;}}function
    51295140quote($P){return$P;}}class
     
    51405151extends
    51415152Min_SQL{public$Cf="_id";function
    5142 select($Q,$M,$Z,$Yc,$Xe=array(),$z=1,$E=0,$Ef=false){$M=($M==array("*")?array():array_fill_keys($M,true));$Cg=array();foreach($Xe
     5153select($Q,$M,$Z,$Xc,$Xe=array(),$z=1,$E=0,$Ef=false){$M=($M==array("*")?array():array_fill_keys($M,true));$Cg=array();foreach($Xe
    51435154as$X){$X=preg_replace('~ DESC$~','',$X,1,$Ab);$Cg[$X]=($Ab?-1:1);}return
    51445155new
    51455156Min_Result($this->_conn->_db->selectCollection($Q)->find(array(),$M)->sort($Cg)->limit(+$z)->skip($E*$z));}function
    5146 insert($Q,$O){try{$J=$this->_conn->_db->selectCollection($Q)->insert($O);$this->_conn->errno=$J['code'];$this->_conn->error=$J['err'];$this->_conn->last_id=$O['_id'];return!$J['err'];}catch(Exception$vc){$this->_conn->error=$vc->getMessage();return
     5157insert($Q,$O){try{$J=$this->_conn->_db->selectCollection($Q)->insert($O);$this->_conn->errno=$J['code'];$this->_conn->error=$J['err'];$this->_conn->last_id=$O['_id'];return!$J['err'];}catch(Exception$uc){$this->_conn->error=$uc->getMessage();return
    51475158false;}}}function
    51485159connect(){global$b;$h=new
    5149 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2]))return$h;return$h->error;}function
     5160Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2]))return$h;return$h->error;}function
    51505161error(){global$h;return
    51515162h($h->error);}function
    5152 logged_user(){global$b;$j=$b->credentials();return$j[1];}function
    5153 get_databases($Mc){global$h;$J=array();$Kb=$h->_link->listDBs();foreach($Kb['databases']as$l)$J[]=$l['name'];return$J;}function
     5163logged_user(){global$b;$k=$b->credentials();return$k[1];}function
     5164get_databases($Lc){global$h;$J=array();$Jb=$h->_link->listDBs();foreach($Jb['databases']as$m)$J[]=$m['name'];return$J;}function
    51545165collations(){return
    51555166array();}function
    5156 db_collation($l,$nb){}function
    5157 count_tables($k){global$h;$J=array();foreach($k
    5158 as$l)$J[$l]=count($h->_link->selectDB($l)->getCollectionNames(true));return$J;}function
     5167db_collation($m,$nb){}function
     5168count_tables($l){global$h;$J=array();foreach($l
     5169as$m)$J[$m]=count($h->_link->selectDB($m)->getCollectionNames(true));return$J;}function
    51595170tables_list(){global$h;return
    51605171array_fill_keys($h->_db->getCollectionNames(true),'table');}function
    5161 table_status($C="",$Fc=false){$J=array();foreach(tables_list()as$Q=>$U){$J[$Q]=array("Name"=>$Q);if($C==$Q)return$J[$Q];}return$J;}function
     5172table_status($C="",$Ec=false){$J=array();foreach(tables_list()as$Q=>$U){$J[$Q]=array("Name"=>$Q);if($C==$Q)return$J[$Q];}return$J;}function
    51625173information_schema(){}function
    51635174is_view($R){}function
    5164 drop_databases($k){global$h;foreach($k
    5165 as$l){$cg=$h->_link->selectDB($l)->drop();if(!$cg['ok'])return
     5175drop_databases($l){global$h;foreach($l
     5176as$m){$cg=$h->_link->selectDB($m)->drop();if(!$cg['ok'])return
    51665177false;}return
    51675178true;}function
    5168 indexes($Q,$i=null){global$h;$J=array();foreach($h->_db->selectCollection($Q)->getIndexInfo()as$u){$Qb=array();foreach($u["key"]as$e=>$U)$Qb[]=($U==-1?'1':null);$J[$u["name"]]=array("type"=>($u["name"]=="_id_"?"PRIMARY":($u["unique"]?"UNIQUE":"INDEX")),"columns"=>array_keys($u["key"]),"lengths"=>array(),"descs"=>$Qb,);}return$J;}function
     5179indexes($Q,$i=null){global$h;$J=array();foreach($h->_db->selectCollection($Q)->getIndexInfo()as$u){$Pb=array();foreach($u["key"]as$e=>$U)$Pb[]=($U==-1?'1':null);$J[$u["name"]]=array("type"=>($u["name"]=="_id_"?"PRIMARY":($u["unique"]?"UNIQUE":"INDEX")),"columns"=>array_keys($u["key"]),"lengths"=>array(),"descs"=>$Pb,);}return$J;}function
    51695180fields($Q){return
    51705181fields_from_edit();}function
    5171 convert_field($n){}function
    5172 unconvert_field($n,$J){return$J;}function
     5182convert_field($o){}function
     5183unconvert_field($o,$J){return$J;}function
    51735184foreign_keys($Q){return
    51745185array();}function
     
    51775188array();}function
    51785189found_rows($R,$Z){global$h;return$h->_db->selectCollection($_GET["select"])->count($Z);}function
    5179 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){global$h;if($Q==""){$h->_db->createCollection($C);return
     5190alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){global$h;if($Q==""){$h->_db->createCollection($C);return
    51805191true;}}function
    51815192drop_tables($S){global$h;foreach($S
     
    51955206table($t){return$t;}function
    51965207idf_escape($t){return$t;}function
    5197 support($Gc){return
    5198 preg_match("~database|indexes~",$Gc);}$w="mongo";$Se=array("=");$Vc=array();$ad=array();$gc=array(array("json"));}$Yb["elastic"]="Elasticsearch (beta)";if(isset($_GET["elastic"])){$_f=array("json");define("DRIVER","elastic");if(function_exists('json_decode')){class
     5208support($Fc){return
     5209preg_match("~database|indexes~",$Fc);}$w="mongo";$Se=array("=");$Uc=array();$Zc=array();$fc=array(array("json"));}$Xb["elastic"]="Elasticsearch (beta)";if(isset($_GET["elastic"])){$_f=array("json");define("DRIVER","elastic");if(function_exists('json_decode')){class
    51995210Min_DB{var$extension="JSON",$server_info,$errno,$error,$_url;function
    5200 rootQuery($rf,$wb=array(),$se='GET'){@ini_set('track_errors',1);$Ic=@file_get_contents($this->_url.'/'.ltrim($rf,'/'),false,stream_context_create(array('http'=>array('method'=>$se,'content'=>json_encode($wb),'ignore_errors'=>1,))));if(!$Ic){$this->error=$php_errormsg;return$Ic;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Ic;return
    5201 false;}$J=json_decode($Ic,true);if($J===null){$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$vb=get_defined_constants(true);foreach($vb['json']as$C=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$C)){$this->error=$C;break;}}}}return$J;}function
     5211rootQuery($rf,$wb=array(),$se='GET'){@ini_set('track_errors',1);$Hc=@file_get_contents($this->_url.'/'.ltrim($rf,'/'),false,stream_context_create(array('http'=>array('method'=>$se,'content'=>json_encode($wb),'ignore_errors'=>1,))));if(!$Hc){$this->error=$php_errormsg;return$Hc;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Hc;return
     5212false;}$J=json_decode($Hc,true);if($J===null){$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$vb=get_defined_constants(true);foreach($vb['json']as$C=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$C)){$this->error=$C;break;}}}}return$J;}function
    52025213query($rf,$wb=array(),$se='GET'){return$this->rootQuery(($this->_db!=""?"$this->_db/":"/").ltrim($rf,'/'),$wb,$se);}function
    52035214connect($N,$V,$G){$this->_url="http://$V:$G@$N/";$J=$this->query('');if($J)$this->server_info=$J['version']['number'];return(bool)$J;}function
    5204 select_db($Hb){$this->_db=$Hb;return
     5215select_db($Gb){$this->_db=$Gb;return
    52055216true;}function
    52065217quote($P){return$P;}}class
     
    52135224extends
    52145225Min_SQL{function
    5215 select($Q,$M,$Z,$Yc,$Xe=array(),$z=1,$E=0,$Ef=false){global$b;$Fb=array();$H="$Q/_search";if($M!=array("*"))$Fb["fields"]=$M;if($Xe){$Cg=array();foreach($Xe
    5216 as$lb){$lb=preg_replace('~ DESC$~','',$lb,1,$Ab);$Cg[]=($Ab?array($lb=>"desc"):$lb);}$Fb["sort"]=$Cg;}if($z){$Fb["size"]=+$z;if($E)$Fb["from"]=($E*$z);}foreach($Z
    5217 as$X){list($lb,$Qe,$X)=explode(" ",$X,3);if($lb=="_id")$Fb["query"]["ids"]["values"][]=$X;elseif($lb.$X!=""){$eh=array("term"=>array(($lb!=""?$lb:"_all")=>$X));if($Qe=="=")$Fb["query"]["filtered"]["filter"]["and"][]=$eh;else$Fb["query"]["filtered"]["query"]["bool"]["must"][]=$eh;}}if($Fb["query"]&&!$Fb["query"]["filtered"]["query"]&&!$Fb["query"]["ids"])$Fb["query"]["filtered"]["query"]=array("match_all"=>array());$Hg=microtime(true);$qg=$this->_conn->query($H,$Fb);if($Ef)echo$b->selectQuery("$H: ".print_r($Fb,true),format_time($Hg));if(!$qg)return
    5218 false;$J=array();foreach($qg['hits']['hits']as$hd){$K=array();if($M==array("*"))$K["_id"]=$hd["_id"];$o=$hd['_source'];if($M!=array("*")){$o=array();foreach($M
    5219 as$x)$o[$x]=$hd['fields'][$x];}foreach($o
    5220 as$x=>$X){if($Fb["fields"])$X=$X[0];$K[$x]=(is_array($X)?json_encode($X):$X);}$J[]=$K;}return
     5226select($Q,$M,$Z,$Xc,$Xe=array(),$z=1,$E=0,$Ef=false){global$b;$Eb=array();$H="$Q/_search";if($M!=array("*"))$Eb["fields"]=$M;if($Xe){$Cg=array();foreach($Xe
     5227as$lb){$lb=preg_replace('~ DESC$~','',$lb,1,$Ab);$Cg[]=($Ab?array($lb=>"desc"):$lb);}$Eb["sort"]=$Cg;}if($z){$Eb["size"]=+$z;if($E)$Eb["from"]=($E*$z);}foreach($Z
     5228as$X){list($lb,$Qe,$X)=explode(" ",$X,3);if($lb=="_id")$Eb["query"]["ids"]["values"][]=$X;elseif($lb.$X!=""){$eh=array("term"=>array(($lb!=""?$lb:"_all")=>$X));if($Qe=="=")$Eb["query"]["filtered"]["filter"]["and"][]=$eh;else$Eb["query"]["filtered"]["query"]["bool"]["must"][]=$eh;}}if($Eb["query"]&&!$Eb["query"]["filtered"]["query"]&&!$Eb["query"]["ids"])$Eb["query"]["filtered"]["query"]=array("match_all"=>array());$Hg=microtime(true);$qg=$this->_conn->query($H,$Eb);if($Ef)echo$b->selectQuery("$H: ".print_r($Eb,true),format_time($Hg));if(!$qg)return
     5229false;$J=array();foreach($qg['hits']['hits']as$gd){$K=array();if($M==array("*"))$K["_id"]=$gd["_id"];$p=$gd['_source'];if($M!=array("*")){$p=array();foreach($M
     5230as$x)$p[$x]=$gd['fields'][$x];}foreach($p
     5231as$x=>$X){if($Eb["fields"])$X=$X[0];$K[$x]=(is_array($X)?json_encode($X):$X);}$J[]=$K;}return
    52215232new
    52225233Min_Result($J);}}function
    52235234connect(){global$b;$h=new
    5224 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2]))return$h;return$h->error;}function
    5225 support($Gc){return
    5226 preg_match("~database|table|columns~",$Gc);}function
    5227 logged_user(){global$b;$j=$b->credentials();return$j[1];}function
     5235Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2]))return$h;return$h->error;}function
     5236support($Fc){return
     5237preg_match("~database|table|columns~",$Fc);}function
     5238logged_user(){global$b;$k=$b->credentials();return$k[1];}function
    52285239get_databases(){global$h;$J=$h->rootQuery('_aliases');if($J){$J=array_keys($J);sort($J,SORT_STRING);}return$J;}function
    52295240collations(){return
    52305241array();}function
    5231 db_collation($l,$nb){}function
     5242db_collation($m,$nb){}function
    52325243engines(){return
    52335244array();}function
    5234 count_tables($k){global$h;$J=$h->query('_mapping');if($J)$J=array_map('count',$J);return$J;}function
     5245count_tables($l){global$h;$J=$h->query('_mapping');if($J)$J=array_map('count',$J);return$J;}function
    52355246tables_list(){global$h;$J=$h->query('_mapping');if($J)$J=array_fill_keys(array_keys($J[$h->_db]["mappings"]),'table');return$J;}function
    5236 table_status($C="",$Fc=false){global$h;$qg=$h->query("_search?search_type=count",array("facets"=>array("count_by_type"=>array("terms"=>array("field"=>"_type",)))),"POST");$J=array();if($qg){foreach($qg["facets"]["count_by_type"]["terms"]as$Q)$J[$Q["term"]]=array("Name"=>$Q["term"],"Engine"=>"table","Rows"=>$Q["count"],);if($C!=""&&$C==$Q["term"])return$J[$C];}return$J;}function
     5247table_status($C="",$Ec=false){global$h;$qg=$h->query("_search?search_type=count",array("facets"=>array("count_by_type"=>array("terms"=>array("field"=>"_type",)))),"POST");$J=array();if($qg){foreach($qg["facets"]["count_by_type"]["terms"]as$Q)$J[$Q["term"]]=array("Name"=>$Q["term"],"Engine"=>"table","Rows"=>$Q["count"],);if($C!=""&&$C==$Q["term"])return$J[$C];}return$J;}function
    52375248error(){global$h;return
    52385249h($h->error);}function
     
    52425253array(array("type"=>"PRIMARY","columns"=>array("_id")),);}function
    52435254fields($Q){global$h;$I=$h->query("$Q/_mapping");$J=array();if($I){$ce=$I[$Q]['properties'];if(!$ce)$ce=$I[$h->_db]['mappings'][$Q]['properties'];if($ce){foreach($ce
    5244 as$C=>$n){$J[$C]=array("field"=>$C,"full_type"=>$n["type"],"type"=>$n["type"],"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),);if($n["properties"]){unset($J[$C]["privileges"]["insert"]);unset($J[$C]["privileges"]["update"]);}}}}return$J;}function
     5255as$C=>$o){$J[$C]=array("field"=>$C,"full_type"=>$o["type"],"type"=>$o["type"],"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),);if($o["properties"]){unset($J[$C]["privileges"]["insert"]);unset($J[$C]["privileges"]["update"]);}}}}return$J;}function
    52455256foreign_keys($Q){return
    52465257array();}function
    52475258table($t){return$t;}function
    52485259idf_escape($t){return$t;}function
    5249 convert_field($n){}function
    5250 unconvert_field($n,$J){return$J;}function
     5260convert_field($o){}function
     5261unconvert_field($o,$J){return$J;}function
    52515262fk_support($R){}function
    52525263found_rows($R,$Z){return
    52535264null;}function
    5254 create_database($l){global$h;return$h->rootQuery(urlencode($l),array(),'PUT');}function
    5255 drop_databases($k){global$h;return$h->rootQuery(urlencode(implode(',',$k)),array(),'DELETE');}function
     5265create_database($m){global$h;return$h->rootQuery(urlencode($m),array(),'PUT');}function
     5266drop_databases($l){global$h;return$h->rootQuery(urlencode(implode(',',$l)),array(),'DELETE');}function
    52565267drop_tables($S){global$h;$J=true;foreach($S
    5257 as$Q)$J=$J&&$h->query(urlencode($Q),array(),'DELETE');return$J;}$w="elastic";$Se=array("=","query");$Vc=array();$ad=array();$gc=array(array("json"));}$Yb=array("server"=>"MySQL")+$Yb;if(!defined("DRIVER")){$_f=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
     5268as$Q)$J=$J&&$h->query(urlencode($Q),array(),'DELETE');return$J;}$w="elastic";$Se=array("=","query");$Uc=array();$Zc=array();$fc=array(array("json"));}$Xb=array("server"=>"MySQL")+$Xb;if(!defined("DRIVER")){$_f=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
    52585269Min_DB
    52595270extends
    52605271MySQLi{var$extension="MySQLi";function
    52615272Min_DB(){parent::init();}function
    5262 connect($N,$V,$G){mysqli_report(MYSQLI_REPORT_OFF);list($id,$wf)=explode(":",$N,2);$J=@$this->real_connect(($N!=""?$id:ini_get("mysqli.default_host")),($N.$V!=""?$V:ini_get("mysqli.default_user")),($N.$V.$G!=""?$G:ini_get("mysqli.default_pw")),null,(is_numeric($wf)?$wf:ini_get("mysqli.default_port")),(!is_numeric($wf)?$wf:null));return$J;}function
    5263 result($H,$n=0){$I=$this->query($H);if(!$I)return
    5264 false;$K=$I->fetch_array();return$K[$n];}function
     5273connect($N,$V,$G){mysqli_report(MYSQLI_REPORT_OFF);list($hd,$wf)=explode(":",$N,2);$J=@$this->real_connect(($N!=""?$hd:ini_get("mysqli.default_host")),($N.$V!=""?$V:ini_get("mysqli.default_user")),($N.$V.$G!=""?$G:ini_get("mysqli.default_pw")),null,(is_numeric($wf)?$wf:ini_get("mysqli.default_port")),(!is_numeric($wf)?$wf:null));return$J;}function
     5274set_charset($ab){if(parent::set_charset($ab))return
     5275true;parent::set_charset('utf8');return$this->query("SET NAMES $ab");}function
     5276result($H,$o=0){$I=$this->query($H);if(!$I)return
     5277false;$K=$I->fetch_array();return$K[$o];}function
    52655278quote($P){return"'".$this->escape_string($P)."'";}}}elseif(extension_loaded("mysql")&&!(ini_get("sql.safe_mode")&&extension_loaded("pdo_mysql"))){class
    52665279Min_DB{var$extension="MySQL",$server_info,$affected_rows,$errno,$error,$_link,$_result;function
    52675280connect($N,$V,$G){$this->_link=@mysql_connect(($N!=""?$N:ini_get("mysql.default_host")),("$N$V"!=""?$V:ini_get("mysql.default_user")),("$N$V$G"!=""?$G:ini_get("mysql.default_password")),true,131072);if($this->_link)$this->server_info=mysql_get_server_info($this->_link);else$this->error=mysql_error();return(bool)$this->_link;}function
    5268 set_charset($ab){if(function_exists('mysql_set_charset'))return
    5269 mysql_set_charset($ab,$this->_link);return$this->query("SET NAMES $ab");}function
     5281set_charset($ab){if(function_exists('mysql_set_charset')){if(mysql_set_charset($ab,$this->_link))return
     5282true;mysql_set_charset('utf8',$this->_link);}return$this->query("SET NAMES $ab");}function
    52705283quote($P){return"'".mysql_real_escape_string($P,$this->_link)."'";}function
    5271 select_db($Hb){return
    5272 mysql_select_db($Hb,$this->_link);}function
     5284select_db($Gb){return
     5285mysql_select_db($Gb,$this->_link);}function
    52735286query($H,$Ch=false){$I=@($Ch?mysql_unbuffered_query($H,$this->_link):mysql_query($H,$this->_link));$this->error="";if(!$I){$this->errno=mysql_errno($this->_link);$this->error=mysql_error($this->_link);return
    52745287false;}if($I===true){$this->affected_rows=mysql_affected_rows($this->_link);$this->info=mysql_info($this->_link);return
     
    52805293next_result(){return
    52815294false;}function
    5282 result($H,$n=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
     5295result($H,$o=0){$I=$this->query($H);if(!$I||!$I->num_rows)return
    52835296false;return
    5284 mysql_result($I->_result,0,$n);}}class
     5297mysql_result($I->_result,0,$o);}}class
    52855298Min_Result{var$num_rows,$_result,$_offset=0;function
    52865299Min_Result($I){$this->_result=$I;$this->num_rows=mysql_num_rows($I);}function
     
    52975310true;}function
    52985311set_charset($ab){$this->query("SET NAMES $ab");}function
    5299 select_db($Hb){return$this->query("USE ".idf_escape($Hb));}function
     5312select_db($Gb){return$this->query("USE ".idf_escape($Gb));}function
    53005313query($H,$Ch=false){$this->setAttribute(1000,!$Ch);return
    53015314parent::query($H,$Ch);}}}class
     
    53135326idf_escape($t);}function
    53145327connect(){global$b;$h=new
    5315 Min_DB;$j=$b->credentials();if($h->connect($j[0],$j[1],$j[2])){$h->set_charset(charset($h));$h->query("SET sql_quote_show_create = 1, autocommit = 1");return$h;}$J=$h->error;if(function_exists('iconv')&&!is__utf8($J)&&strlen($mg=iconv("windows-1250","utf-8",$J))>strlen($J))$J=$mg;return$J;}function
    5316 get_databases($Mc){global$h;$J=get_session("dbs");if($J===null){$H=($h->server_info>=5?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA":"SHOW DATABASES");$J=($Mc?slow_query($H):get_vals($H));restart_session();set_session("dbs",$J);stop_session();}return$J;}function
     5328Min_DB;$k=$b->credentials();if($h->connect($k[0],$k[1],$k[2])){$h->set_charset(charset($h));$h->query("SET sql_quote_show_create = 1, autocommit = 1");return$h;}$J=$h->error;if(function_exists('iconv')&&!is__utf8($J)&&strlen($mg=iconv("windows-1250","utf-8",$J))>strlen($J))$J=$mg;return$J;}function
     5329get_databases($Lc){global$h;$J=get_session("dbs");if($J===null){$H=($h->server_info>=5?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA":"SHOW DATABASES");$J=($Lc?slow_query($H):get_vals($H));restart_session();set_session("dbs",$J);stop_session();}return$J;}function
    53175330limit($H,$Z,$z,$D=0,$vg=" "){return" $H$Z".($z!==null?$vg."LIMIT $z".($D?" OFFSET $D":""):"");}function
    53185331limit1($H,$Z){return
    53195332limit($H,$Z,1);}function
    5320 db_collation($l,$nb){global$h;$J=null;$Bb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1);if(preg_match('~ COLLATE ([^ ]+)~',$Bb,$B))$J=$B[1];elseif(preg_match('~ CHARACTER SET ([^ ]+)~',$Bb,$B))$J=$nb[$B[1]][-1];return$J;}function
     5333db_collation($m,$nb){global$h;$J=null;$j=$h->result("SHOW CREATE DATABASE ".idf_escape($m),1);if(preg_match('~ COLLATE ([^ ]+)~',$j,$B))$J=$B[1];elseif(preg_match('~ CHARACTER SET ([^ ]+)~',$j,$B))$J=$nb[$B[1]][-1];return$J;}function
    53215334engines(){$J=array();foreach(get_rows("SHOW ENGINES")as$K){if(preg_match("~YES|DEFAULT~",$K["Support"]))$J[]=$K["Engine"];}return$J;}function
    53225335logged_user(){global$h;return$h->result("SELECT USER()");}function
    53235336tables_list(){global$h;return
    53245337get_key_vals($h->server_info>=5?"SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME":"SHOW TABLES");}function
    5325 count_tables($k){$J=array();foreach($k
    5326 as$l)$J[$l]=count(get_vals("SHOW TABLES IN ".idf_escape($l)));return$J;}function
    5327 table_status($C="",$Fc=false){global$h;$J=array();foreach(get_rows($Fc&&$h->server_info>=5?"SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ".($C!=""?"AND TABLE_NAME = ".q($C):"ORDER BY Name"):"SHOW TABLE STATUS".($C!=""?" LIKE ".q(addcslashes($C,"%_\\")):""))as$K){if($K["Engine"]=="InnoDB")$K["Comment"]=preg_replace('~(?:(.+); )?InnoDB free: .*~','\\1',$K["Comment"]);if(!isset($K["Engine"]))$K["Comment"]="";if($C!="")return$K;$J[$K["Name"]]=$K;}return$J;}function
     5338count_tables($l){$J=array();foreach($l
     5339as$m)$J[$m]=count(get_vals("SHOW TABLES IN ".idf_escape($m)));return$J;}function
     5340table_status($C="",$Ec=false){global$h;$J=array();foreach(get_rows($Ec&&$h->server_info>=5?"SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ".($C!=""?"AND TABLE_NAME = ".q($C):"ORDER BY Name"):"SHOW TABLE STATUS".($C!=""?" LIKE ".q(addcslashes($C,"%_\\")):""))as$K){if($K["Engine"]=="InnoDB")$K["Comment"]=preg_replace('~(?:(.+); )?InnoDB free: .*~','\\1',$K["Comment"]);if(!isset($K["Engine"]))$K["Comment"]="";if($C!="")return$K;$J[$K["Name"]]=$K;}return$J;}function
    53285341is_view($R){return$R["Engine"]===null;}function
    53295342fk_support($R){global$h;return
     
    53315344fields($Q){$J=array();foreach(get_rows("SHOW FULL COLUMNS FROM ".table($Q))as$K){preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~',$K["Type"],$B);$J[$K["Field"]]=array("field"=>$K["Field"],"full_type"=>$K["Type"],"type"=>$B[1],"length"=>$B[2],"unsigned"=>ltrim($B[3].$B[4]),"default"=>($K["Default"]!=""||preg_match("~char|set~",$B[1])?$K["Default"]:null),"null"=>($K["Null"]=="YES"),"auto_increment"=>($K["Extra"]=="auto_increment"),"on_update"=>(preg_match('~^on update (.+)~i',$K["Extra"],$B)?$B[1]:""),"collation"=>$K["Collation"],"privileges"=>array_flip(preg_split('~, *~',$K["Privileges"])),"comment"=>$K["Comment"],"primary"=>($K["Key"]=="PRI"),);}return$J;}function
    53325345indexes($Q,$i=null){$J=array();foreach(get_rows("SHOW INDEX FROM ".table($Q),$i)as$K){$J[$K["Key_name"]]["type"]=($K["Key_name"]=="PRIMARY"?"PRIMARY":($K["Index_type"]=="FULLTEXT"?"FULLTEXT":($K["Non_unique"]?"INDEX":"UNIQUE")));$J[$K["Key_name"]]["columns"][]=$K["Column_name"];$J[$K["Key_name"]]["lengths"][]=$K["Sub_part"];$J[$K["Key_name"]]["descs"][]=null;}return$J;}function
    5333 foreign_keys($Q){global$h,$Ne;static$tf='`(?:[^`]|``)+`';$J=array();$Cb=$h->result("SHOW CREATE TABLE ".table($Q),1);if($Cb){preg_match_all("~CONSTRAINT ($tf) FOREIGN KEY ?\\(((?:$tf,? ?)+)\\) REFERENCES ($tf)(?:\\.($tf))? \\(((?:$tf,? ?)+)\\)(?: ON DELETE ($Ne))?(?: ON UPDATE ($Ne))?~",$Cb,$ee,PREG_SET_ORDER);foreach($ee
     5346foreign_keys($Q){global$h,$Ne;static$tf='`(?:[^`]|``)+`';$J=array();$Bb=$h->result("SHOW CREATE TABLE ".table($Q),1);if($Bb){preg_match_all("~CONSTRAINT ($tf) FOREIGN KEY ?\\(((?:$tf,? ?)+)\\) REFERENCES ($tf)(?:\\.($tf))? \\(((?:$tf,? ?)+)\\)(?: ON DELETE ($Ne))?(?: ON UPDATE ($Ne))?~",$Bb,$ee,PREG_SET_ORDER);foreach($ee
    53345347as$B){preg_match_all("~$tf~",$B[2],$Dg);preg_match_all("~$tf~",$B[5],$bh);$J[idf_unescape($B[1])]=array("db"=>idf_unescape($B[4]!=""?$B[3]:$B[4]),"table"=>idf_unescape($B[4]!=""?$B[4]:$B[3]),"source"=>array_map('idf_unescape',$Dg[0]),"target"=>array_map('idf_unescape',$bh[0]),"on_delete"=>($B[6]?$B[6]:"RESTRICT"),"on_update"=>($B[7]?$B[7]:"RESTRICT"),);}}return$J;}function
    53355348view($C){global$h;return
     
    53375350collations(){$J=array();foreach(get_rows("SHOW COLLATION")as$K){if($K["Default"])$J[$K["Charset"]][-1]=$K["Collation"];else$J[$K["Charset"]][]=$K["Collation"];}ksort($J);foreach($J
    53385351as$x=>$X)asort($J[$x]);return$J;}function
    5339 information_schema($l){global$h;return($h->server_info>=5&&$l=="information_schema")||($h->server_info>=5.5&&$l=="performance_schema");}function
     5352information_schema($m){global$h;return($h->server_info>=5&&$m=="information_schema")||($h->server_info>=5.5&&$m=="performance_schema");}function
    53405353error(){global$h;return
    53415354h(preg_replace('~^You have an error.*syntax to use~U',"Syntax error",$h->error));}function
    53425355error_line(){global$h;if(preg_match('~ at line ([0-9]+)$~',$h->error,$Yf))return$Yf[1]-1;}function
    5343 create_database($l,$d){return
    5344 queries("CREATE DATABASE ".idf_escape($l).($d?" COLLATE ".q($d):""));}function
    5345 drop_databases($k){$J=apply_queries("DROP DATABASE",$k,'idf_escape');restart_session();set_session("dbs",null);return$J;}function
     5356create_database($m,$d){return
     5357queries("CREATE DATABASE ".idf_escape($m).($d?" COLLATE ".q($d):""));}function
     5358drop_databases($l){$J=apply_queries("DROP DATABASE",$l,'idf_escape');restart_session();set_session("dbs",null);return$J;}function
    53465359rename_database($C,$d){$J=false;if(create_database($C,$d)){$ag=array();foreach(tables_list()as$Q=>$U)$ag[]=table($Q)." TO ".idf_escape($C).".".table($Q);$J=(!$ag||queries("RENAME TABLE ".implode(", ",$ag)));if($J)queries("DROP DATABASE ".idf_escape(DB));restart_session();set_session("dbs",null);}return$J;}function
    53475360auto_increment(){$Ma=" PRIMARY KEY";if($_GET["create"]!=""&&$_POST["auto_increment_col"]){foreach(indexes($_GET["create"])as$u){if(in_array($_POST["fields"][$_POST["auto_increment_col"]]["orig"],$u["columns"],true)){$Ma="";break;}if($u["type"]=="PRIMARY")$Ma=" UNIQUE";}}return" AUTO_INCREMENT$Ma";}function
    5348 alter_table($Q,$C,$o,$Nc,$rb,$oc,$d,$La,$of){$c=array();foreach($o
    5349 as$n)$c[]=($n[1]?($Q!=""?($n[0]!=""?"CHANGE ".idf_escape($n[0]):"ADD"):" ")." ".implode($n[1]).($Q!=""?$n[2]:""):"DROP ".idf_escape($n[0]));$c=array_merge($c,$Nc);$Ig=($rb!==null?" COMMENT=".q($rb):"").($oc?" ENGINE=".q($oc):"").($d?" COLLATE ".q($d):"").($La!=""?" AUTO_INCREMENT=$La":"");if($Q=="")return
     5361alter_table($Q,$C,$p,$Mc,$rb,$nc,$d,$La,$of){$c=array();foreach($p
     5362as$o)$c[]=($o[1]?($Q!=""?($o[0]!=""?"CHANGE ".idf_escape($o[0]):"ADD"):" ")." ".implode($o[1]).($Q!=""?$o[2]:""):"DROP ".idf_escape($o[0]));$c=array_merge($c,$Mc);$Ig=($rb!==null?" COMMENT=".q($rb):"").($nc?" ENGINE=".q($nc):"").($d?" COLLATE ".q($d):"").($La!=""?" AUTO_INCREMENT=$La":"");if($Q=="")return
    53505363queries("CREATE TABLE ".table($C)." (\n".implode(",\n",$c)."\n)$Ig$of");if($Q!=$C)$c[]="RENAME TO ".table($C);if($Ig)$c[]=ltrim($Ig);return($c||$of?queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$c).$of):true);}function
    53515364alter_indexes($Q,$c){foreach($c
     
    53725385trigger_options(){return
    53735386array("Timing"=>array("BEFORE","AFTER"),"Event"=>array("INSERT","UPDATE","DELETE"),"Type"=>array("FOR EACH ROW"),);}function
    5374 routine($C,$U){global$h,$qc,$ud,$Bh;$Ca=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Ah="((".implode("|",array_merge(array_keys($Bh),$Ca)).")\\b(?:\\s*\\(((?:[^'\")]|$qc)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";$tf="\\s*(".($U=="FUNCTION"?"":$ud).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ah";$Bb=$h->result("SHOW CREATE $U ".idf_escape($C),2);preg_match("~\\(((?:$tf\\s*,?)*)\\)\\s*".($U=="FUNCTION"?"RETURNS\\s+$Ah\\s+":"")."(.*)~is",$Bb,$B);$o=array();preg_match_all("~$tf\\s*,?~is",$B[1],$ee,PREG_SET_ORDER);foreach($ee
    5375 as$jf){$C=str_replace("``","`",$jf[2]).$jf[3];$o[]=array("field"=>$C,"type"=>strtolower($jf[5]),"length"=>preg_replace_callback("~$qc~s",'normalize_enum',$jf[6]),"unsigned"=>strtolower(preg_replace('~\\s+~',' ',trim("$jf[8] $jf[7]"))),"null"=>1,"full_type"=>$jf[4],"inout"=>strtoupper($jf[1]),"collation"=>strtolower($jf[9]),);}if($U!="FUNCTION")return
    5376 array("fields"=>$o,"definition"=>$B[11]);return
    5377 array("fields"=>$o,"returns"=>array("type"=>$B[12],"length"=>$B[13],"unsigned"=>$B[15],"collation"=>$B[16]),"definition"=>$B[17],"language"=>"SQL",);}function
     5387routine($C,$U){global$h,$pc,$ud,$Bh;$Ca=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Ah="((".implode("|",array_merge(array_keys($Bh),$Ca)).")\\b(?:\\s*\\(((?:[^'\")]|$pc)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";$tf="\\s*(".($U=="FUNCTION"?"":$ud).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ah";$j=$h->result("SHOW CREATE $U ".idf_escape($C),2);preg_match("~\\(((?:$tf\\s*,?)*)\\)\\s*".($U=="FUNCTION"?"RETURNS\\s+$Ah\\s+":"")."(.*)~is",$j,$B);$p=array();preg_match_all("~$tf\\s*,?~is",$B[1],$ee,PREG_SET_ORDER);foreach($ee
     5388as$jf){$C=str_replace("``","`",$jf[2]).$jf[3];$p[]=array("field"=>$C,"type"=>strtolower($jf[5]),"length"=>preg_replace_callback("~$pc~s",'normalize_enum',$jf[6]),"unsigned"=>strtolower(preg_replace('~\\s+~',' ',trim("$jf[8] $jf[7]"))),"null"=>1,"full_type"=>$jf[4],"inout"=>strtoupper($jf[1]),"collation"=>strtolower($jf[9]),);}if($U!="FUNCTION")return
     5389array("fields"=>$p,"definition"=>$B[11]);return
     5390array("fields"=>$p,"returns"=>array("type"=>$B[12],"length"=>$B[13],"unsigned"=>$B[15],"collation"=>$B[16]),"definition"=>$B[17],"language"=>"SQL",);}function
    53785391routines(){return
    53795392get_rows("SELECT ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = ".q(DB));}function
     
    53925405create_sql($Q,$La){global$h;$J=$h->result("SHOW CREATE TABLE ".table($Q),1);if(!$La)$J=preg_replace('~ AUTO_INCREMENT=\\d+~','',$J);return$J;}function
    53935406truncate_sql($Q){return"TRUNCATE ".table($Q);}function
    5394 use_sql($Hb){return"USE ".idf_escape($Hb);}function
     5407use_sql($Gb){return"USE ".idf_escape($Gb);}function
    53955408trigger_sql($Q,$Mg){$J="";foreach(get_rows("SHOW TRIGGERS LIKE ".q(addcslashes($Q,"%_\\")),null,"-- ")as$K)$J.="\n".($Mg=='CREATE+ALTER'?"DROP TRIGGER IF EXISTS ".idf_escape($K["Trigger"]).";;\n":"")."CREATE TRIGGER ".idf_escape($K["Trigger"])." $K[Timing] $K[Event] ON ".table($K["Table"])." FOR EACH ROW\n$K[Statement];;\n";return$J;}function
    53965409show_variables(){return
     
    54005413show_status(){return
    54015414get_key_vals("SHOW STATUS");}function
    5402 convert_field($n){if(preg_match("~binary~",$n["type"]))return"HEX(".idf_escape($n["field"]).")";if($n["type"]=="bit")return"BIN(".idf_escape($n["field"])." + 0)";if(preg_match("~geometry|point|linestring|polygon~",$n["type"]))return"AsWKT(".idf_escape($n["field"]).")";}function
    5403 unconvert_field($n,$J){if(preg_match("~binary~",$n["type"]))$J="UNHEX($J)";if($n["type"]=="bit")$J="CONV($J, 2, 10) + 0";if(preg_match("~geometry|point|linestring|polygon~",$n["type"]))$J="GeomFromText($J)";return$J;}function
    5404 support($Gc){global$h;return!preg_match("~scheme|sequence|type|view_trigger".($h->server_info<5.1?"|event|partitioning".($h->server_info<5?"|routine|trigger|view":""):"")."~",$Gc);}$w="sql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(25)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(26)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(30)=>array("enum"=>65535,"set"=>64),lang(27)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(29)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array("unsigned","zerofill","unsigned zerofill");$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$Vc=array("char_length","date","from_unixtime","lower","round","sec_to_time","time_to_sec","upper");$ad=array("avg","count","count distinct","group_concat","max","min","sum");$gc=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array("(^|[^o])int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ia="4.2.0";class
     5415convert_field($o){if(preg_match("~binary~",$o["type"]))return"HEX(".idf_escape($o["field"]).")";if($o["type"]=="bit")return"BIN(".idf_escape($o["field"])." + 0)";if(preg_match("~geometry|point|linestring|polygon~",$o["type"]))return"AsWKT(".idf_escape($o["field"]).")";}function
     5416unconvert_field($o,$J){if(preg_match("~binary~",$o["type"]))$J="UNHEX($J)";if($o["type"]=="bit")$J="CONV($J, 2, 10) + 0";if(preg_match("~geometry|point|linestring|polygon~",$o["type"]))$J="GeomFromText($J)";return$J;}function
     5417support($Fc){global$h;return!preg_match("~scheme|sequence|type|view_trigger".($h->server_info<5.1?"|event|partitioning".($h->server_info<5?"|routine|trigger|view":""):"")."~",$Fc);}$w="sql";$Bh=array();$Lg=array();foreach(array(lang(24)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(25)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(26)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(30)=>array("enum"=>65535,"set"=>64),lang(27)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(29)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$x=>$X){$Bh+=$X;$Lg[$x]=array_keys($X);}$Ih=array("unsigned","zerofill","unsigned zerofill");$Se=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$Uc=array("char_length","date","from_unixtime","lower","round","sec_to_time","time_to_sec","upper");$Zc=array("avg","count","count distinct","group_concat","max","min","sum");$fc=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array("(^|[^o])int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ia="4.2.1";class
    54055418Adminer{var$operators;function
    54065419name(){return"<a href='http://www.adminer.org/' target='_blank' id='h1'>Adminer</a>";}function
    54075420credentials(){return
    54085421array(SERVER,$_GET["username"],get_password());}function
    5409 permanentLogin($Bb=false){return
    5410 password_file($Bb);}function
     5422permanentLogin($j=false){return
     5423password_file($j);}function
    54115424bruteForceKey(){return$_SERVER["REMOTE_ADDR"];}function
    54125425database(){return
    54135426DB;}function
    5414 databases($Mc=true){return
    5415 get_databases($Mc);}function
     5427databases($Lc=true){return
     5428get_databases($Lc);}function
    54165429schemas(){return
    54175430schemas();}function
     
    54225435head(){return
    54235436true;}function
    5424 loginForm(){global$Yb;echo'<table cellspacing="0">
    5425 <tr><th>',lang(31),'<td>',html_select("auth[driver]",$Yb,DRIVER,"loginDriver(this);"),'<tr><th>',lang(32),'<td><input name="auth[server]" value="',h(SERVER),'" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
     5437loginForm(){global$Xb;echo'<table cellspacing="0">
     5438<tr><th>',lang(31),'<td>',html_select("auth[driver]",$Xb,DRIVER,"loginDriver(this);"),'<tr><th>',lang(32),'<td><input name="auth[server]" value="',h(SERVER),'" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
    54265439<tr><th>',lang(33),'<td><input name="auth[username]" id="username" value="',h($_GET["username"]),'" autocapitalize="off">
    54275440<tr><th>',lang(34),'<td><input type="password" name="auth[password]">
     
    54405453tableName($Sg){return
    54415454h($Sg["Name"]);}function
    5442 fieldName($n,$Xe=0){return'<span title="'.h($n["full_type"]).'">'.h($n["field"]).'</span>';}function
     5455fieldName($o,$Xe=0){return'<span title="'.h($o["full_type"]).'">'.h($o["field"]).'</span>';}function
    54435456selectLinks($Sg,$O=""){echo'<p class="links">';$Zd=array("select"=>lang(38));if(support("table")||support("indexes"))$Zd["table"]=lang(39);if(support("table")){if(is_view($Sg))$Zd["view"]=lang(40);else$Zd["create"]=lang(41);}if($O!==null)$Zd["edit"]=lang(42);foreach($Zd
    54445457as$x=>$X)echo" <a href='".h(ME)."$x=".urlencode($Sg["Name"]).($x=="edit"?$O:"")."'".bold(isset($_GET[$x])).">$X</a>";echo"\n";}function
     
    54505463selectQuery($H,$ih){global$w;return"<p><code class='jush-$w'>".h(str_replace("\n"," ",$H))."</code> <span class='time'>($ih)</span>".(support("sql")?" <a href='".h(ME)."sql=".urlencode($H)."'>".lang(10)."</a>":"")."</p>";}function
    54515464rowDescription($Q){return"";}function
    5452 rowDescriptions($L,$Oc){return$L;}function
    5453 selectLink($X,$n){}function
    5454 selectVal($X,$_,$n,$ef){$J=($X===null?"<i>NULL</i>":(preg_match("~char|binary~",$n["type"])&&!preg_match("~var~",$n["type"])?"<code>$X</code>":$X));if(preg_match('~blob|bytea|raw|file~',$n["type"])&&!is__utf8($X))$J=lang(43,strlen($ef));return($_?"<a href='".h($_)."'".(is_url($_)?" rel='noreferrer'":"").">$J</a>":$J);}function
    5455 editVal($X,$n){return$X;}function
    5456 selectColumnsPrint($M,$f){global$Vc,$ad;print_fieldset("select",lang(44),$M);$r=0;$M[""]=array();foreach($M
    5457 as$x=>$X){$X=$_GET["columns"][$x];$e=select_input(" name='columns[$r][col]' onchange='".($x!==""?"selectFieldChange(this.form)":"selectAddRow(this)").";'",$f,$X["col"]);echo"<div>".($Vc||$ad?"<select name='columns[$r][fun]' onchange='helpClose();".($x!==""?"":" this.nextSibling.nextSibling.onchange();")."'".on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'",1).">".optionlist(array(-1=>"")+array_filter(array(lang(45)=>$Vc,lang(46)=>$ad)),$X["fun"])."</select>"."($e)":$e)."</div>\n";$r++;}echo"</div></fieldset>\n";}function
     5465rowDescriptions($L,$Nc){return$L;}function
     5466selectLink($X,$o){}function
     5467selectVal($X,$_,$o,$ef){$J=($X===null?"<i>NULL</i>":(preg_match("~char|binary~",$o["type"])&&!preg_match("~var~",$o["type"])?"<code>$X</code>":$X));if(preg_match('~blob|bytea|raw|file~',$o["type"])&&!is__utf8($X))$J=lang(43,strlen($ef));return($_?"<a href='".h($_)."'".(is_url($_)?" rel='noreferrer'":"").">$J</a>":$J);}function
     5468editVal($X,$o){return$X;}function
     5469selectColumnsPrint($M,$f){global$Uc,$Zc;print_fieldset("select",lang(44),$M);$s=0;$M[""]=array();foreach($M
     5470as$x=>$X){$X=$_GET["columns"][$x];$e=select_input(" name='columns[$s][col]' onchange='".($x!==""?"selectFieldChange(this.form)":"selectAddRow(this)").";'",$f,$X["col"]);echo"<div>".($Uc||$Zc?"<select name='columns[$s][fun]' onchange='helpClose();".($x!==""?"":" this.nextSibling.nextSibling.onchange();")."'".on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'",1).">".optionlist(array(-1=>"")+array_filter(array(lang(45)=>$Uc,lang(46)=>$Zc)),$X["fun"])."</select>"."($e)":$e)."</div>\n";$s++;}echo"</div></fieldset>\n";}function
    54585471selectSearchPrint($Z,$f,$v){print_fieldset("search",lang(47),$Z);foreach($v
    5459 as$r=>$u){if($u["type"]=="FULLTEXT"){echo"(<i>".implode("</i>, <i>",array_map('h',$u["columns"]))."</i>) AGAINST"," <input type='search' name='fulltext[$r]' value='".h($_GET["fulltext"][$r])."' onchange='selectFieldChange(this.form);'>",checkbox("boolean[$r]",1,isset($_GET["boolean"][$r]),"BOOL"),"<br>\n";}}$_GET["where"]=(array)$_GET["where"];reset($_GET["where"]);$Za="this.nextSibling.onchange();";for($r=0;$r<=count($_GET["where"]);$r++){list(,$X)=each($_GET["where"]);if(!$X||("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators))){echo"<div>".select_input(" name='where[$r][col]' onchange='$Za'",$f,$X["col"],"(".lang(48).")"),html_select("where[$r][op]",$this->operators,$X["op"],$Za),"<input type='search' name='where[$r][val]' value='".h($X["val"])."' onchange='".($X?"selectFieldChange(this.form)":"selectAddRow(this)").";' onkeydown='selectSearchKeydown(this, event);' onsearch='selectSearchSearch(this);'></div>\n";}}echo"</div></fieldset>\n";}function
    5460 selectOrderPrint($Xe,$f,$v){print_fieldset("sort",lang(49),$Xe);$r=0;foreach((array)$_GET["order"]as$x=>$X){if($X!=""){echo"<div>".select_input(" name='order[$r]' onchange='selectFieldChange(this.form);'",$f,$X),checkbox("desc[$r]",1,isset($_GET["desc"][$x]),lang(50))."</div>\n";$r++;}}echo"<div>".select_input(" name='order[$r]' onchange='selectAddRow(this);'",$f),checkbox("desc[$r]",1,false,lang(50))."</div>\n","</div></fieldset>\n";}function
     5472as$s=>$u){if($u["type"]=="FULLTEXT"){echo"(<i>".implode("</i>, <i>",array_map('h',$u["columns"]))."</i>) AGAINST"," <input type='search' name='fulltext[$s]' value='".h($_GET["fulltext"][$s])."' onchange='selectFieldChange(this.form);'>",checkbox("boolean[$s]",1,isset($_GET["boolean"][$s]),"BOOL"),"<br>\n";}}$_GET["where"]=(array)$_GET["where"];reset($_GET["where"]);$Za="this.nextSibling.onchange();";for($s=0;$s<=count($_GET["where"]);$s++){list(,$X)=each($_GET["where"]);if(!$X||("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators))){echo"<div>".select_input(" name='where[$s][col]' onchange='$Za'",$f,$X["col"],"(".lang(48).")"),html_select("where[$s][op]",$this->operators,$X["op"],$Za),"<input type='search' name='where[$s][val]' value='".h($X["val"])."' onchange='".($X?"selectFieldChange(this.form)":"selectAddRow(this)").";' onkeydown='selectSearchKeydown(this, event);' onsearch='selectSearchSearch(this);'></div>\n";}}echo"</div></fieldset>\n";}function
     5473selectOrderPrint($Xe,$f,$v){print_fieldset("sort",lang(49),$Xe);$s=0;foreach((array)$_GET["order"]as$x=>$X){if($X!=""){echo"<div>".select_input(" name='order[$s]' onchange='selectFieldChange(this.form);'",$f,$X),checkbox("desc[$s]",1,isset($_GET["desc"][$x]),lang(50))."</div>\n";$s++;}}echo"<div>".select_input(" name='order[$s]' onchange='selectAddRow(this);'",$f),checkbox("desc[$s]",1,false,lang(50))."</div>\n","</div></fieldset>\n";}function
    54615474selectLimitPrint($z){echo"<fieldset><legend>".lang(51)."</legend><div>";echo"<input type='number' name='limit' class='size' value='".h($z)."' onchange='selectFieldChange(this.form);'>","</div></fieldset>\n";}function
    54625475selectLengthPrint($hh){if($hh!==null){echo"<fieldset><legend>".lang(52)."</legend><div>","<input type='number' name='text_length' class='size' value='".h($hh)."'>","</div></fieldset>\n";}}function
     
    54665479selectCommandPrint(){return!information_schema(DB);}function
    54675480selectImportPrint(){return!information_schema(DB);}function
    5468 selectEmailPrint($lc,$f){}function
    5469 selectColumnsProcess($f,$v){global$Vc,$ad;$M=array();$Yc=array();foreach((array)$_GET["columns"]as$x=>$X){if($X["fun"]=="count"||($X["col"]!=""&&(!$X["fun"]||in_array($X["fun"],$Vc)||in_array($X["fun"],$ad)))){$M[$x]=apply_sql_function($X["fun"],($X["col"]!=""?idf_escape($X["col"]):"*"));if(!in_array($X["fun"],$ad))$Yc[]=$M[$x];}}return
    5470 array($M,$Yc);}function
    5471 selectSearchProcess($o,$v){global$h,$w;$J=array();foreach($v
    5472 as$r=>$u){if($u["type"]=="FULLTEXT"&&$_GET["fulltext"][$r]!="")$J[]="MATCH (".implode(", ",array_map('idf_escape',$u["columns"])).") AGAINST (".q($_GET["fulltext"][$r]).(isset($_GET["boolean"][$r])?" IN BOOLEAN MODE":"").")";}foreach((array)$_GET["where"]as$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$tb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$nd=process_length($X["val"]);$tb.=" ".($nd!=""?$nd:"(NULL)");}elseif($X["op"]=="SQL")$tb=" $X[val]";elseif($X["op"]=="LIKE %%")$tb=" LIKE ".$this->processInput($o[$X["col"]],"%$X[val]%");elseif($X["op"]=="ILIKE %%")$tb=" ILIKE ".$this->processInput($o[$X["col"]],"%$X[val]%");elseif(!preg_match('~NULL$~',$X["op"]))$tb.=" ".$this->processInput($o[$X["col"]],$X["val"]);if($X["col"]!="")$J[]=idf_escape($X["col"]).$tb;else{$ob=array();foreach($o
    5473 as$C=>$n){$Cd=preg_match('~char|text|enum|set~',$n["type"]);if((is_numeric($X["val"])||!preg_match('~(^|[^o])int|float|double|decimal|bit~',$n["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||$Cd)){$C=idf_escape($C);$ob[]=($w=="sql"&&$Cd&&!preg_match("~^utf8_~",$n["collation"])?"CONVERT($C USING ".charset($h).")":$C);}}$J[]=($ob?"(".implode("$tb OR ",$ob)."$tb)":"0");}}}return$J;}function
    5474 selectOrderProcess($o,$v){$J=array();foreach((array)$_GET["order"]as$x=>$X){if($X!="")$J[]=(preg_match('~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\\)|COUNT\\(\\*\\))$~',$X)?$X:idf_escape($X)).(isset($_GET["desc"][$x])?" DESC":"");}return$J;}function
     5481selectEmailPrint($kc,$f){}function
     5482selectColumnsProcess($f,$v){global$Uc,$Zc;$M=array();$Xc=array();foreach((array)$_GET["columns"]as$x=>$X){if($X["fun"]=="count"||($X["col"]!=""&&(!$X["fun"]||in_array($X["fun"],$Uc)||in_array($X["fun"],$Zc)))){$M[$x]=apply_sql_function($X["fun"],($X["col"]!=""?idf_escape($X["col"]):"*"));if(!in_array($X["fun"],$Zc))$Xc[]=$M[$x];}}return
     5483array($M,$Xc);}function
     5484selectSearchProcess($p,$v){global$h,$w;$J=array();foreach($v
     5485as$s=>$u){if($u["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$J[]="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)){$tb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$nd=process_length($X["val"]);$tb.=" ".($nd!=""?$nd:"(NULL)");}elseif($X["op"]=="SQL")$tb=" $X[val]";elseif($X["op"]=="LIKE %%")$tb=" LIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif($X["op"]=="ILIKE %%")$tb=" ILIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif(!preg_match('~NULL$~',$X["op"]))$tb.=" ".$this->processInput($p[$X["col"]],$X["val"]);if($X["col"]!="")$J[]=idf_escape($X["col"]).$tb;else{$ob=array();foreach($p
     5486as$C=>$o){$Cd=preg_match('~char|text|enum|set~',$o["type"]);if((is_numeric($X["val"])||!preg_match('~(^|[^o])int|float|double|decimal|bit~',$o["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||$Cd)){$C=idf_escape($C);$ob[]=($w=="sql"&&$Cd&&!preg_match("~^utf8_~",$o["collation"])?"CONVERT($C USING ".charset($h).")":$C);}}$J[]=($ob?"(".implode("$tb OR ",$ob)."$tb)":"0");}}}return$J;}function
     5487selectOrderProcess($p,$v){$J=array();foreach((array)$_GET["order"]as$x=>$X){if($X!="")$J[]=(preg_match('~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\\)|COUNT\\(\\*\\))$~',$X)?$X:idf_escape($X)).(isset($_GET["desc"][$x])?" DESC":"");}return$J;}function
    54755488selectLimitProcess(){return(isset($_GET["limit"])?$_GET["limit"]:"50");}function
    54765489selectLengthProcess(){return(isset($_GET["text_length"])?$_GET["text_length"]:"100");}function
    5477 selectEmailProcess($Z,$Oc){return
     5490selectEmailProcess($Z,$Nc){return
    54785491false;}function
    5479 selectQueryBuild($M,$Z,$Yc,$Xe,$z,$E){return"";}function
    5480 messageQuery($H,$ih){global$w;restart_session();$fd=&get_session("queries");$s="sql-".count($fd[$_GET["db"]]);if(strlen($H)>1e6)$H=preg_replace('~[\x80-\xFF]+$~','',substr($H,0,1e6))."\n...";$fd[$_GET["db"]][]=array($H,time(),$ih);return" <span class='time'>".@date("H:i:s")."</span> <a href='#$s' onclick=\"return !toggle('$s');\">".lang(55)."</a>"."<div id='$s' class='hidden'><pre><code class='jush-$w'>".shorten_utf8($H,1000).'</code></pre>'.($ih?" <span class='time'>($ih)</span>":'').(support("sql")?'<p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($fd[$_GET["db"]])-1)).'">'.lang(10).'</a>':'').'</div>';}function
    5481 editFunctions($n){global$gc;$J=($n["null"]?"NULL/":"");foreach($gc
    5482 as$x=>$Vc){if(!$x||(!isset($_GET["call"])&&(isset($_GET["select"])||where($_GET)))){foreach($Vc
    5483 as$tf=>$X){if(!$tf||preg_match("~$tf~",$n["type"]))$J.="/$X";}if($x&&!preg_match('~set|blob|bytea|raw|file~',$n["type"]))$J.="/SQL";}}if($n["auto_increment"]&&!isset($_GET["select"])&&!where($_GET))$J=lang(56);return
     5492selectQueryBuild($M,$Z,$Xc,$Xe,$z,$E){return"";}function
     5493messageQuery($H,$ih){global$w;restart_session();$ed=&get_session("queries");$jd="sql-".count($ed[$_GET["db"]]);if(strlen($H)>1e6)$H=preg_replace('~[\x80-\xFF]+$~','',substr($H,0,1e6))."\n...";$ed[$_GET["db"]][]=array($H,time(),$ih);return" <span class='time'>".@date("H:i:s")."</span> <a href='#$jd' onclick=\"return !toggle('$jd');\">".lang(55)."</a>"."<div id='$jd' class='hidden'><pre><code class='jush-$w'>".shorten_utf8($H,1000).'</code></pre>'.($ih?" <span class='time'>($ih)</span>":'').(support("sql")?'<p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($ed[$_GET["db"]])-1)).'">'.lang(10).'</a>':'').'</div>';}function
     5494editFunctions($o){global$fc;$J=($o["null"]?"NULL/":"");foreach($fc
     5495as$x=>$Uc){if(!$x||(!isset($_GET["call"])&&(isset($_GET["select"])||where($_GET)))){foreach($Uc
     5496as$tf=>$X){if(!$tf||preg_match("~$tf~",$o["type"]))$J.="/$X";}if($x&&!preg_match('~set|blob|bytea|raw|file~',$o["type"]))$J.="/SQL";}}if($o["auto_increment"]&&!isset($_GET["select"])&&!where($_GET))$J=lang(56);return
    54845497explode("/",$J);}function
    5485 editInput($Q,$n,$Ja,$Y){if($n["type"]=="enum")return(isset($_GET["select"])?"<label><input type='radio'$Ja value='-1' checked><i>".lang(8)."</i></label> ":"").($n["null"]?"<label><input type='radio'$Ja value=''".($Y!==null||isset($_GET["select"])?"":" checked")."><i>NULL</i></label> ":"").enum_input("radio",$Ja,$n,$Y,0);return"";}function
    5486 processInput($n,$Y,$q=""){if($q=="SQL")return$Y;$C=$n["field"];$J=q($Y);if(preg_match('~^(now|getdate|uuid)$~',$q))$J="$q()";elseif(preg_match('~^current_(date|timestamp)$~',$q))$J=$q;elseif(preg_match('~^([+-]|\\|\\|)$~',$q))$J=idf_escape($C)." $q $J";elseif(preg_match('~^[+-] interval$~',$q))$J=idf_escape($C)." $q ".(preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i",$Y)?$Y:$J);elseif(preg_match('~^(addtime|subtime|concat)$~',$q))$J="$q(".idf_escape($C).", $J)";elseif(preg_match('~^(md5|sha1|password|encrypt)$~',$q))$J="$q($J)";return
    5487 unconvert_field($n,$J);}function
     5498editInput($Q,$o,$Ja,$Y){if($o["type"]=="enum")return(isset($_GET["select"])?"<label><input type='radio'$Ja value='-1' checked><i>".lang(8)."</i></label> ":"").($o["null"]?"<label><input type='radio'$Ja value=''".($Y!==null||isset($_GET["select"])?"":" checked")."><i>NULL</i></label> ":"").enum_input("radio",$Ja,$o,$Y,0);return"";}function
     5499processInput($o,$Y,$r=""){if($r=="SQL")return$Y;$C=$o["field"];$J=q($Y);if(preg_match('~^(now|getdate|uuid)$~',$r))$J="$r()";elseif(preg_match('~^current_(date|timestamp)$~',$r))$J=$r;elseif(preg_match('~^([+-]|\\|\\|)$~',$r))$J=idf_escape($C)." $r $J";elseif(preg_match('~^[+-] interval$~',$r))$J=idf_escape($C)." $r ".(preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i",$Y)?$Y:$J);elseif(preg_match('~^(addtime|subtime|concat)$~',$r))$J="$r(".idf_escape($C).", $J)";elseif(preg_match('~^(md5|sha1|password|encrypt)$~',$r))$J="$r($J)";return
     5500unconvert_field($o,$J);}function
    54885501dumpOutput(){$J=array('text'=>lang(57),'file'=>lang(58));if(function_exists('gzencode'))$J['gz']='gzip';return$J;}function
    54895502dumpFormat(){return
    54905503array('sql'=>'SQL','csv'=>'CSV,','csv;'=>'CSV;','tsv'=>'TSV');}function
    5491 dumpDatabase($l){}function
    5492 dumpTable($Q,$Mg,$Dd=0){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($Mg)dump_csv(array_keys(fields($Q)));}elseif($Mg){if($Dd==2){$o=array();foreach(fields($Q)as$C=>$n)$o[]=idf_escape($C)." $n[full_type]";$Bb="CREATE TABLE ".table($Q)." (".implode(", ",$o).")";}else$Bb=create_sql($Q,$_POST["auto_increment"]);if($Bb){if($Mg=="DROP+CREATE"||$Dd==1)echo"DROP ".($Dd==2?"VIEW":"TABLE")." IF EXISTS ".table($Q).";\n";if($Dd==1)$Bb=remove_definer($Bb);echo"$Bb;\n\n";}}}function
     5504dumpDatabase($m){}function
     5505dumpTable($Q,$Mg,$Dd=0){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($Mg)dump_csv(array_keys(fields($Q)));}else{if($Dd==2){$p=array();foreach(fields($Q)as$C=>$o)$p[]=idf_escape($C)." $o[full_type]";$j="CREATE TABLE ".table($Q)." (".implode(", ",$p).")";}else$j=create_sql($Q,$_POST["auto_increment"]);set_utf8mb4($j);if($Mg&&$j){if($Mg=="DROP+CREATE"||$Dd==1)echo"DROP ".($Dd==2?"VIEW":"TABLE")." IF EXISTS ".table($Q).";\n";if($Dd==1)$j=remove_definer($j);echo"$j;\n\n";}}}function
    54935506dumpData($Q,$Mg,$H){global$h,$w;$ge=($w=="sqlite"?0:1048576);if($Mg){if($_POST["format"]=="sql"){if($Mg=="TRUNCATE+INSERT")echo
    5494 truncate_sql($Q).";\n";$o=fields($Q);}$I=$h->query($H,1);if($I){$wd="";$Xa="";$Kd=array();$Og="";$Hc=($Q!=''?'fetch_assoc':'fetch_row');while($K=$I->$Hc()){if(!$Kd){$Th=array();foreach($K
    5495 as$X){$n=$I->fetch_field();$Kd[]=$n->name;$x=idf_escape($n->name);$Th[]="$x = VALUES($x)";}$Og=($Mg=="INSERT+UPDATE"?"\nON DUPLICATE KEY UPDATE ".implode(", ",$Th):"").";\n";}if($_POST["format"]!="sql"){if($Mg=="table"){dump_csv($Kd);$Mg="INSERT";}dump_csv($K);}else{if(!$wd)$wd="INSERT INTO ".table($Q)." (".implode(", ",array_map('idf_escape',$Kd)).") VALUES";foreach($K
    5496 as$x=>$X){$n=$o[$x];$K[$x]=($X!==null?unconvert_field($n,preg_match('~(^|[^o])int|float|double|decimal~',$n["type"])&&$X!=''?$X:q($X)):"NULL");}$mg=($ge?"\n":" ")."(".implode(",\t",$K).")";if(!$Xa)$Xa=$wd.$mg;elseif(strlen($Xa)+4+strlen($mg)+strlen($Og)<$ge)$Xa.=",$mg";else{echo$Xa.$Og;$Xa=$wd.$mg;}}}if($Xa)echo$Xa.$Og;}elseif($_POST["format"]=="sql")echo"-- ".str_replace("\n"," ",$h->error)."\n";}}function
     5507truncate_sql($Q).";\n";$p=fields($Q);}$I=$h->query($H,1);if($I){$wd="";$Xa="";$Kd=array();$Og="";$Gc=($Q!=''?'fetch_assoc':'fetch_row');while($K=$I->$Gc()){if(!$Kd){$Th=array();foreach($K
     5508as$X){$o=$I->fetch_field();$Kd[]=$o->name;$x=idf_escape($o->name);$Th[]="$x = VALUES($x)";}$Og=($Mg=="INSERT+UPDATE"?"\nON DUPLICATE KEY UPDATE ".implode(", ",$Th):"").";\n";}if($_POST["format"]!="sql"){if($Mg=="table"){dump_csv($Kd);$Mg="INSERT";}dump_csv($K);}else{if(!$wd)$wd="INSERT INTO ".table($Q)." (".implode(", ",array_map('idf_escape',$Kd)).") VALUES";foreach($K
     5509as$x=>$X){$o=$p[$x];$K[$x]=($X!==null?unconvert_field($o,preg_match('~(^|[^o])int|float|double|decimal~',$o["type"])&&$X!=''?$X:q($X)):"NULL");}$mg=($ge?"\n":" ")."(".implode(",\t",$K).")";if(!$Xa)$Xa=$wd.$mg;elseif(strlen($Xa)+4+strlen($mg)+strlen($Og)<$ge)$Xa.=",$mg";else{echo$Xa.$Og;$Xa=$wd.$mg;}}}if($Xa)echo$Xa.$Og;}elseif($_POST["format"]=="sql")echo"-- ".str_replace("\n"," ",$h->error)."\n";}}function
    54975510dumpFilename($kd){return
    54985511friendly_url($kd!=""?$kd:(SERVER!=""?SERVER:"localhost"));}function
    5499 dumpHeaders($kd,$ve=false){$hf=$_POST["output"];$Bc=(preg_match('~sql~',$_POST["format"])?"sql":($ve?"tar":"csv"));header("Content-Type: ".($hf=="gz"?"application/x-gzip":($Bc=="tar"?"application/x-tar":($Bc=="sql"||$hf!="file"?"text/plain":"text/csv")."; charset=utf-8")));if($hf=="gz")ob_start('ob_gzencode',1e6);return$Bc;}function
     5512dumpHeaders($kd,$ve=false){$hf=$_POST["output"];$Ac=(preg_match('~sql~',$_POST["format"])?"sql":($ve?"tar":"csv"));header("Content-Type: ".($hf=="gz"?"application/x-gzip":($Ac=="tar"?"application/x-tar":($Ac=="sql"||$hf!="file"?"text/plain":"text/csv")."; charset=utf-8")));if($hf=="gz")ob_start('ob_gzencode',1e6);return$Ac;}function
    55005513homepage(){echo'<p class="links">'.($_GET["ns"]==""&&support("database")?'<a href="'.h(ME).'database=">'.lang(59)."</a>\n":""),(support("scheme")?"<a href='".h(ME)."scheme='>".($_GET["ns"]!=""?lang(60):lang(61))."</a>\n":""),($_GET["ns"]!==""?'<a href="'.h(ME).'schema=">'.lang(62)."</a>\n":""),(support("privileges")?"<a href='".h(ME)."privileges='>".lang(63)."</a>\n":"");return
    55015514true;}function
    5502 navigation($ue){global$ia,$w,$Yb,$h;echo'<h1>
     5515navigation($ue){global$ia,$w,$Xb,$h;echo'<h1>
    55035516',$this->name(),' <span class="version">',$ia,'</span>
    55045517<a href="http://www.adminer.org/#download" target="_blank" id="version">',(version_compare($ia,$_COOKIE["adminer_version"])<0?h($_COOKIE["adminer_version"]):""),'</a>
    55055518</h1>
    5506 ';if($ue=="auth"){$Lc=true;foreach((array)$_SESSION["pwds"]as$Vh=>$zg){foreach($zg
     5519';if($ue=="auth"){$Kc=true;foreach((array)$_SESSION["pwds"]as$Vh=>$zg){foreach($zg
    55075520as$N=>$Qh){foreach($Qh
    5508 as$V=>$G){if($G!==null){if($Lc){echo"<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";$Lc=false;}$Kb=$_SESSION["db"][$Vh][$N][$V];foreach(($Kb?array_keys($Kb):array(""))as$l)echo"<a href='".h(auth_url($Vh,$N,$V,$l))."'>($Yb[$Vh]) ".h($V.($N!=""?"@$N":"").($l!=""?" - $l":""))."</a><br>\n";}}}}}else{if($_GET["ns"]!==""&&!$ue&&DB!=""){$h->select_db(DB);$S=table_status('',true);}if(support("sql")){echo'<script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=jush.js&amp;version=4.2.0",'"></script>
     5521as$V=>$G){if($G!==null){if($Kc){echo"<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";$Kc=false;}$Jb=$_SESSION["db"][$Vh][$N][$V];foreach(($Jb?array_keys($Jb):array(""))as$m)echo"<a href='".h(auth_url($Vh,$N,$V,$m))."'>($Xb[$Vh]) ".h($V.($N!=""?"@$N":"").($m!=""?" - $m":""))."</a><br>\n";}}}}}else{if($_GET["ns"]!==""&&!$ue&&DB!=""){$h->select_db(DB);$S=table_status('',true);}if(support("sql")){echo'<script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=jush.js&amp;version=4.2.1",'"></script>
    55095522<script type="text/javascript">
    55105523';if($S){$Zd=array();foreach($S
     
    55125525</script>
    55135526';}$this->databasesPrint($ue);if(DB==""||!$ue){echo"<p class='links'>".(support("sql")?"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])&&!isset($_GET["import"])).">".lang(55)."</a>\n<a href='".h(ME)."import='".bold(isset($_GET["import"])).">".lang(64)."</a>\n":"")."";if(support("dump"))echo"<a href='".h(ME)."dump=".urlencode(isset($_GET["table"])?$_GET["table"]:$_GET["select"])."' id='dump'".bold(isset($_GET["dump"])).">".lang(65)."</a>\n";}if($_GET["ns"]!==""&&!$ue&&DB!=""){echo'<a href="'.h(ME).'create="'.bold($_GET["create"]==="").">".lang(66)."</a>\n";if(!$S)echo"<p class='message'>".lang(9)."\n";else$this->tablesPrint($S);}}}function
    5514 databasesPrint($ue){global$b,$h;$k=$this->databases();echo'<form action="">
     5527databasesPrint($ue){global$b,$h;$l=$this->databases();echo'<form action="">
    55155528<p id="dbs">
    5516 ';hidden_fields_get();$Ib=" onmousedown='dbMouseDown(event, this);' onchange='dbChange(this);'";echo"<span title='".lang(67)."'>DB</span>: ".($k?"<select name='db'$Ib>".optionlist(array(""=>"")+$k,DB)."</select>":'<input name="db" value="'.h(DB).'" autocapitalize="off">'),"<input type='submit' value='".lang(20)."'".($k?" class='hidden'":"").">\n";if($ue!="db"&&DB!=""&&$h->select_db(DB)){if(support("scheme")){echo"<br>".lang(68).": <select name='ns'$Ib>".optionlist(array(""=>"")+$b->schemas(),$_GET["ns"])."</select>";if($_GET["ns"]!="")set_schema($_GET["ns"]);}}echo(isset($_GET["sql"])?'<input type="hidden" name="sql" value="">':(isset($_GET["schema"])?'<input type="hidden" name="schema" value="">':(isset($_GET["dump"])?'<input type="hidden" name="dump" value="">':(isset($_GET["privileges"])?'<input type="hidden" name="privileges" value="">':"")))),"</p></form>\n";}function
     5529';hidden_fields_get();$Hb=" onmousedown='dbMouseDown(event, this);' onchange='dbChange(this);'";echo"<span title='".lang(67)."'>DB</span>: ".($l?"<select name='db'$Hb>".optionlist(array(""=>"")+$l,DB)."</select>":'<input name="db" value="'.h(DB).'" autocapitalize="off">'),"<input type='submit' value='".lang(20)."'".($l?" class='hidden'":"").">\n";if($ue!="db"&&DB!=""&&$h->select_db(DB)){if(support("scheme")){echo"<br>".lang(68).": <select name='ns'$Hb>".optionlist(array(""=>"")+$b->schemas(),$_GET["ns"])."</select>";if($_GET["ns"]!="")set_schema($_GET["ns"]);}}echo(isset($_GET["sql"])?'<input type="hidden" name="sql" value="">':(isset($_GET["schema"])?'<input type="hidden" name="schema" value="">':(isset($_GET["dump"])?'<input type="hidden" name="dump" value="">':(isset($_GET["privileges"])?'<input type="hidden" name="privileges" value="">':"")))),"</p></form>\n";}function
    55175530tablesPrint($S){echo"<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";foreach($S
    55185531as$Q=>$Ig){echo'<a href="'.h(ME).'select='.urlencode($Q).'"'.bold($_GET["select"]==$Q||$_GET["edit"]==$Q,"select").">".lang(69)."</a> ";$C=$this->tableName($Ig);echo(support("table")||support("indexes")?'<a href="'.h(ME).'table='.urlencode($Q).'"'.bold(in_array($Q,array($_GET["table"],$_GET["create"],$_GET["indexes"],$_GET["foreign"],$_GET["trigger"])),(is_view($Ig)?"view":""),"structure")." title='".lang(39)."'>$C</a>":"<span>$C</span>")."<br>\n";}}}$b=(function_exists('adminer_object')?adminer_object():new
    55195532Adminer);if($b->operators===null)$b->operators=$Se;function
    5520 page_header($lh,$m="",$Wa=array(),$mh=""){global$ca,$ia,$b,$Yb,$w;page_headers();if(is_ajax()&&$m){page_messages($m);exit;}$nh=$lh.($mh!=""?": $mh":"");$oh=strip_tags($nh.(SERVER!=""&&SERVER!="localhost"?h(" - ".SERVER):"")." - ".$b->name());echo'<!DOCTYPE html>
     5533page_header($lh,$n="",$Wa=array(),$mh=""){global$ca,$ia,$b,$Xb,$w;page_headers();if(is_ajax()&&$n){page_messages($n);exit;}$nh=$lh.($mh!=""?": $mh":"");$oh=strip_tags($nh.(SERVER!=""&&SERVER!="localhost"?h(" - ".SERVER):"")." - ".$b->name());echo'<!DOCTYPE html>
    55215534<html lang="',$ca,'" dir="',lang(70),'">
    55225535<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    55235536<meta http-equiv="Content-Script-Type" content="text/javascript">
    55245537<meta name="robots" content="noindex">
    5525 <meta name="referrer" content="never">
     5538<meta name="referrer" content="origin-when-crossorigin">
    55265539<title>',$oh,'</title>
    5527 <link rel="stylesheet" type="text/css" href="',h(preg_replace("~\\?.*~","",ME))."?file=default.css&amp;version=4.2.0",'">
    5528 <script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=functions.js&amp;version=4.2.0",'"></script>
    5529 ';if($b->head()){echo'<link rel="shortcut icon" type="image/x-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&amp;version=4.2.0",'">
    5530 <link rel="apple-touch-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&amp;version=4.2.0",'">
     5540<link rel="stylesheet" type="text/css" href="',h(preg_replace("~\\?.*~","",ME))."?file=default.css&amp;version=4.2.1",'">
     5541<script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=functions.js&amp;version=4.2.1",'"></script>
     5542';if($b->head()){echo'<link rel="shortcut icon" type="image/x-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&amp;version=4.2.1",'">
     5543<link rel="apple-touch-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&amp;version=4.2.1",'">
    55315544';if(file_exists("adminer.css")){echo'<link rel="stylesheet" type="text/css" href="adminer.css">
    55325545';}}echo'
     
    55415554
    55425555<div id="content">
    5543 ';if($Wa!==null){$_=substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$Yb[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~\b(db|ns)=[^&]*&~','',ME),0,-1);$N=(SERVER!=""?h(SERVER):lang(32));if($Wa===false)echo"$N\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$N</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Wa)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Wa)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Wa
    5544 as$x=>$X){$Pb=(is_array($X)?$X[1]:h($X));if($Pb!="")echo"<a href='".h(ME."$x=").urlencode(is_array($X)?$X[0]:$X)."'>$Pb</a> &raquo; ";}}echo"$lh\n";}}echo"<h2>$nh</h2>\n","<div id='ajaxstatus' class='jsonly hidden'></div>\n";restart_session();page_messages($m);$k=&get_session("dbs");if(DB!=""&&$k&&!in_array(DB,$k,true))$k=null;stop_session();define("PAGE_HEADER",1);}function
     5556';if($Wa!==null){$_=substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$Xb[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~\b(db|ns)=[^&]*&~','',ME),0,-1);$N=(SERVER!=""?h(SERVER):lang(32));if($Wa===false)echo"$N\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$N</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Wa)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Wa)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Wa
     5557as$x=>$X){$Ob=(is_array($X)?$X[1]:h($X));if($Ob!="")echo"<a href='".h(ME."$x=").urlencode(is_array($X)?$X[0]:$X)."'>$Ob</a> &raquo; ";}}echo"$lh\n";}}echo"<h2>$nh</h2>\n","<div id='ajaxstatus' class='jsonly hidden'></div>\n";restart_session();page_messages($n);$l=&get_session("dbs");if(DB!=""&&$l&&!in_array(DB,$l,true))$l=null;stop_session();define("PAGE_HEADER",1);}function
    55455558page_headers(){global$b;header("Content-Type: text/html; charset=utf-8");header("Cache-Control: no-cache");if($b->headers()){header("X-Frame-Options: deny");header("X-XSS-Protection: 0");}}function
    5546 page_messages($m){$Kh=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$qe=$_SESSION["messages"][$Kh];if($qe){echo"<div class='message'>".implode("</div>\n<div class='message'>",$qe)."</div>\n";unset($_SESSION["messages"][$Kh]);}if($m)echo"<div class='error'>$m</div>\n";}function
     5559page_messages($n){$Kh=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$qe=$_SESSION["messages"][$Kh];if($qe){echo"<div class='message'>".implode("</div>\n<div class='message'>",$qe)."</div>\n";unset($_SESSION["messages"][$Kh]);}if($n)echo"<div class='error'>$n</div>\n";}function
    55475560page_footer($ue=""){global$b,$T;echo'</div>
    55485561
     
    55645577xxtea_mx($gi,$fi,$Pg,$Gd){return
    55655578int32((($gi>>5&0x7FFFFFF)^$fi<<2)+(($fi>>3&0x1FFFFFFF)^$gi<<4))^int32(($Pg^$fi)+($Gd^$gi));}function
    5566 encrypt_string($Kg,$x){if($Kg=="")return"";$x=array_values(unpack("V*",pack("H*",md5($x))));$W=str2long($Kg,true);$xe=count($W)-1;$gi=$W[$xe];$fi=$W[0];$Lf=floor(6+52/($xe+1));$Pg=0;while($Lf-->0){$Pg=int32($Pg+0x9E3779B9);$fc=$Pg>>2&3;for($if=0;$if<$xe;$if++){$fi=$W[$if+1];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$fc]);$gi=int32($W[$if]+$we);$W[$if]=$gi;}$fi=$W[0];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$fc]);$gi=int32($W[$xe]+$we);$W[$xe]=$gi;}return
     5579encrypt_string($Kg,$x){if($Kg=="")return"";$x=array_values(unpack("V*",pack("H*",md5($x))));$W=str2long($Kg,true);$xe=count($W)-1;$gi=$W[$xe];$fi=$W[0];$Lf=floor(6+52/($xe+1));$Pg=0;while($Lf-->0){$Pg=int32($Pg+0x9E3779B9);$ec=$Pg>>2&3;for($if=0;$if<$xe;$if++){$fi=$W[$if+1];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$ec]);$gi=int32($W[$if]+$we);$W[$if]=$gi;}$fi=$W[0];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$ec]);$gi=int32($W[$xe]+$we);$W[$xe]=$gi;}return
    55675580long2str($W,false);}function
    55685581decrypt_string($Kg,$x){if($Kg=="")return"";if(!$x)return
    5569 false;$x=array_values(unpack("V*",pack("H*",md5($x))));$W=str2long($Kg,false);$xe=count($W)-1;$gi=$W[$xe];$fi=$W[0];$Lf=floor(6+52/($xe+1));$Pg=int32($Lf*0x9E3779B9);while($Pg){$fc=$Pg>>2&3;for($if=$xe;$if>0;$if--){$gi=$W[$if-1];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$fc]);$fi=int32($W[$if]-$we);$W[$if]=$fi;}$gi=$W[$xe];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$fc]);$fi=int32($W[0]-$we);$W[0]=$fi;$Pg=int32($Pg-0x9E3779B9);}return
    5570 long2str($W,true);}$h='';$ed=$_SESSION["token"];if(!$ed)$_SESSION["token"]=rand(1,1e6);$T=get_token();$uf=array();if($_COOKIE["adminer_permanent"]){foreach(explode(" ",$_COOKIE["adminer_permanent"])as$X){list($x)=explode(":",$X);$uf[$x]=$X;}}function
    5571 add_invalid_login(){global$b;$Jc=get_temp_dir()."/adminer.invalid";$Tc=@fopen($Jc,"r+");if(!$Tc){$Tc=@fopen($Jc,"w");if(!$Tc)return;}flock($Tc,LOCK_EX);$zd=unserialize(stream_get_contents($Tc));$ih=time();if($zd){foreach($zd
    5572 as$_d=>$X){if($X[0]<$ih)unset($zd[$_d]);}}$yd=&$zd[$b->bruteForceKey()];if(!$yd)$yd=array($ih+30*60,0);$yd[1]++;$xg=serialize($zd);rewind($Tc);fwrite($Tc,$xg);ftruncate($Tc,strlen($xg));flock($Tc,LOCK_UN);fclose($Tc);}$Ka=$_POST["auth"];if($Ka){$zd=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$yd=$zd[$b->bruteForceKey()];$Ce=($yd[1]>30?$yd[0]-time():0);if($Ce>0)auth_error(lang(73,ceil($Ce/60)));session_regenerate_id();$Vh=$Ka["driver"];$N=$Ka["server"];$V=$Ka["username"];$G=(string)$Ka["password"];$l=$Ka["db"];set_password($Vh,$N,$V,$G);$_SESSION["db"][$Vh][$N][$V][$l]=true;if($Ka["permanent"]){$x=base64_encode($Vh)."-".base64_encode($N)."-".base64_encode($V)."-".base64_encode($l);$Ff=$b->permanentLogin(true);$uf[$x]="$x:".base64_encode($Ff?encrypt_string($G,$Ff):"");cookie("adminer_permanent",implode(" ",$uf));}if(count($_POST)==1||DRIVER!=$Vh||SERVER!=$N||$_GET["username"]!==$V||DB!=$l)redirect(auth_url($Vh,$N,$V,$l));}elseif($_POST["logout"]){if($ed&&!verify_token()){page_header(lang(72),lang(74));page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$x)set_session($x,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),lang(75));}}elseif($uf&&!$_SESSION["pwds"]){session_regenerate_id();$Ff=$b->permanentLogin();foreach($uf
    5573 as$x=>$X){list(,$hb)=explode(":",$X);list($Vh,$N,$V,$l)=array_map('base64_decode',explode("-",$x));set_password($Vh,$N,$V,decrypt_string(base64_decode($hb),$Ff));$_SESSION["db"][$Vh][$N][$V][$l]=true;}}function
     5582false;$x=array_values(unpack("V*",pack("H*",md5($x))));$W=str2long($Kg,false);$xe=count($W)-1;$gi=$W[$xe];$fi=$W[0];$Lf=floor(6+52/($xe+1));$Pg=int32($Lf*0x9E3779B9);while($Pg){$ec=$Pg>>2&3;for($if=$xe;$if>0;$if--){$gi=$W[$if-1];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$ec]);$fi=int32($W[$if]-$we);$W[$if]=$fi;}$gi=$W[$xe];$we=xxtea_mx($gi,$fi,$Pg,$x[$if&3^$ec]);$fi=int32($W[0]-$we);$W[0]=$fi;$Pg=int32($Pg-0x9E3779B9);}return
     5583long2str($W,true);}$h='';$dd=$_SESSION["token"];if(!$dd)$_SESSION["token"]=rand(1,1e6);$T=get_token();$uf=array();if($_COOKIE["adminer_permanent"]){foreach(explode(" ",$_COOKIE["adminer_permanent"])as$X){list($x)=explode(":",$X);$uf[$x]=$X;}}function
     5584add_invalid_login(){global$b;$Ic=get_temp_dir()."/adminer.invalid";$Sc=@fopen($Ic,"r+");if(!$Sc){$Sc=@fopen($Ic,"w");if(!$Sc)return;}flock($Sc,LOCK_EX);$zd=unserialize(stream_get_contents($Sc));$ih=time();if($zd){foreach($zd
     5585as$_d=>$X){if($X[0]<$ih)unset($zd[$_d]);}}$yd=&$zd[$b->bruteForceKey()];if(!$yd)$yd=array($ih+30*60,0);$yd[1]++;$xg=serialize($zd);rewind($Sc);fwrite($Sc,$xg);ftruncate($Sc,strlen($xg));flock($Sc,LOCK_UN);fclose($Sc);}$Ka=$_POST["auth"];if($Ka){$zd=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$yd=$zd[$b->bruteForceKey()];$Ce=($yd[1]>30?$yd[0]-time():0);if($Ce>0)auth_error(lang(73,ceil($Ce/60)));session_regenerate_id();$Vh=$Ka["driver"];$N=$Ka["server"];$V=$Ka["username"];$G=(string)$Ka["password"];$m=$Ka["db"];set_password($Vh,$N,$V,$G);$_SESSION["db"][$Vh][$N][$V][$m]=true;if($Ka["permanent"]){$x=base64_encode($Vh)."-".base64_encode($N)."-".base64_encode($V)."-".base64_encode($m);$Ff=$b->permanentLogin(true);$uf[$x]="$x:".base64_encode($Ff?encrypt_string($G,$Ff):"");cookie("adminer_permanent",implode(" ",$uf));}if(count($_POST)==1||DRIVER!=$Vh||SERVER!=$N||$_GET["username"]!==$V||DB!=$m)redirect(auth_url($Vh,$N,$V,$m));}elseif($_POST["logout"]){if($dd&&!verify_token()){page_header(lang(72),lang(74));page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$x)set_session($x,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),lang(75));}}elseif($uf&&!$_SESSION["pwds"]){session_regenerate_id();$Ff=$b->permanentLogin();foreach($uf
     5586as$x=>$X){list(,$hb)=explode(":",$X);list($Vh,$N,$V,$m)=array_map('base64_decode',explode("-",$x));set_password($Vh,$N,$V,decrypt_string(base64_decode($hb),$Ff));$_SESSION["db"][$Vh][$N][$V][$m]=true;}}function
    55745587unset_permanent(){global$uf;foreach($uf
    5575 as$x=>$X){list($Vh,$N,$V,$l)=array_map('base64_decode',explode("-",$x));if($Vh==DRIVER&&$N==SERVER&&$V==$_GET["username"]&&$l==DB)unset($uf[$x]);}cookie("adminer_permanent",implode(" ",$uf));}function
    5576 auth_error($m){global$b,$ed;$m=h($m);$_g=session_name();if(isset($_GET["username"])){header("HTTP/1.1 403 Forbidden");if(($_COOKIE[$_g]||$_GET[$_g])&&!$ed)$m=lang(76);else{add_invalid_login();$G=get_password();if($G!==null){if($G===false)$m.='<br>'.lang(77,'<code>permanentLogin()</code>');set_password(DRIVER,SERVER,$_GET["username"],null);}unset_permanent();}}if(!$_COOKIE[$_g]&&$_GET[$_g]&&ini_bool("session.use_only_cookies"))$m=lang(78);$F=session_get_cookie_params();cookie("adminer_key",($_COOKIE["adminer_key"]?$_COOKIE["adminer_key"]:rand_string()),$F["lifetime"]);page_header(lang(36),$m,null);echo"<form action='' method='post'>\n";$b->loginForm();echo"<div>";hidden_fields($_POST,array("auth"));echo"</div>\n","</form>\n";page_footer("auth");exit;}if(isset($_GET["username"])){if(!class_exists("Min_DB")){unset($_SESSION["pwds"][DRIVER]);unset_permanent();page_header(lang(79),lang(80,implode(", ",$_f)),false);page_footer("auth");exit;}$h=connect();}$Xb=new
    5577 Min_Driver($h);if(!is_object($h)||!$b->login($_GET["username"],get_password()))auth_error((is_string($h)?$h:lang(81)));if($Ka&&$_POST["token"])$_POST["token"]=$T;$m='';if($_POST){if(!verify_token()){$td="max_input_vars";$ke=ini_get($td);if(extension_loaded("suhosin")){foreach(array("suhosin.request.max_vars","suhosin.post.max_vars")as$x){$X=ini_get($x);if($X&&(!$ke||$X<$ke)){$td=$x;$ke=$X;}}}$m=(!$_POST["token"]&&$ke?lang(82,"'$td'"):lang(74).' '.lang(83));}}elseif($_SERVER["REQUEST_METHOD"]=="POST"){$m=lang(84,"'post_max_size'");if(isset($_GET["sql"]))$m.=' '.lang(85);}if(!ini_bool("session.use_cookies")||@ini_set("session.use_cookies",false)!==false)session_write_close();function
    5578 select($I,$i=null,$af=array(),$z=0){global$w;$Zd=array();$v=array();$f=array();$Ta=array();$Bh=array();$J=array();odd('');for($r=0;(!$z||$r<$z)&&($K=$I->fetch_row());$r++){if(!$r){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($Fd=0;$Fd<count($K);$Fd++){$n=$I->fetch_field();$C=$n->name;$Ze=$n->orgtable;$Ye=$n->orgname;$J[$n->table]=$Ze;if($af&&$w=="sql")$Zd[$Fd]=($C=="table"?"table=":($C=="possible_keys"?"indexes=":null));elseif($Ze!=""){if(!isset($v[$Ze])){$v[$Ze]=array();foreach(indexes($Ze,$i)as$u){if($u["type"]=="PRIMARY"){$v[$Ze]=array_flip($u["columns"]);break;}}$f[$Ze]=$v[$Ze];}if(isset($f[$Ze][$Ye])){unset($f[$Ze][$Ye]);$v[$Ze][$Ye]=$Fd;$Zd[$Fd]=$Ze;}}if($n->charsetnr==63)$Ta[$Fd]=true;$Bh[$Fd]=$n->type;echo"<th".($Ze!=""||$n->name!=$Ye?" title='".h(($Ze!=""?"$Ze.":"").$Ye)."'":"").">".h($C).($af?doc_link(array('sql'=>"explain-output.html#explain_".strtolower($C))):"");}echo"</thead>\n";}echo"<tr".odd().">";foreach($K
    5579 as$x=>$X){if($X===null)$X="<i>NULL</i>";elseif($Ta[$x]&&!is__utf8($X))$X="<i>".lang(43,strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($Bh[$x]==254)$X="<code>$X</code>";}if(isset($Zd[$x])&&!$f[$Zd[$x]]){if($af&&$w=="sql"){$Q=$K[array_search("table=",$Zd)];$_=$Zd[$x].urlencode($af[$Q]!=""?$af[$Q]:$Q);}else{$_="edit=".urlencode($Zd[$x]);foreach($v[$Zd[$x]]as$lb=>$Fd)$_.="&where".urlencode("[".bracket_escape($lb)."]")."=".urlencode($K[$Fd]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($r?"</table>":"<p class='message'>".lang(12))."\n";return$J;}function
    5580 referencable_primary($ug){$J=array();foreach(table_status('',true)as$Tg=>$Q){if($Tg!=$ug&&fk_support($Q)){foreach(fields($Tg)as$n){if($n["primary"]){if($J[$Tg]){unset($J[$Tg]);break;}$J[$Tg]=$n;}}}}return$J;}function
     5588as$x=>$X){list($Vh,$N,$V,$m)=array_map('base64_decode',explode("-",$x));if($Vh==DRIVER&&$N==SERVER&&$V==$_GET["username"]&&$m==DB)unset($uf[$x]);}cookie("adminer_permanent",implode(" ",$uf));}function
     5589auth_error($n){global$b,$dd;$n=h($n);$_g=session_name();if(isset($_GET["username"])){header("HTTP/1.1 403 Forbidden");if(($_COOKIE[$_g]||$_GET[$_g])&&!$dd)$n=lang(76);else{add_invalid_login();$G=get_password();if($G!==null){if($G===false)$n.='<br>'.lang(77,'<code>permanentLogin()</code>');set_password(DRIVER,SERVER,$_GET["username"],null);}unset_permanent();}}if(!$_COOKIE[$_g]&&$_GET[$_g]&&ini_bool("session.use_only_cookies"))$n=lang(78);$F=session_get_cookie_params();cookie("adminer_key",($_COOKIE["adminer_key"]?$_COOKIE["adminer_key"]:rand_string()),$F["lifetime"]);page_header(lang(36),$n,null);echo"<form action='' method='post'>\n";$b->loginForm();echo"<div>";hidden_fields($_POST,array("auth"));echo"</div>\n","</form>\n";page_footer("auth");exit;}if(isset($_GET["username"])){if(!class_exists("Min_DB")){unset($_SESSION["pwds"][DRIVER]);unset_permanent();page_header(lang(79),lang(80,implode(", ",$_f)),false);page_footer("auth");exit;}$h=connect();}$Wb=new
     5590Min_Driver($h);if(!is_object($h)||!$b->login($_GET["username"],get_password()))auth_error((is_string($h)?$h:lang(81)));if($Ka&&$_POST["token"])$_POST["token"]=$T;$n='';if($_POST){if(!verify_token()){$td="max_input_vars";$ke=ini_get($td);if(extension_loaded("suhosin")){foreach(array("suhosin.request.max_vars","suhosin.post.max_vars")as$x){$X=ini_get($x);if($X&&(!$ke||$X<$ke)){$td=$x;$ke=$X;}}}$n=(!$_POST["token"]&&$ke?lang(82,"'$td'"):lang(74).' '.lang(83));}}elseif($_SERVER["REQUEST_METHOD"]=="POST"){$n=lang(84,"'post_max_size'");if(isset($_GET["sql"]))$n.=' '.lang(85);}if(!ini_bool("session.use_cookies")||@ini_set("session.use_cookies",false)!==false)session_write_close();function
     5591select($I,$i=null,$af=array(),$z=0){global$w;$Zd=array();$v=array();$f=array();$Ta=array();$Bh=array();$J=array();odd('');for($s=0;(!$z||$s<$z)&&($K=$I->fetch_row());$s++){if(!$s){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($Fd=0;$Fd<count($K);$Fd++){$o=$I->fetch_field();$C=$o->name;$Ze=$o->orgtable;$Ye=$o->orgname;$J[$o->table]=$Ze;if($af&&$w=="sql")$Zd[$Fd]=($C=="table"?"table=":($C=="possible_keys"?"indexes=":null));elseif($Ze!=""){if(!isset($v[$Ze])){$v[$Ze]=array();foreach(indexes($Ze,$i)as$u){if($u["type"]=="PRIMARY"){$v[$Ze]=array_flip($u["columns"]);break;}}$f[$Ze]=$v[$Ze];}if(isset($f[$Ze][$Ye])){unset($f[$Ze][$Ye]);$v[$Ze][$Ye]=$Fd;$Zd[$Fd]=$Ze;}}if($o->charsetnr==63)$Ta[$Fd]=true;$Bh[$Fd]=$o->type;echo"<th".($Ze!=""||$o->name!=$Ye?" title='".h(($Ze!=""?"$Ze.":"").$Ye)."'":"").">".h($C).($af?doc_link(array('sql'=>"explain-output.html#explain_".strtolower($C))):"");}echo"</thead>\n";}echo"<tr".odd().">";foreach($K
     5592as$x=>$X){if($X===null)$X="<i>NULL</i>";elseif($Ta[$x]&&!is__utf8($X))$X="<i>".lang(43,strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($Bh[$x]==254)$X="<code>$X</code>";}if(isset($Zd[$x])&&!$f[$Zd[$x]]){if($af&&$w=="sql"){$Q=$K[array_search("table=",$Zd)];$_=$Zd[$x].urlencode($af[$Q]!=""?$af[$Q]:$Q);}else{$_="edit=".urlencode($Zd[$x]);foreach($v[$Zd[$x]]as$lb=>$Fd)$_.="&where".urlencode("[".bracket_escape($lb)."]")."=".urlencode($K[$Fd]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>":"<p class='message'>".lang(12))."\n";return$J;}function
     5593referencable_primary($ug){$J=array();foreach(table_status('',true)as$Tg=>$Q){if($Tg!=$ug&&fk_support($Q)){foreach(fields($Tg)as$o){if($o["primary"]){if($J[$Tg]){unset($J[$Tg]);break;}$J[$Tg]=$o;}}}}return$J;}function
    55815594textarea($C,$Y,$L=10,$ob=80){global$w;echo"<textarea name='$C' rows='$L' cols='$ob' class='sqlarea jush-$w' spellcheck='false' wrap='off'>";if(is_array($Y)){foreach($Y
    55825595as$X)echo
     
    55845597echo
    55855598h($Y);echo"</textarea>";}function
    5586 edit_type($x,$n,$nb,$Pc=array()){global$Lg,$Bh,$Ih,$Ne;$U=$n["type"];echo'<td><select name="',$x,'[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"',on_help("getTarget(event).value",1),'>';if($U&&!isset($Bh[$U])&&!isset($Pc[$U]))array_unshift($Lg,$U);if($Pc)$Lg[lang(86)]=$Pc;echo
     5599edit_type($x,$o,$nb,$Oc=array()){global$Lg,$Bh,$Ih,$Ne;$U=$o["type"];echo'<td><select name="',$x,'[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"',on_help("getTarget(event).value",1),'>';if($U&&!isset($Bh[$U])&&!isset($Oc[$U]))array_unshift($Lg,$U);if($Oc)$Lg[lang(86)]=$Oc;echo
    55875600optionlist($Lg,$U),'</select>
    5588 <td><input name="',$x,'[length]" value="',h($n["length"]),'" size="3" onfocus="editingLengthFocus(this);"',(!$n["length"]&&preg_match('~var(char|binary)$~',$U)?" class='required'":""),' onchange="editingLengthChange(this);" onkeyup="this.onchange();"><td class="options">';echo"<select name='$x"."[collation]'".(preg_match('~(char|text|enum|set)$~',$U)?"":" class='hidden'").'><option value="">('.lang(87).')'.optionlist($nb,$n["collation"]).'</select>',($Ih?"<select name='$x"."[unsigned]'".(!$U||preg_match('~((^|[^o])int|float|double|decimal)$~',$U)?"":" class='hidden'").'><option>'.optionlist($Ih,$n["unsigned"]).'</select>':''),(isset($n['on_update'])?"<select name='$x"."[on_update]'".(preg_match('~timestamp|datetime~',$U)?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(88).")","CURRENT_TIMESTAMP"),$n["on_update"]).'</select>':''),($Pc?"<select name='$x"."[on_delete]'".(preg_match("~`~",$U)?"":" class='hidden'")."><option value=''>(".lang(89).")".optionlist(explode("|",$Ne),$n["on_delete"])."</select> ":" ");}function
    5589 process_length($y){global$qc;return(preg_match("~^\\s*\\(?\\s*$qc(?:\\s*,\\s*$qc)*+\\s*\\)?\\s*\$~",$y)&&preg_match_all("~$qc~",$y,$ee)?"(".implode(",",$ee[0]).")":preg_replace('~^[0-9].*~','(\0)',preg_replace('~[^-0-9,+()[\]]~','',$y)));}function
    5590 process_type($n,$mb="COLLATE"){global$Ih;return" $n[type]".process_length($n["length"]).(preg_match('~(^|[^o])int|float|double|decimal~',$n["type"])&&in_array($n["unsigned"],$Ih)?" $n[unsigned]":"").(preg_match('~char|text|enum|set~',$n["type"])&&$n["collation"]?" $mb ".q($n["collation"]):"");}function
    5591 process_field($n,$_h){global$w;$Mb=$n["default"];return
    5592 array(idf_escape(trim($n["field"])),process_type($_h),($n["null"]?" NULL":" NOT NULL"),(isset($Mb)?" DEFAULT ".((preg_match('~time~',$n["type"])&&preg_match('~^CURRENT_TIMESTAMP$~i',$Mb))||($w=="sqlite"&&preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i',$Mb))||($n["type"]=="bit"&&preg_match("~^([0-9]+|b'[0-1]+')\$~",$Mb))||($w=="pgsql"&&preg_match("~^[a-z]+\\(('[^']*')+\\)\$~",$Mb))?$Mb:q($Mb)):""),(preg_match('~timestamp|datetime~',$n["type"])&&$n["on_update"]?" ON UPDATE $n[on_update]":""),(support("comment")&&$n["comment"]!=""?" COMMENT ".q($n["comment"]):""),($n["auto_increment"]?auto_increment():null),);}function
     5601<td><input name="',$x,'[length]" value="',h($o["length"]),'" size="3" onfocus="editingLengthFocus(this);"',(!$o["length"]&&preg_match('~var(char|binary)$~',$U)?" class='required'":""),' onchange="editingLengthChange(this);" onkeyup="this.onchange();"><td class="options">';echo"<select name='$x"."[collation]'".(preg_match('~(char|text|enum|set)$~',$U)?"":" class='hidden'").'><option value="">('.lang(87).')'.optionlist($nb,$o["collation"]).'</select>',($Ih?"<select name='$x"."[unsigned]'".(!$U||preg_match('~((^|[^o])int|float|double|decimal)$~',$U)?"":" class='hidden'").'><option>'.optionlist($Ih,$o["unsigned"]).'</select>':''),(isset($o['on_update'])?"<select name='$x"."[on_update]'".(preg_match('~timestamp|datetime~',$U)?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(88).")","CURRENT_TIMESTAMP"),$o["on_update"]).'</select>':''),($Oc?"<select name='$x"."[on_delete]'".(preg_match("~`~",$U)?"":" class='hidden'")."><option value=''>(".lang(89).")".optionlist(explode("|",$Ne),$o["on_delete"])."</select> ":" ");}function
     5602process_length($y){global$pc;return(preg_match("~^\\s*\\(?\\s*$pc(?:\\s*,\\s*$pc)*+\\s*\\)?\\s*\$~",$y)&&preg_match_all("~$pc~",$y,$ee)?"(".implode(",",$ee[0]).")":preg_replace('~^[0-9].*~','(\0)',preg_replace('~[^-0-9,+()[\]]~','',$y)));}function
     5603process_type($o,$mb="COLLATE"){global$Ih;return" $o[type]".process_length($o["length"]).(preg_match('~(^|[^o])int|float|double|decimal~',$o["type"])&&in_array($o["unsigned"],$Ih)?" $o[unsigned]":"").(preg_match('~char|text|enum|set~',$o["type"])&&$o["collation"]?" $mb ".q($o["collation"]):"");}function
     5604process_field($o,$_h){global$w;$Lb=$o["default"];return
     5605array(idf_escape(trim($o["field"])),process_type($_h),($o["null"]?" NULL":" NOT NULL"),(isset($Lb)?" DEFAULT ".((preg_match('~time~',$o["type"])&&preg_match('~^CURRENT_TIMESTAMP$~i',$Lb))||($w=="sqlite"&&preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i',$Lb))||($o["type"]=="bit"&&preg_match("~^([0-9]+|b'[0-1]+')\$~",$Lb))||($w=="pgsql"&&preg_match("~^[a-z]+\\(('[^']*')+\\)\$~",$Lb))?$Lb:q($Lb)):""),(preg_match('~timestamp|datetime~',$o["type"])&&$o["on_update"]?" ON UPDATE $o[on_update]":""),(support("comment")&&$o["comment"]!=""?" COMMENT ".q($o["comment"]):""),($o["auto_increment"]?auto_increment():null),);}function
    55935606type_class($U){foreach(array('char'=>'text','date'=>'time|year','binary'=>'blob','enum'=>'set',)as$x=>$X){if(preg_match("~$x|$X~",$U))return" class='$x'";}}function
    5594 edit_fields($o,$nb,$U="TABLE",$Pc=array(),$sb=false){global$h,$ud;echo'<thead><tr class="wrap">
     5607edit_fields($p,$nb,$U="TABLE",$Oc=array(),$sb=false){global$h,$ud;echo'<thead><tr class="wrap">
    55955608';if($U=="PROCEDURE"){echo'<td>&nbsp;';}echo'<th>',($U=="TABLE"?lang(90):lang(91)),'<td>',lang(92),'<textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea>
    55965609<td>',lang(93),'<td>',lang(94);if($U=="TABLE"){echo'<td>NULL
    5597 <td><input type="radio" name="auto_increment_col" value=""><acronym title="',lang(56),'">AI</acronym>',doc_link(array('sql'=>"example-auto-increment.html",'sqlite'=>"autoinc.html",'pgsql'=>"datatype.html#DATATYPE-SERIAL",'mssql'=>"ms186775.aspx",)),'<td>',lang(95),(support("comment")?"<td".($sb?"":" class='hidden'").">".lang(96):"");}echo'<td>',"<input type='image' class='icon' name='add[".(support("move_col")?0:count($o))."]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.0' alt='+' title='".lang(97)."'>",'<script type="text/javascript">row_count = ',count($o),';</script>
     5610<td><input type="radio" name="auto_increment_col" value=""><acronym title="',lang(56),'">AI</acronym>',doc_link(array('sql'=>"example-auto-increment.html",'sqlite'=>"autoinc.html",'pgsql'=>"datatype.html#DATATYPE-SERIAL",'mssql'=>"ms186775.aspx",)),'<td>',lang(95),(support("comment")?"<td".($sb?"":" class='hidden'").">".lang(96):"");}echo'<td>',"<input type='image' class='icon' name='add[".(support("move_col")?0:count($p))."]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.1' alt='+' title='".lang(97)."'>",'<script type="text/javascript">row_count = ',count($p),';</script>
    55985611</thead>
    55995612<tbody onkeydown="return editingKeydown(event);">
    5600 ';foreach($o
    5601 as$r=>$n){$r++;$bf=$n[($_POST?"orig":"field")];$Tb=(isset($_POST["add"][$r-1])||(isset($n["field"])&&!$_POST["drop_col"][$r]))&&(support("drop_col")||$bf=="");echo'<tr',($Tb?"":" style='display: none;'"),'>
    5602 ',($U=="PROCEDURE"?"<td>".html_select("fields[$r][inout]",explode("|",$ud),$n["inout"]):""),'<th>';if($Tb){echo'<input name="fields[',$r,'][field]" value="',h($n["field"]),'" onchange="editingNameChange(this);',($n["field"]!=""||count($o)>1?'':' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'),'" maxlength="64" autocapitalize="off">';}echo'<input type="hidden" name="fields[',$r,'][orig]" value="',h($bf),'">
    5603 ';edit_type("fields[$r]",$n,$nb,$Pc);if($U=="TABLE"){echo'<td>',checkbox("fields[$r][null]",1,$n["null"],"","","block"),'<td><label class="block"><input type="radio" name="auto_increment_col" value="',$r,'"';if($n["auto_increment"]){echo' checked';}?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php
     5613';foreach($p
     5614as$s=>$o){$s++;$bf=$o[($_POST?"orig":"field")];$Sb=(isset($_POST["add"][$s-1])||(isset($o["field"])&&!$_POST["drop_col"][$s]))&&(support("drop_col")||$bf=="");echo'<tr',($Sb?"":" style='display: none;'"),'>
     5615',($U=="PROCEDURE"?"<td>".html_select("fields[$s][inout]",explode("|",$ud),$o["inout"]):""),'<th>';if($Sb){echo'<input name="fields[',$s,'][field]" value="',h($o["field"]),'" onchange="editingNameChange(this);',($o["field"]!=""||count($p)>1?'':' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'),'" maxlength="64" autocapitalize="off">';}echo'<input type="hidden" name="fields[',$s,'][orig]" value="',h($bf),'">
     5616';edit_type("fields[$s]",$o,$nb,$Oc);if($U=="TABLE"){echo'<td>',checkbox("fields[$s][null]",1,$o["null"],"","","block"),'<td><label class="block"><input type="radio" name="auto_increment_col" value="',$s,'"';if($o["auto_increment"]){echo' checked';}?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php
    56045617echo
    5605 checkbox("fields[$r][has_default]",1,$n["has_default"]),'<input name="fields[',$r,'][default]" value="',h($n["default"]),'" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
    5606 ',(support("comment")?"<td".($sb?"":" class='hidden'")."><input name='fields[$r][comment]' value='".h($n["comment"])."' maxlength='".($h->server_info>=5.5?1024:255)."'>":"");}echo"<td>",(support("move_col")?"<input type='image' class='icon' name='add[$r]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.0' alt='+' title='".lang(97)."' onclick='return !editingAddRow(this, 1);'>&nbsp;"."<input type='image' class='icon' name='up[$r]' src='".h(preg_replace("~\\?.*~","",ME))."?file=up.gif&amp;version=4.2.0' alt='^' title='".lang(98)."'>&nbsp;"."<input type='image' class='icon' name='down[$r]' src='".h(preg_replace("~\\?.*~","",ME))."?file=down.gif&amp;version=4.2.0' alt='v' title='".lang(99)."'>&nbsp;":""),($bf==""||support("drop_col")?"<input type='image' class='icon' name='drop_col[$r]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&amp;version=4.2.0' alt='x' title='".lang(100)."' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">":""),"\n";}}function
    5607 process_fields(&$o){ksort($o);$D=0;if($_POST["up"]){$Qd=0;foreach($o
    5608 as$x=>$n){if(key($_POST["up"])==$x){unset($o[$x]);array_splice($o,$Qd,0,array($n));break;}if(isset($n["field"]))$Qd=$D;$D++;}}elseif($_POST["down"]){$Rc=false;foreach($o
    5609 as$x=>$n){if(isset($n["field"])&&$Rc){unset($o[key($_POST["down"])]);array_splice($o,$D,0,array($Rc));break;}if(key($_POST["down"])==$x)$Rc=$n;$D++;}}elseif($_POST["add"]){$o=array_values($o);array_splice($o,key($_POST["add"]),0,array(array()));}elseif(!$_POST["drop_col"])return
     5618checkbox("fields[$s][has_default]",1,$o["has_default"]),'<input name="fields[',$s,'][default]" value="',h($o["default"]),'" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
     5619',(support("comment")?"<td".($sb?"":" class='hidden'")."><input name='fields[$s][comment]' value='".h($o["comment"])."' maxlength='".($h->server_info>=5.5?1024:255)."'>":"");}echo"<td>",(support("move_col")?"<input type='image' class='icon' name='add[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.1' alt='+' title='".lang(97)."' onclick='return !editingAddRow(this, 1);'>&nbsp;"."<input type='image' class='icon' name='up[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=up.gif&amp;version=4.2.1' alt='^' title='".lang(98)."'>&nbsp;"."<input type='image' class='icon' name='down[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=down.gif&amp;version=4.2.1' alt='v' title='".lang(99)."'>&nbsp;":""),($bf==""||support("drop_col")?"<input type='image' class='icon' name='drop_col[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&amp;version=4.2.1' alt='x' title='".lang(100)."' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">":""),"\n";}}function
     5620process_fields(&$p){ksort($p);$D=0;if($_POST["up"]){$Qd=0;foreach($p
     5621as$x=>$o){if(key($_POST["up"])==$x){unset($p[$x]);array_splice($p,$Qd,0,array($o));break;}if(isset($o["field"]))$Qd=$D;$D++;}}elseif($_POST["down"]){$Qc=false;foreach($p
     5622as$x=>$o){if(isset($o["field"])&&$Qc){unset($p[key($_POST["down"])]);array_splice($p,$D,0,array($Qc));break;}if(key($_POST["down"])==$x)$Qc=$o;$D++;}}elseif($_POST["add"]){$p=array_values($p);array_splice($p,key($_POST["add"]),0,array(array()));}elseif(!$_POST["drop_col"])return
    56105623false;return
    56115624true;}function
    56125625normalize_enum($B){return"'".str_replace("'","''",addcslashes(stripcslashes(str_replace($B[0][0].$B[0][0],$B[0][0],substr($B[0],1,-1))),'\\'))."'";}function
    5613 grant($Wc,$Hf,$f,$Me){if(!$Hf)return
    5614 true;if($Hf==array("ALL PRIVILEGES","GRANT OPTION"))return($Wc=="GRANT"?queries("$Wc ALL PRIVILEGES$Me WITH GRANT OPTION"):queries("$Wc ALL PRIVILEGES$Me")&&queries("$Wc GRANT OPTION$Me"));return
    5615 queries("$Wc ".preg_replace('~(GRANT OPTION)\\([^)]*\\)~','\\1',implode("$f, ",$Hf).$f).$Me);}function
    5616 drop_create($Zb,$Bb,$ac,$fh,$cc,$A,$pe,$ne,$oe,$Je,$_e){if($_POST["drop"])query_redirect($Zb,$A,$pe);elseif($Je=="")query_redirect($Bb,$A,$oe);elseif($Je!=$_e){$Db=queries($Bb);queries_redirect($A,$ne,$Db&&queries($Zb));if($Db)queries($ac);}else
    5617 queries_redirect($A,$ne,queries($fh)&&queries($cc)&&queries($Zb)&&queries($Bb));}function
     5626grant($Vc,$Hf,$f,$Me){if(!$Hf)return
     5627true;if($Hf==array("ALL PRIVILEGES","GRANT OPTION"))return($Vc=="GRANT"?queries("$Vc ALL PRIVILEGES$Me WITH GRANT OPTION"):queries("$Vc ALL PRIVILEGES$Me")&&queries("$Vc GRANT OPTION$Me"));return
     5628queries("$Vc ".preg_replace('~(GRANT OPTION)\\([^)]*\\)~','\\1',implode("$f, ",$Hf).$f).$Me);}function
     5629drop_create($Yb,$j,$Zb,$fh,$bc,$A,$pe,$ne,$oe,$Je,$_e){if($_POST["drop"])query_redirect($Yb,$A,$pe);elseif($Je=="")query_redirect($j,$A,$oe);elseif($Je!=$_e){$Cb=queries($j);queries_redirect($A,$ne,$Cb&&queries($Yb));if($Cb)queries($Zb);}else
     5630queries_redirect($A,$ne,queries($fh)&&queries($bc)&&queries($Yb)&&queries($j));}function
    56185631create_trigger($Me,$K){global$w;$kh=" $K[Timing] $K[Event]".($K["Event"]=="UPDATE OF"?" ".idf_escape($K["Of"]):"");return"CREATE TRIGGER ".idf_escape($K["Trigger"]).($w=="mssql"?$Me.$kh:$kh.$Me).rtrim(" $K[Type]\n$K[Statement]",";").";";}function
    5619 create_routine($ig,$K){global$ud;$O=array();$o=(array)$K["fields"];ksort($o);foreach($o
    5620 as$n){if($n["field"]!="")$O[]=(preg_match("~^($ud)\$~",$n["inout"])?"$n[inout] ":"").idf_escape($n["field"]).process_type($n,"CHARACTER SET");}return"CREATE $ig ".idf_escape(trim($K["name"]))." (".implode(", ",$O).")".(isset($_GET["function"])?" RETURNS".process_type($K["returns"],"CHARACTER SET"):"").($K["language"]?" LANGUAGE $K[language]":"").rtrim("\n$K[definition]",";").";";}function
     5632create_routine($ig,$K){global$ud;$O=array();$p=(array)$K["fields"];ksort($p);foreach($p
     5633as$o){if($o["field"]!="")$O[]=(preg_match("~^($ud)\$~",$o["inout"])?"$o[inout] ":"").idf_escape($o["field"]).process_type($o,"CHARACTER SET");}return"CREATE $ig ".idf_escape(trim($K["name"]))." (".implode(", ",$O).")".(isset($_GET["function"])?" RETURNS".process_type($K["returns"],"CHARACTER SET"):"").($K["language"]?" LANGUAGE $K[language]":"").rtrim("\n$K[definition]",";").";";}function
    56215634remove_definer($H){return
    56225635preg_replace('~^([A-Z =]+) DEFINER=`'.preg_replace('~@(.*)~','`@`(%|\\1)',logged_user()).'`~','\\1',$H);}function
    5623 format_foreign_key($p){global$Ne;return" FOREIGN KEY (".implode(", ",array_map('idf_escape',$p["source"])).") REFERENCES ".table($p["table"])." (".implode(", ",array_map('idf_escape',$p["target"])).")".(preg_match("~^($Ne)\$~",$p["on_delete"])?" ON DELETE $p[on_delete]":"").(preg_match("~^($Ne)\$~",$p["on_update"])?" ON UPDATE $p[on_update]":"");}function
    5624 tar_file($Jc,$ph){$J=pack("a100a8a8a8a12a12",$Jc,644,0,0,decoct($ph->size),decoct(time()));$fb=8*32;for($r=0;$r<strlen($J);$r++)$fb+=ord($J[$r]);$J.=sprintf("%06o",$fb)."\0 ";echo$J,str_repeat("\0",512-strlen($J));$ph->send();echo
     5636format_foreign_key($q){global$Ne;return" FOREIGN KEY (".implode(", ",array_map('idf_escape',$q["source"])).") REFERENCES ".table($q["table"])." (".implode(", ",array_map('idf_escape',$q["target"])).")".(preg_match("~^($Ne)\$~",$q["on_delete"])?" ON DELETE $q[on_delete]":"").(preg_match("~^($Ne)\$~",$q["on_update"])?" ON UPDATE $q[on_update]":"");}function
     5637tar_file($Ic,$ph){$J=pack("a100a8a8a8a12a12",$Ic,644,0,0,decoct($ph->size),decoct(time()));$fb=8*32;for($s=0;$s<strlen($J);$s++)$fb+=ord($J[$s]);$J.=sprintf("%06o",$fb)."\0 ";echo$J,str_repeat("\0",512-strlen($J));$ph->send();echo
    56255638str_repeat("\0",511-($ph->size+511)%512);}function
    56265639ini_bytes($td){$X=ini_get($td);switch(strtolower(substr($X,-1))){case'g':$X*=1024;case'm':$X*=1024;case'k':$X*=1024;}return$X;}function
     
    56285641ob_gzencode($P){return
    56295642gzencode($P);}function
    5630 db_size($l){global$h;if(!$h->select_db($l))return"?";$J=0;foreach(table_status()as$R)$J+=$R["Data_length"]+$R["Index_length"];return
     5643db_size($m){global$h;if(!$h->select_db($m))return"?";$J=0;foreach(table_status()as$R)$J+=$R["Data_length"]+$R["Index_length"];return
    56315644format_number($J);}function
    5632 connect_error(){global$b,$h,$T,$m,$Yb;if(DB!=""){header("HTTP/1.1 404 Not Found");page_header(lang(35).": ".h(DB),lang(101),true);}else{if($_POST["db"]&&!$m)queries_redirect(substr(ME,0,-1),lang(102),drop_databases($_POST["db"]));page_header(lang(103),$m,false);echo"<p class='links'>\n";foreach(array('database'=>lang(104),'privileges'=>lang(63),'processlist'=>lang(105),'variables'=>lang(106),'status'=>lang(107),)as$x=>$X){if(support($x))echo"<a href='".h(ME)."$x='>$X</a>\n";}echo"<p>".lang(108,$Yb[DRIVER],"<b>".h($h->server_info)."</b>","<b>$h->extension</b>")."\n","<p>".lang(109,"<b>".h(logged_user())."</b>")."\n";$k=$b->databases();if($k){$pg=support("scheme");$nb=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n","<thead><tr>".(support("database")?"<td>&nbsp;":"")."<th>".lang(35)." - <a href='".h(ME)."refresh=1'>".lang(110)."</a>"."<td>".lang(111)."<td>".lang(112)."<td>".lang(113)." - <a href='".h(ME)."dbsize=1' onclick=\"return !ajaxSetHtml('".js_escape(ME)."script=connect');\">".lang(114)."</a>"."</thead>\n";$k=($_GET["dbsize"]?count_tables($k):array_flip($k));foreach($k
    5633 as$l=>$S){$hg=h(ME)."db=".urlencode($l);echo"<tr".odd().">".(support("database")?"<td>".checkbox("db[]",$l,in_array($l,(array)$_POST["db"])):""),"<th><a href='$hg'>".h($l)."</a>";$d=nbsp(db_collation($l,$nb));echo"<td>".(support("database")?"<a href='$hg".($pg?"&amp;ns=":"")."&amp;database=' title='".lang(59)."'>$d</a>":$d),"<td align='right'><a href='$hg&amp;schema=' id='tables-".h($l)."' title='".lang(62)."'>".($_GET["dbsize"]?$S:"?")."</a>","<td align='right' id='size-".h($l)."'>".($_GET["dbsize"]?db_size($l):"?"),"\n";}echo"</table>\n",(support("database")?"<fieldset><legend>".lang(115)." <span id='selected'></span></legend><div>\n"."<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n"."<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n"."</div></fieldset>\n":""),"<script type='text/javascript'>tableCheck();</script>\n","<input type='hidden' name='token' value='$T'>\n","</form>\n";}}page_footer("db");}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(isset($_GET["import"]))$_GET["sql"]=$_GET["import"];if(!(DB!=""?$h->select_db(DB):isset($_GET["sql"])||isset($_GET["dump"])||isset($_GET["database"])||isset($_GET["processlist"])||isset($_GET["privileges"])||isset($_GET["user"])||isset($_GET["variables"])||$_GET["script"]=="connect"||$_GET["script"]=="kill")){if(DB!=""||$_GET["refresh"]){restart_session();set_session("dbs",null);}connect_error();exit;}if(support("scheme")&&DB!=""&&$_GET["ns"]!==""){if(!isset($_GET["ns"]))redirect(preg_replace('~ns=[^&]*&~','',ME)."ns=".get_schema());if(!set_schema($_GET["ns"])){header("HTTP/1.1 404 Not Found");page_header(lang(68).": ".h($_GET["ns"]),lang(117),true);page_footer("ns");exit;}}$Ne="RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT";class
     5645set_utf8mb4($j){global$h;static$O=false;if(!$O&&preg_match('~\butf8mb4~i',$j)){$O=true;echo"SET NAMES ".charset($h).";\n\n";}}function
     5646connect_error(){global$b,$h,$T,$n,$Xb;if(DB!=""){header("HTTP/1.1 404 Not Found");page_header(lang(35).": ".h(DB),lang(101),true);}else{if($_POST["db"]&&!$n)queries_redirect(substr(ME,0,-1),lang(102),drop_databases($_POST["db"]));page_header(lang(103),$n,false);echo"<p class='links'>\n";foreach(array('database'=>lang(104),'privileges'=>lang(63),'processlist'=>lang(105),'variables'=>lang(106),'status'=>lang(107),)as$x=>$X){if(support($x))echo"<a href='".h(ME)."$x='>$X</a>\n";}echo"<p>".lang(108,$Xb[DRIVER],"<b>".h($h->server_info)."</b>","<b>$h->extension</b>")."\n","<p>".lang(109,"<b>".h(logged_user())."</b>")."\n";$l=$b->databases();if($l){$pg=support("scheme");$nb=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n","<thead><tr>".(support("database")?"<td>&nbsp;":"")."<th>".lang(35)." - <a href='".h(ME)."refresh=1'>".lang(110)."</a>"."<td>".lang(111)."<td>".lang(112)."<td>".lang(113)." - <a href='".h(ME)."dbsize=1' onclick=\"return !ajaxSetHtml('".js_escape(ME)."script=connect');\">".lang(114)."</a>"."</thead>\n";$l=($_GET["dbsize"]?count_tables($l):array_flip($l));foreach($l
     5647as$m=>$S){$hg=h(ME)."db=".urlencode($m);echo"<tr".odd().">".(support("database")?"<td>".checkbox("db[]",$m,in_array($m,(array)$_POST["db"])):""),"<th><a href='$hg'>".h($m)."</a>";$d=nbsp(db_collation($m,$nb));echo"<td>".(support("database")?"<a href='$hg".($pg?"&amp;ns=":"")."&amp;database=' title='".lang(59)."'>$d</a>":$d),"<td align='right'><a href='$hg&amp;schema=' id='tables-".h($m)."' title='".lang(62)."'>".($_GET["dbsize"]?$S:"?")."</a>","<td align='right' id='size-".h($m)."'>".($_GET["dbsize"]?db_size($m):"?"),"\n";}echo"</table>\n",(support("database")?"<fieldset><legend>".lang(115)." <span id='selected'></span></legend><div>\n"."<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n"."<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n"."</div></fieldset>\n":""),"<script type='text/javascript'>tableCheck();</script>\n","<input type='hidden' name='token' value='$T'>\n","</form>\n";}}page_footer("db");}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(isset($_GET["import"]))$_GET["sql"]=$_GET["import"];if(!(DB!=""?$h->select_db(DB):isset($_GET["sql"])||isset($_GET["dump"])||isset($_GET["database"])||isset($_GET["processlist"])||isset($_GET["privileges"])||isset($_GET["user"])||isset($_GET["variables"])||$_GET["script"]=="connect"||$_GET["script"]=="kill")){if(DB!=""||$_GET["refresh"]){restart_session();set_session("dbs",null);}connect_error();exit;}if(support("scheme")&&DB!=""&&$_GET["ns"]!==""){if(!isset($_GET["ns"]))redirect(preg_replace('~ns=[^&]*&~','',ME)."ns=".get_schema());if(!set_schema($_GET["ns"])){header("HTTP/1.1 404 Not Found");page_header(lang(68).": ".h($_GET["ns"]),lang(117),true);page_footer("ns");exit;}}$Ne="RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT";class
    56345648TmpFile{var$handler;var$size;function
    56355649TmpFile(){$this->handler=tmpfile();}function
    56365650write($xb){$this->size+=strlen($xb);fwrite($this->handler,$xb);}function
    5637 send(){fseek($this->handler,0);fpassthru($this->handler);fclose($this->handler);}}$qc="'(?:''|[^'\\\\]|\\\\.)*'";$ud="IN|OUT|INOUT";if(isset($_GET["select"])&&($_POST["edit"]||$_POST["clone"])&&!$_POST["save"])$_GET["edit"]=$_GET["select"];if(isset($_GET["callf"]))$_GET["call"]=$_GET["callf"];if(isset($_GET["function"]))$_GET["procedure"]=$_GET["function"];if(isset($_GET["download"])){$a=$_GET["download"];$o=fields($a);header("Content-Type: application/octet-stream");header("Content-Disposition: attachment; filename=".friendly_url("$a-".implode("_",$_GET["where"])).".".friendly_url($_GET["field"]));$M=array(idf_escape($_GET["field"]));$I=$Xb->select($a,$M,array(where($_GET,$o)),$M);$K=($I?$I->fetch_row():array());echo$K[0];exit;}elseif(isset($_GET["table"])){$a=$_GET["table"];$o=fields($a);if(!$o)$m=error();$R=table_status1($a,true);page_header(($o&&is_view($R)?lang(118):lang(119)).": ".h($a),$m);$b->selectLinks($R);$rb=$R["Comment"];if($rb!="")echo"<p>".lang(96).": ".h($rb)."\n";if($o){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(120)."<td>".lang(92).(support("comment")?"<td>".lang(96):"")."</thead>\n";foreach($o
    5638 as$n){echo"<tr".odd()."><th>".h($n["field"]),"<td><span title='".h($n["collation"])."'>".h($n["full_type"])."</span>",($n["null"]?" <i>NULL</i>":""),($n["auto_increment"]?" <i>".lang(56)."</i>":""),(isset($n["default"])?" <span title='".lang(95)."'>[<b>".h($n["default"])."</b>]</span>":""),(support("comment")?"<td>".nbsp($n["comment"]):""),"\n";}echo"</table>\n";}if(!is_view($R)){if(support("indexes")){echo"<h3 id='indexes'>".lang(121)."</h3>\n";$v=indexes($a);if($v){echo"<table cellspacing='0'>\n";foreach($v
    5639 as$C=>$u){ksort($u["columns"]);$Ef=array();foreach($u["columns"]as$x=>$X)$Ef[]="<i>".h($X)."</i>".($u["lengths"][$x]?"(".$u["lengths"][$x].")":"").($u["descs"][$x]?" DESC":"");echo"<tr title='".h($C)."'><th>$u[type]<td>".implode(", ",$Ef)."\n";}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(122)."</a>\n";}if(fk_support($R)){echo"<h3 id='foreign-keys'>".lang(86)."</h3>\n";$Pc=foreign_keys($a);if($Pc){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(123)."<td>".lang(124)."<td>".lang(89)."<td>".lang(88)."<td>&nbsp;</thead>\n";foreach($Pc
    5640 as$C=>$p){echo"<tr title='".h($C)."'>","<th><i>".implode("</i>, <i>",array_map('h',$p["source"]))."</i>","<td><a href='".h($p["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($p["db"]),ME):($p["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($p["ns"]),ME):ME))."table=".urlencode($p["table"])."'>".($p["db"]!=""?"<b>".h($p["db"])."</b>.":"").($p["ns"]!=""?"<b>".h($p["ns"])."</b>.":"").h($p["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$p["target"]))."</i>)","<td>".nbsp($p["on_delete"])."\n","<td>".nbsp($p["on_update"])."\n",'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($C)).'">'.lang(125).'</a>';}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(126)."</a>\n";}}if(support(is_view($R)?"view_trigger":"trigger")){echo"<h3 id='triggers'>".lang(127)."</h3>\n";$zh=triggers($a);if($zh){echo"<table cellspacing='0'>\n";foreach($zh
     5651send(){fseek($this->handler,0);fpassthru($this->handler);fclose($this->handler);}}$pc="'(?:''|[^'\\\\]|\\\\.)*'";$ud="IN|OUT|INOUT";if(isset($_GET["select"])&&($_POST["edit"]||$_POST["clone"])&&!$_POST["save"])$_GET["edit"]=$_GET["select"];if(isset($_GET["callf"]))$_GET["call"]=$_GET["callf"];if(isset($_GET["function"]))$_GET["procedure"]=$_GET["function"];if(isset($_GET["download"])){$a=$_GET["download"];$p=fields($a);header("Content-Type: application/octet-stream");header("Content-Disposition: attachment; filename=".friendly_url("$a-".implode("_",$_GET["where"])).".".friendly_url($_GET["field"]));$M=array(idf_escape($_GET["field"]));$I=$Wb->select($a,$M,array(where($_GET,$p)),$M);$K=($I?$I->fetch_row():array());echo$K[0];exit;}elseif(isset($_GET["table"])){$a=$_GET["table"];$p=fields($a);if(!$p)$n=error();$R=table_status1($a,true);page_header(($p&&is_view($R)?lang(118):lang(119)).": ".h($a),$n);$b->selectLinks($R);$rb=$R["Comment"];if($rb!="")echo"<p>".lang(96).": ".h($rb)."\n";if($p){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(120)."<td>".lang(92).(support("comment")?"<td>".lang(96):"")."</thead>\n";foreach($p
     5652as$o){echo"<tr".odd()."><th>".h($o["field"]),"<td><span title='".h($o["collation"])."'>".h($o["full_type"])."</span>",($o["null"]?" <i>NULL</i>":""),($o["auto_increment"]?" <i>".lang(56)."</i>":""),(isset($o["default"])?" <span title='".lang(95)."'>[<b>".h($o["default"])."</b>]</span>":""),(support("comment")?"<td>".nbsp($o["comment"]):""),"\n";}echo"</table>\n";}if(!is_view($R)){if(support("indexes")){echo"<h3 id='indexes'>".lang(121)."</h3>\n";$v=indexes($a);if($v){echo"<table cellspacing='0'>\n";foreach($v
     5653as$C=>$u){ksort($u["columns"]);$Ef=array();foreach($u["columns"]as$x=>$X)$Ef[]="<i>".h($X)."</i>".($u["lengths"][$x]?"(".$u["lengths"][$x].")":"").($u["descs"][$x]?" DESC":"");echo"<tr title='".h($C)."'><th>$u[type]<td>".implode(", ",$Ef)."\n";}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(122)."</a>\n";}if(fk_support($R)){echo"<h3 id='foreign-keys'>".lang(86)."</h3>\n";$Oc=foreign_keys($a);if($Oc){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(123)."<td>".lang(124)."<td>".lang(89)."<td>".lang(88)."<td>&nbsp;</thead>\n";foreach($Oc
     5654as$C=>$q){echo"<tr title='".h($C)."'>","<th><i>".implode("</i>, <i>",array_map('h',$q["source"]))."</i>","<td><a href='".h($q["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($q["db"]),ME):($q["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($q["ns"]),ME):ME))."table=".urlencode($q["table"])."'>".($q["db"]!=""?"<b>".h($q["db"])."</b>.":"").($q["ns"]!=""?"<b>".h($q["ns"])."</b>.":"").h($q["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$q["target"]))."</i>)","<td>".nbsp($q["on_delete"])."\n","<td>".nbsp($q["on_update"])."\n",'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($C)).'">'.lang(125).'</a>';}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(126)."</a>\n";}}if(support(is_view($R)?"view_trigger":"trigger")){echo"<h3 id='triggers'>".lang(127)."</h3>\n";$zh=triggers($a);if($zh){echo"<table cellspacing='0'>\n";foreach($zh
    56415655as$x=>$X)echo"<tr valign='top'><td>".h($X[0])."<td>".h($X[1])."<th>".h($x)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($x))."'>".lang(125)."</a>\n";echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(128)."</a>\n";}}elseif(isset($_GET["schema"])){page_header(lang(62),"",array(),h(DB.($_GET["ns"]?".$_GET[ns]":"")));$Vg=array();$Wg=array();$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE["adminer_schema-".str_replace(".","_",DB)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$ee,PREG_SET_ORDER);foreach($ee
    5642 as$r=>$B){$Vg[$B[1]]=array($B[2],$B[3]);$Wg[]="\n\t'".js_escape($B[1])."': [ $B[2], $B[3] ]";}$rh=0;$Qa=-1;$og=array();$Wf=array();$Ud=array();foreach(table_status('',true)as$Q=>$R){if(is_view($R))continue;$xf=0;$og[$Q]["fields"]=array();foreach(fields($Q)as$C=>$n){$xf+=1.25;$n["pos"]=$xf;$og[$Q]["fields"][$C]=$n;}$og[$Q]["pos"]=($Vg[$Q]?$Vg[$Q]:array($rh,0));foreach($b->foreignKeys($Q)as$X){if(!$X["db"]){$Sd=$Qa;if($Vg[$Q][1]||$Vg[$X["table"]][1])$Sd=min(floatval($Vg[$Q][1]),floatval($Vg[$X["table"]][1]))-1;else$Qa-=.1;while($Ud[(string)$Sd])$Sd-=.0001;$og[$Q]["references"][$X["table"]][(string)$Sd]=array($X["source"],$X["target"]);$Wf[$X["table"]][$Q][(string)$Sd]=$X["target"];$Ud[(string)$Sd]=true;}}$rh=max($rh,$og[$Q]["pos"][0]+2.5+$xf);}echo'<div id="schema" style="height: ',$rh,'em;" onselectstart="return false;">
     5656as$s=>$B){$Vg[$B[1]]=array($B[2],$B[3]);$Wg[]="\n\t'".js_escape($B[1])."': [ $B[2], $B[3] ]";}$rh=0;$Qa=-1;$og=array();$Wf=array();$Ud=array();foreach(table_status('',true)as$Q=>$R){if(is_view($R))continue;$xf=0;$og[$Q]["fields"]=array();foreach(fields($Q)as$C=>$o){$xf+=1.25;$o["pos"]=$xf;$og[$Q]["fields"][$C]=$o;}$og[$Q]["pos"]=($Vg[$Q]?$Vg[$Q]:array($rh,0));foreach($b->foreignKeys($Q)as$X){if(!$X["db"]){$Sd=$Qa;if($Vg[$Q][1]||$Vg[$X["table"]][1])$Sd=min(floatval($Vg[$Q][1]),floatval($Vg[$X["table"]][1]))-1;else$Qa-=.1;while($Ud[(string)$Sd])$Sd-=.0001;$og[$Q]["references"][$X["table"]][(string)$Sd]=array($X["source"],$X["target"]);$Wf[$X["table"]][$Q][(string)$Sd]=$X["target"];$Ud[(string)$Sd]=true;}}$rh=max($rh,$og[$Q]["pos"][0]+2.5+$xf);}echo'<div id="schema" style="height: ',$rh,'em;" onselectstart="return false;">
    56435657<script type="text/javascript">
    56445658var tablePos = {',implode(",",$Wg)."\n",'};
     
    56505664</script>
    56515665';foreach($og
    5652 as$C=>$Q){echo"<div class='table' style='top: ".$Q["pos"][0]."em; left: ".$Q["pos"][1]."em;' onmousedown='schemaMousedown(this, event);'>",'<a href="'.h(ME).'table='.urlencode($C).'"><b>'.h($C)."</b></a>";foreach($Q["fields"]as$n){$X='<span'.type_class($n["type"]).' title="'.h($n["full_type"].($n["null"]?" NULL":'')).'">'.h($n["field"]).'</span>';echo"<br>".($n["primary"]?"<i>$X</i>":$X);}foreach((array)$Q["references"]as$ch=>$Xf){foreach($Xf
    5653 as$Sd=>$Tf){$Td=$Sd-$Vg[$C][1];$r=0;foreach($Tf[0]as$Dg)echo"\n<div class='references' title='".h($ch)."' id='refs$Sd-".($r++)."' style='left: $Td"."em; top: ".$Q["fields"][$Dg]["pos"]."em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: ".(-$Td)."em;'></div></div>";}}foreach((array)$Wf[$C]as$ch=>$Xf){foreach($Xf
    5654 as$Sd=>$f){$Td=$Sd-$Vg[$C][1];$r=0;foreach($f
    5655 as$bh)echo"\n<div class='references' title='".h($ch)."' id='refd$Sd-".($r++)."' style='left: $Td"."em; top: ".$Q["fields"][$bh]["pos"]."em; height: 1.25em; background: url(".h(preg_replace("~\\?.*~","",ME))."?file=arrow.gif) no-repeat right center;&amp;version=4.2.0'><div style='height: .5em; border-bottom: 1px solid Gray; width: ".(-$Td)."em;'></div></div>";}}echo"\n</div>\n";}foreach($og
     5666as$C=>$Q){echo"<div class='table' style='top: ".$Q["pos"][0]."em; left: ".$Q["pos"][1]."em;' onmousedown='schemaMousedown(this, event);'>",'<a href="'.h(ME).'table='.urlencode($C).'"><b>'.h($C)."</b></a>";foreach($Q["fields"]as$o){$X='<span'.type_class($o["type"]).' title="'.h($o["full_type"].($o["null"]?" NULL":'')).'">'.h($o["field"]).'</span>';echo"<br>".($o["primary"]?"<i>$X</i>":$X);}foreach((array)$Q["references"]as$ch=>$Xf){foreach($Xf
     5667as$Sd=>$Tf){$Td=$Sd-$Vg[$C][1];$s=0;foreach($Tf[0]as$Dg)echo"\n<div class='references' title='".h($ch)."' id='refs$Sd-".($s++)."' style='left: $Td"."em; top: ".$Q["fields"][$Dg]["pos"]."em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: ".(-$Td)."em;'></div></div>";}}foreach((array)$Wf[$C]as$ch=>$Xf){foreach($Xf
     5668as$Sd=>$f){$Td=$Sd-$Vg[$C][1];$s=0;foreach($f
     5669as$bh)echo"\n<div class='references' title='".h($ch)."' id='refd$Sd-".($s++)."' style='left: $Td"."em; top: ".$Q["fields"][$bh]["pos"]."em; height: 1.25em; background: url(".h(preg_replace("~\\?.*~","",ME))."?file=arrow.gif) no-repeat right center;&amp;version=4.2.1'><div style='height: .5em; border-bottom: 1px solid Gray; width: ".(-$Td)."em;'></div></div>";}}echo"\n</div>\n";}foreach($og
    56565670as$C=>$Q){foreach((array)$Q["references"]as$ch=>$Xf){foreach($Xf
    56575671as$Sd=>$Tf){$te=$rh;$ie=-10;foreach($Tf[0]as$x=>$Dg){$yf=$Q["pos"][0]+$Q["fields"][$Dg]["pos"];$zf=$og[$ch]["pos"][0]+$og[$ch]["fields"][$Tf[1][$x]]["pos"];$te=min($te,$yf,$zf);$ie=max($ie,$yf,$zf);}echo"<div class='references' id='refl$Sd' style='left: $Sd"."em; top: $te"."em; padding: .5em 0;'><div style='border-right: 1px solid Gray; margin-top: 1px; height: ".($ie-$te)."em;'></div></div>\n";}}}echo'</div>
    56585672<p class="links"><a href="',h(ME."schema=".urlencode($ea)),'" id="schema-link">',lang(129),'</a>
    5659 ';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$m){$_b="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$x)$_b.="&$x=".urlencode($_POST[$x]);cookie("adminer_export",substr($_b,1));$S=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$Bc=dump_headers((count($S)==1?key($S):DB),(DB==""||count($S)>1));$Bd=preg_match('~sql~',$_POST["format"]);if($Bd){echo"-- Adminer $ia ".$Yb[DRIVER]." dump\n\n";if($w=="sql"){echo"SET NAMES ".charset($h).";
     5673';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$n){$_b="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$x)$_b.="&$x=".urlencode($_POST[$x]);cookie("adminer_export",substr($_b,1));$S=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$Ac=dump_headers((count($S)==1?key($S):DB),(DB==""||count($S)>1));$Bd=preg_match('~sql~',$_POST["format"]);if($Bd){echo"-- Adminer $ia ".$Xb[DRIVER]." dump\n\n";if($w=="sql"){echo"SET NAMES utf8;
    56605674SET time_zone = '+00:00';
    56615675".($_POST["data_style"]?"SET foreign_key_checks = 0;
    56625676SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
    56635677":"")."
    5664 ";$h->query("SET time_zone = '+00:00';");}}$Mg=$_POST["db_style"];$k=array(DB);if(DB==""){$k=$_POST["databases"];if(is_string($k))$k=explode("\n",rtrim(str_replace("\r","",$k),"\n"));}foreach((array)$k
    5665 as$l){$b->dumpDatabase($l);if($h->select_db($l)){if($Bd&&preg_match('~CREATE~',$Mg)&&($Bb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1))){if($Mg=="DROP+CREATE")echo"DROP DATABASE IF EXISTS ".idf_escape($l).";\n";echo"$Bb;\n";}if($Bd){if($Mg)echo
    5666 use_sql($l).";\n\n";$gf="";if($_POST["routines"]){foreach(array("FUNCTION","PROCEDURE")as$ig){foreach(get_rows("SHOW $ig STATUS WHERE Db = ".q($l),null,"-- ")as$K)$gf.=($Mg!='DROP+CREATE'?"DROP $ig IF EXISTS ".idf_escape($K["Name"]).";;\n":"").remove_definer($h->result("SHOW CREATE $ig ".idf_escape($K["Name"]),2)).";;\n\n";}}if($_POST["events"]){foreach(get_rows("SHOW EVENTS",null,"-- ")as$K)$gf.=($Mg!='DROP+CREATE'?"DROP EVENT IF EXISTS ".idf_escape($K["Name"]).";;\n":"").remove_definer($h->result("SHOW CREATE EVENT ".idf_escape($K["Name"]),3)).";;\n\n";}if($gf)echo"DELIMITER ;;\n\n$gf"."DELIMITER ;\n\n";}if($_POST["table_style"]||$_POST["data_style"]){$Yh=array();foreach(table_status('',true)as$C=>$R){$Q=(DB==""||in_array($C,(array)$_POST["tables"]));$Fb=(DB==""||in_array($C,(array)$_POST["data"]));if($Q||$Fb){if($Bc=="tar"){$ph=new
    5667 TmpFile;ob_start(array($ph,'write'),1e5);}$b->dumpTable($C,($Q?$_POST["table_style"]:""),(is_view($R)?2:0));if(is_view($R))$Yh[]=$C;elseif($Fb){$o=fields($C);$b->dumpData($C,$_POST["data_style"],"SELECT *".convert_fields($o,$o)." FROM ".table($C));}if($Bd&&$_POST["triggers"]&&$Q&&($zh=trigger_sql($C,$_POST["table_style"])))echo"\nDELIMITER ;;\n$zh\nDELIMITER ;\n";if($Bc=="tar"){ob_end_flush();tar_file((DB!=""?"":"$l/")."$C.csv",$ph);}elseif($Bd)echo"\n";}}foreach($Yh
    5668 as$Xh)$b->dumpTable($Xh,$_POST["table_style"],1);if($Bc=="tar")echo
    5669 pack("x512");}}}if($Bd)echo"-- ".$h->result("SELECT NOW()")."\n";exit;}page_header(lang(65),$m,($_GET["export"]!=""?array("table"=>$_GET["export"]):array()),h(DB));echo'
     5678";$h->query("SET time_zone = '+00:00';");}}$Mg=$_POST["db_style"];$l=array(DB);if(DB==""){$l=$_POST["databases"];if(is_string($l))$l=explode("\n",rtrim(str_replace("\r","",$l),"\n"));}foreach((array)$l
     5679as$m){$b->dumpDatabase($m);if($h->select_db($m)){if($Bd&&preg_match('~CREATE~',$Mg)&&($j=$h->result("SHOW CREATE DATABASE ".idf_escape($m),1))){set_utf8mb4($j);if($Mg=="DROP+CREATE")echo"DROP DATABASE IF EXISTS ".idf_escape($m).";\n";echo"$j;\n";}if($Bd){if($Mg)echo
     5680use_sql($m).";\n\n";$gf="";if($_POST["routines"]){foreach(array("FUNCTION","PROCEDURE")as$ig){foreach(get_rows("SHOW $ig STATUS WHERE Db = ".q($m),null,"-- ")as$K){$j=remove_definer($h->result("SHOW CREATE $ig ".idf_escape($K["Name"]),2));set_utf8mb4($j);$gf.=($Mg!='DROP+CREATE'?"DROP $ig IF EXISTS ".idf_escape($K["Name"]).";;\n":"")."$j;;\n\n";}}}if($_POST["events"]){foreach(get_rows("SHOW EVENTS",null,"-- ")as$K){$j=remove_definer($h->result("SHOW CREATE EVENT ".idf_escape($K["Name"]),3));set_utf8mb4($j);$gf.=($Mg!='DROP+CREATE'?"DROP EVENT IF EXISTS ".idf_escape($K["Name"]).";;\n":"")."$j;;\n\n";}}if($gf)echo"DELIMITER ;;\n\n$gf"."DELIMITER ;\n\n";}if($_POST["table_style"]||$_POST["data_style"]){$Yh=array();foreach(table_status('',true)as$C=>$R){$Q=(DB==""||in_array($C,(array)$_POST["tables"]));$Eb=(DB==""||in_array($C,(array)$_POST["data"]));if($Q||$Eb){if($Ac=="tar"){$ph=new
     5681TmpFile;ob_start(array($ph,'write'),1e5);}$b->dumpTable($C,($Q?$_POST["table_style"]:""),(is_view($R)?2:0));if(is_view($R))$Yh[]=$C;elseif($Eb){$p=fields($C);$b->dumpData($C,$_POST["data_style"],"SELECT *".convert_fields($p,$p)." FROM ".table($C));}if($Bd&&$_POST["triggers"]&&$Q&&($zh=trigger_sql($C,$_POST["table_style"])))echo"\nDELIMITER ;;\n$zh\nDELIMITER ;\n";if($Ac=="tar"){ob_end_flush();tar_file((DB!=""?"":"$m/")."$C.csv",$ph);}elseif($Bd)echo"\n";}}foreach($Yh
     5682as$Xh)$b->dumpTable($Xh,$_POST["table_style"],1);if($Ac=="tar")echo
     5683pack("x512");}}}if($Bd)echo"-- ".$h->result("SELECT NOW()")."\n";exit;}page_header(lang(65),$n,($_GET["export"]!=""?array("table"=>$_GET["export"]):array()),h(DB));echo'
    56705684<form action="" method="post">
    56715685<table cellspacing="0">
    5672 ';$Jb=array('','USE','DROP+CREATE','CREATE');$Xg=array('','DROP+CREATE','CREATE');$Gb=array('','TRUNCATE+INSERT','INSERT');if($w=="sql")$Gb[]='INSERT+UPDATE';parse_str($_COOKIE["adminer_export"],$K);if(!$K)$K=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($K["events"])){$K["routines"]=$K["events"]=($_GET["dump"]=="");$K["triggers"]=$K["table_style"];}echo"<tr><th>".lang(130)."<td>".html_select("output",$b->dumpOutput(),$K["output"],0)."\n";echo"<tr><th>".lang(131)."<td>".html_select("format",$b->dumpFormat(),$K["format"],0)."\n";echo($w=="sqlite"?"":"<tr><th>".lang(35)."<td>".html_select('db_style',$Jb,$K["db_style"]).(support("routine")?checkbox("routines",1,$K["routines"],lang(132)):"").(support("event")?checkbox("events",1,$K["events"],lang(133)):"")),"<tr><th>".lang(112)."<td>".html_select('table_style',$Xg,$K["table_style"]).checkbox("auto_increment",1,$K["auto_increment"],lang(56)).(support("trigger")?checkbox("triggers",1,$K["triggers"],lang(127)):""),"<tr><th>".lang(134)."<td>".html_select('data_style',$Gb,$K["data_style"]),'</table>
     5686';$Ib=array('','USE','DROP+CREATE','CREATE');$Xg=array('','DROP+CREATE','CREATE');$Fb=array('','TRUNCATE+INSERT','INSERT');if($w=="sql")$Fb[]='INSERT+UPDATE';parse_str($_COOKIE["adminer_export"],$K);if(!$K)$K=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($K["events"])){$K["routines"]=$K["events"]=($_GET["dump"]=="");$K["triggers"]=$K["table_style"];}echo"<tr><th>".lang(130)."<td>".html_select("output",$b->dumpOutput(),$K["output"],0)."\n";echo"<tr><th>".lang(131)."<td>".html_select("format",$b->dumpFormat(),$K["format"],0)."\n";echo($w=="sqlite"?"":"<tr><th>".lang(35)."<td>".html_select('db_style',$Ib,$K["db_style"]).(support("routine")?checkbox("routines",1,$K["routines"],lang(132)):"").(support("event")?checkbox("events",1,$K["events"],lang(133)):"")),"<tr><th>".lang(112)."<td>".html_select('table_style',$Xg,$K["table_style"]).checkbox("auto_increment",1,$K["auto_increment"],lang(56)).(support("trigger")?checkbox("triggers",1,$K["triggers"],lang(127)):""),"<tr><th>".lang(134)."<td>".html_select('data_style',$Fb,$K["data_style"]),'</table>
    56735687<p><input type="submit" value="',lang(65),'">
    56745688<input type="hidden" name="token" value="',$T,'">
     
    56775691';$Bf=array();if(DB!=""){$db=($a!=""?"":" checked");echo"<thead><tr>","<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$db onclick='formCheck(this, /^tables\\[/);'>".lang(112)."</label>","<th style='text-align: right;'><label class='block'>".lang(134)."<input type='checkbox' id='check-data'$db onclick='formCheck(this, /^data\\[/);'></label>","</thead>\n";$Yh="";$Yg=tables_list();foreach($Yg
    56785692as$C=>$U){$Af=preg_replace('~_.*~','',$C);$db=($a==""||$a==(substr($a,-1)=="%"?"$Af%":$C));$Ef="<tr><td>".checkbox("tables[]",$C,$db,$C,"checkboxClick(event, this); formUncheck('check-tables');","block");if($U!==null&&!preg_match('~table~i',$U))$Yh.="$Ef\n";else
    5679 echo"$Ef<td align='right'><label class='block'><span id='Rows-".h($C)."'></span>".checkbox("data[]",$C,$db,"","checkboxClick(event, this); formUncheck('check-data');")."</label>\n";$Bf[$Af]++;}echo$Yh;if($Yg)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}else{echo"<thead><tr><th style='text-align: left;'><label class='block'><input type='checkbox' id='check-databases'".($a==""?" checked":"")." onclick='formCheck(this, /^databases\\[/);'>".lang(35)."</label></thead>\n";$k=$b->databases();if($k){foreach($k
    5680 as$l){if(!information_schema($l)){$Af=preg_replace('~_.*~','',$l);echo"<tr><td>".checkbox("databases[]",$l,$a==""||$a=="$Af%",$l,"formUncheck('check-databases');","block")."\n";$Bf[$Af]++;}}}else
     5693echo"$Ef<td align='right'><label class='block'><span id='Rows-".h($C)."'></span>".checkbox("data[]",$C,$db,"","checkboxClick(event, this); formUncheck('check-data');")."</label>\n";$Bf[$Af]++;}echo$Yh;if($Yg)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}else{echo"<thead><tr><th style='text-align: left;'><label class='block'><input type='checkbox' id='check-databases'".($a==""?" checked":"")." onclick='formCheck(this, /^databases\\[/);'>".lang(35)."</label></thead>\n";$l=$b->databases();if($l){foreach($l
     5694as$m){if(!information_schema($m)){$Af=preg_replace('~_.*~','',$m);echo"<tr><td>".checkbox("databases[]",$m,$a==""||$a=="$Af%",$m,"formUncheck('check-databases');","block")."\n";$Bf[$Af]++;}}}else
    56815695echo"<tr><td><textarea name='databases' rows='10' cols='20'></textarea>";}echo'</table>
    56825696</form>
    5683 ';$Lc=true;foreach($Bf
    5684 as$x=>$X){if($x!=""&&$X>1){echo($Lc?"<p>":" ")."<a href='".h(ME)."dump=".urlencode("$x%")."'>".h($x)."</a>";$Lc=false;}}}elseif(isset($_GET["privileges"])){page_header(lang(63));$I=$h->query("SELECT User, Host FROM mysql.".(DB==""?"user":"db WHERE ".q(DB)." LIKE Db")." ORDER BY Host, User");$Wc=$I;if(!$I)$I=$h->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");echo"<form action=''><p>\n";hidden_fields_get();echo"<input type='hidden' name='db' value='".h(DB)."'>\n",($Wc?"":"<input type='hidden' name='grant' value=''>\n"),"<table cellspacing='0'>\n","<thead><tr><th>".lang(33)."<th>".lang(32)."<th>&nbsp;</thead>\n";while($K=$I->fetch_assoc())echo'<tr'.odd().'><td>'.h($K["User"])."<td>".h($K["Host"]).'<td><a href="'.h(ME.'user='.urlencode($K["User"]).'&host='.urlencode($K["Host"])).'">'.lang(10)."</a>\n";if(!$Wc||DB!="")echo"<tr".odd()."><td><input name='user' autocapitalize='off'><td><input name='host' value='localhost' autocapitalize='off'><td><input type='submit' value='".lang(10)."'>\n";echo"</table>\n","</form>\n",'<p class="links"><a href="'.h(ME).'user=">'.lang(135)."</a>";}elseif(isset($_GET["sql"])){if(!$m&&$_POST["export"]){dump_headers("sql");$b->dumpTable("","");$b->dumpData("","table",$_POST["query"]);exit;}restart_session();$gd=&get_session("queries");$fd=&$gd[DB];if(!$m&&$_POST["clear"]){$fd=array();redirect(remove_from_uri("history"));}page_header((isset($_GET["import"])?lang(64):lang(55)),$m);if(!$m&&$_POST){$Tc=false;if(!isset($_GET["import"]))$H=$_POST["query"];elseif($_POST["webfile"]){$Tc=@fopen((file_exists("adminer.sql")?"adminer.sql":"compress.zlib://adminer.sql.gz"),"rb");$H=($Tc?fread($Tc,1e6):false);}else$H=get_file("sql_file",true);if(is_string($H)){if(function_exists('memory_get_usage'))@ini_set("memory_limit",max(ini_bytes("memory_limit"),2*strlen($H)+memory_get_usage()+8e6));if($H!=""&&strlen($H)<1e6){$Lf=$H.(preg_match("~;[ \t\r\n]*\$~",$H)?"":";");if(!$fd||reset(end($fd))!=$Lf){restart_session();$fd[]=array($Lf,time());set_session("queries",$gd);stop_session();}}$Eg="(?:\\s|/\\*.*\\*/|(?:#|-- )[^\n]*\n|--\r?\n)";$Ob=";";$D=0;$nc=true;$i=connect();if(is_object($i)&&DB!="")$i->select_db(DB);$qb=0;$sc=array();$Yd=0;$lf='[\'"'.($w=="sql"?'`#':($w=="sqlite"?'`[':($w=="mssql"?'[':''))).']|/\\*|-- |$'.($w=="pgsql"?'|\\$[^$]*\\$':'');$sh=microtime(true);parse_str($_COOKIE["adminer_export"],$xa);$ec=$b->dumpFormat();unset($ec["sql"]);while($H!=""){if(!$D&&preg_match("~^$Eg*DELIMITER\\s+(\\S+)~i",$H,$B)){$Ob=$B[1];$H=substr($H,strlen($B[0]));}else{preg_match('('.preg_quote($Ob)."\\s*|$lf)",$H,$B,PREG_OFFSET_CAPTURE,$D);list($Rc,$xf)=$B[0];if(!$Rc&&$Tc&&!feof($Tc))$H.=fread($Tc,1e5);else{if(!$Rc&&rtrim($H)=="")break;$D=$xf+strlen($Rc);if($Rc&&rtrim($Rc)!=$Ob){while(preg_match('('.($Rc=='/*'?'\\*/':($Rc=='['?']':(preg_match('~^-- |^#~',$Rc)?"\n":preg_quote($Rc)."|\\\\."))).'|$)s',$H,$B,PREG_OFFSET_CAPTURE,$D)){$mg=$B[0][0];if(!$mg&&$Tc&&!feof($Tc))$H.=fread($Tc,1e5);else{$D=$B[0][1]+strlen($mg);if($mg[0]!="\\")break;}}}else{$nc=false;$Lf=substr($H,0,$xf);$qb++;$Ef="<pre id='sql-$qb'><code class='jush-$w'>".shorten_utf8(trim($Lf),1000)."</code></pre>\n";if(!$_POST["only_errors"]){echo$Ef;ob_flush();flush();}$Hg=microtime(true);if($h->multi_query($Lf)&&is_object($i)&&preg_match("~^$Eg*USE\\b~isU",$Lf))$i->query($Lf);do{$I=$h->store_result();$ih=" <span class='time'>(".format_time($Hg).")</span>".(strlen($Lf)<1000?" <a href='".h(ME)."sql=".urlencode(trim($Lf))."'>".lang(10)."</a>":"");if($h->error){echo($_POST["only_errors"]?$Ef:""),"<p class='error'>".lang(136).($h->errno?" ($h->errno)":"").": ".error()."\n";$sc[]=" <a href='#sql-$qb'>$qb</a>";if($_POST["error_stops"])break
    5685 2;}elseif(is_object($I)){$z=$_POST["limit"];$af=select($I,$i,array(),$z);if(!$_POST["only_errors"]){echo"<form action='' method='post'>\n";$De=$I->num_rows;echo"<p>".($De?($z&&$De>$z?lang(137,$z):"").lang(138,$De):""),$ih;$s="export-$qb";$Ac=", <a href='#$s' onclick=\"return !toggle('$s');\">".lang(65)."</a><span id='$s' class='hidden'>: ".html_select("output",$b->dumpOutput(),$xa["output"])." ".html_select("format",$ec,$xa["format"])."<input type='hidden' name='query' value='".h($Lf)."'>"." <input type='submit' name='export' value='".lang(65)."'><input type='hidden' name='token' value='$T'></span>\n";if($i&&preg_match("~^($Eg|\\()*SELECT\\b~isU",$Lf)&&($_c=explain($i,$Lf))){$s="explain-$qb";echo", <a href='#$s' onclick=\"return !toggle('$s');\">EXPLAIN</a>$Ac","<div id='$s' class='hidden'>\n";select($_c,$i,$af);echo"</div>\n";}else
    5686 echo$Ac;echo"</form>\n";}}else{if(preg_match("~^$Eg*(CREATE|DROP|ALTER)$Eg+(DATABASE|SCHEMA)\\b~isU",$Lf)){restart_session();set_session("dbs",null);stop_session();}if(!$_POST["only_errors"])echo"<p class='message' title='".h($h->info)."'>".lang(139,$h->affected_rows)."$ih\n";}$Hg=microtime(true);}while($h->next_result());$Yd+=substr_count($Lf.$Rc,"\n");$H=substr($H,$D);$D=0;}}}}if($nc)echo"<p class='message'>".lang(140)."\n";elseif($_POST["only_errors"]){echo"<p class='message'>".lang(141,$qb-count($sc))," <span class='time'>(".format_time($sh).")</span>\n";}elseif($sc&&$qb>1)echo"<p class='error'>".lang(136).": ".implode("",$sc)."\n";}else
     5697';$Kc=true;foreach($Bf
     5698as$x=>$X){if($x!=""&&$X>1){echo($Kc?"<p>":" ")."<a href='".h(ME)."dump=".urlencode("$x%")."'>".h($x)."</a>";$Kc=false;}}}elseif(isset($_GET["privileges"])){page_header(lang(63));$I=$h->query("SELECT User, Host FROM mysql.".(DB==""?"user":"db WHERE ".q(DB)." LIKE Db")." ORDER BY Host, User");$Vc=$I;if(!$I)$I=$h->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");echo"<form action=''><p>\n";hidden_fields_get();echo"<input type='hidden' name='db' value='".h(DB)."'>\n",($Vc?"":"<input type='hidden' name='grant' value=''>\n"),"<table cellspacing='0'>\n","<thead><tr><th>".lang(33)."<th>".lang(32)."<th>&nbsp;</thead>\n";while($K=$I->fetch_assoc())echo'<tr'.odd().'><td>'.h($K["User"])."<td>".h($K["Host"]).'<td><a href="'.h(ME.'user='.urlencode($K["User"]).'&host='.urlencode($K["Host"])).'">'.lang(10)."</a>\n";if(!$Vc||DB!="")echo"<tr".odd()."><td><input name='user' autocapitalize='off'><td><input name='host' value='localhost' autocapitalize='off'><td><input type='submit' value='".lang(10)."'>\n";echo"</table>\n","</form>\n",'<p class="links"><a href="'.h(ME).'user=">'.lang(135)."</a>";}elseif(isset($_GET["sql"])){if(!$n&&$_POST["export"]){dump_headers("sql");$b->dumpTable("","");$b->dumpData("","table",$_POST["query"]);exit;}restart_session();$fd=&get_session("queries");$ed=&$fd[DB];if(!$n&&$_POST["clear"]){$ed=array();redirect(remove_from_uri("history"));}page_header((isset($_GET["import"])?lang(64):lang(55)),$n);if(!$n&&$_POST){$Sc=false;if(!isset($_GET["import"]))$H=$_POST["query"];elseif($_POST["webfile"]){$Sc=@fopen((file_exists("adminer.sql")?"adminer.sql":"compress.zlib://adminer.sql.gz"),"rb");$H=($Sc?fread($Sc,1e6):false);}else$H=get_file("sql_file",true);if(is_string($H)){if(function_exists('memory_get_usage'))@ini_set("memory_limit",max(ini_bytes("memory_limit"),2*strlen($H)+memory_get_usage()+8e6));if($H!=""&&strlen($H)<1e6){$Lf=$H.(preg_match("~;[ \t\r\n]*\$~",$H)?"":";");if(!$ed||reset(end($ed))!=$Lf){restart_session();$ed[]=array($Lf,time());set_session("queries",$fd);stop_session();}}$Eg="(?:\\s|/\\*.*\\*/|(?:#|-- )[^\n]*\n|--\r?\n)";$Nb=";";$D=0;$mc=true;$i=connect();if(is_object($i)&&DB!="")$i->select_db(DB);$qb=0;$rc=array();$Yd=0;$lf='[\'"'.($w=="sql"?'`#':($w=="sqlite"?'`[':($w=="mssql"?'[':''))).']|/\\*|-- |$'.($w=="pgsql"?'|\\$[^$]*\\$':'');$sh=microtime(true);parse_str($_COOKIE["adminer_export"],$xa);$dc=$b->dumpFormat();unset($dc["sql"]);while($H!=""){if(!$D&&preg_match("~^$Eg*DELIMITER\\s+(\\S+)~i",$H,$B)){$Nb=$B[1];$H=substr($H,strlen($B[0]));}else{preg_match('('.preg_quote($Nb)."\\s*|$lf)",$H,$B,PREG_OFFSET_CAPTURE,$D);list($Qc,$xf)=$B[0];if(!$Qc&&$Sc&&!feof($Sc))$H.=fread($Sc,1e5);else{if(!$Qc&&rtrim($H)=="")break;$D=$xf+strlen($Qc);if($Qc&&rtrim($Qc)!=$Nb){while(preg_match('('.($Qc=='/*'?'\\*/':($Qc=='['?']':(preg_match('~^-- |^#~',$Qc)?"\n":preg_quote($Qc)."|\\\\."))).'|$)s',$H,$B,PREG_OFFSET_CAPTURE,$D)){$mg=$B[0][0];if(!$mg&&$Sc&&!feof($Sc))$H.=fread($Sc,1e5);else{$D=$B[0][1]+strlen($mg);if($mg[0]!="\\")break;}}}else{$mc=false;$Lf=substr($H,0,$xf);$qb++;$Ef="<pre id='sql-$qb'><code class='jush-$w'>".shorten_utf8(trim($Lf),1000)."</code></pre>\n";if(!$_POST["only_errors"]){echo$Ef;ob_flush();flush();}$Hg=microtime(true);if($h->multi_query($Lf)&&is_object($i)&&preg_match("~^$Eg*USE\\b~isU",$Lf))$i->query($Lf);do{$I=$h->store_result();$ih=" <span class='time'>(".format_time($Hg).")</span>".(strlen($Lf)<1000?" <a href='".h(ME)."sql=".urlencode(trim($Lf))."'>".lang(10)."</a>":"");if($h->error){echo($_POST["only_errors"]?$Ef:""),"<p class='error'>".lang(136).($h->errno?" ($h->errno)":"").": ".error()."\n";$rc[]=" <a href='#sql-$qb'>$qb</a>";if($_POST["error_stops"])break
     56992;}elseif(is_object($I)){$z=$_POST["limit"];$af=select($I,$i,array(),$z);if(!$_POST["only_errors"]){echo"<form action='' method='post'>\n";$De=$I->num_rows;echo"<p>".($De?($z&&$De>$z?lang(137,$z):"").lang(138,$De):""),$ih;$jd="export-$qb";$_c=", <a href='#$jd' onclick=\"return !toggle('$jd');\">".lang(65)."</a><span id='$jd' class='hidden'>: ".html_select("output",$b->dumpOutput(),$xa["output"])." ".html_select("format",$dc,$xa["format"])."<input type='hidden' name='query' value='".h($Lf)."'>"." <input type='submit' name='export' value='".lang(65)."'><input type='hidden' name='token' value='$T'></span>\n";if($i&&preg_match("~^($Eg|\\()*SELECT\\b~isU",$Lf)&&($zc=explain($i,$Lf))){$jd="explain-$qb";echo", <a href='#$jd' onclick=\"return !toggle('$jd');\">EXPLAIN</a>$_c","<div id='$jd' class='hidden'>\n";select($zc,$i,$af);echo"</div>\n";}else
     5700echo$_c;echo"</form>\n";}}else{if(preg_match("~^$Eg*(CREATE|DROP|ALTER)$Eg+(DATABASE|SCHEMA)\\b~isU",$Lf)){restart_session();set_session("dbs",null);stop_session();}if(!$_POST["only_errors"])echo"<p class='message' title='".h($h->info)."'>".lang(139,$h->affected_rows)."$ih\n";}$Hg=microtime(true);}while($h->next_result());$Yd+=substr_count($Lf.$Qc,"\n");$H=substr($H,$D);$D=0;}}}}if($mc)echo"<p class='message'>".lang(140)."\n";elseif($_POST["only_errors"]){echo"<p class='message'>".lang(141,$qb-count($rc))," <span class='time'>(".format_time($sh).")</span>\n";}elseif($rc&&$qb>1)echo"<p class='error'>".lang(136).": ".implode("",$rc)."\n";}else
    56875701echo"<p class='error'>".upload_error($H)."\n";}echo'
    56885702<form action="" method="post" enctype="multipart/form-data" id="form">
    5689 ';$xc="<input type='submit' value='".lang(142)."' title='Ctrl+Enter'>";if(!isset($_GET["import"])){$Lf=$_GET["sql"];if($_POST)$Lf=$_POST["query"];elseif($_GET["history"]=="all")$Lf=$fd;elseif($_GET["history"]!="")$Lf=$fd[$_GET["history"]][0];echo"<p>";textarea("query",$Lf,20);echo($_POST?"":"<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n"),"<p>$xc\n",lang(143).": <input type='number' name='limit' class='size' value='".h($_POST?$_POST["limit"]:$_GET["limit"])."'>\n";}else{echo"<fieldset><legend>".lang(144)."</legend><div>",(ini_bool("file_uploads")?"SQL (&lt; ".ini_get("upload_max_filesize")."B): <input type='file' name='sql_file[]' multiple>\n$xc":lang(145)),"</div></fieldset>\n","<fieldset><legend>".lang(146)."</legend><div>",lang(147,"<code>adminer.sql".(extension_loaded("zlib")?"[.gz]":"")."</code>"),' <input type="submit" name="webfile" value="'.lang(148).'">',"</div></fieldset>\n","<p>";}echo
    5690 checkbox("error_stops",1,($_POST?$_POST["error_stops"]:isset($_GET["import"])),lang(149))."\n",checkbox("only_errors",1,($_POST?$_POST["only_errors"]:isset($_GET["import"])),lang(150))."\n","<input type='hidden' name='token' value='$T'>\n";if(!isset($_GET["import"])&&$fd){print_fieldset("history",lang(151),$_GET["history"]!="");for($X=end($fd);$X;$X=prev($fd)){$x=key($fd);list($Lf,$ih,$ic)=$X;echo'<a href="'.h(ME."sql=&history=$x").'">'.lang(10)."</a>"." <span class='time' title='".@date('Y-m-d',$ih)."'>".@date("H:i:s",$ih)."</span>"." <code class='jush-$w'>".shorten_utf8(ltrim(str_replace("\n"," ",str_replace("\r","",preg_replace('~^(#|-- ).*~m','',$Lf)))),80,"</code>").($ic?" <span class='time'>($ic)</span>":"")."<br>\n";}echo"<input type='submit' name='clear' value='".lang(152)."'>\n","<a href='".h(ME."sql=&history=all")."'>".lang(153)."</a>\n","</div></fieldset>\n";}echo'</form>
    5691 ';}elseif(isset($_GET["edit"])){$a=$_GET["edit"];$o=fields($a);$Z=(isset($_GET["select"])?(count($_POST["check"])==1?where_check($_POST["check"][0],$o):""):where($_GET,$o));$Jh=(isset($_GET["select"])?$_POST["edit"]:$Z);foreach($o
    5692 as$C=>$n){if(!isset($n["privileges"][$Jh?"update":"insert"])||$b->fieldName($n)=="")unset($o[$C]);}if($_POST&&!$m&&!isset($_GET["select"])){$A=$_POST["referer"];if($_POST["insert"])$A=($Jh?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$A))$A=ME."select=".urlencode($a);$v=indexes($a);$Eh=unique_array($_GET["where"],$v);$Of="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($A,lang(154),$Xb->delete($a,$Of,!$Eh));else{$O=array();foreach($o
    5693 as$C=>$n){$X=process_input($n);if($X!==false&&$X!==null)$O[idf_escape($C)]=$X;}if($Jh){if(!$O)redirect($A);queries_redirect($A,lang(155),$Xb->update($a,$O,$Of,!$Eh));if(is_ajax()){page_headers();page_messages($m);exit;}}else{$I=$Xb->insert($a,$O);$Rd=($I?last_id():0);queries_redirect($A,lang(156,($Rd?" $Rd":"")),$I);}}}$K=null;if($_POST["save"])$K=(array)$_POST["fields"];elseif($Z){$M=array();foreach($o
    5694 as$C=>$n){if(isset($n["privileges"]["select"])){$Ga=convert_field($n);if($_POST["clone"]&&$n["auto_increment"])$Ga="''";if($w=="sql"&&preg_match("~enum|set~",$n["type"]))$Ga="1*".idf_escape($C);$M[]=($Ga?"$Ga AS ":"").idf_escape($C);}}$K=array();if(!support("table"))$M=array("*");if($M){$I=$Xb->select($a,$M,array($Z),$M,array(),(isset($_GET["select"])?2:1));$K=$I->fetch_assoc();if(!$K)$K=false;if(isset($_GET["select"])&&(!$K||$I->fetch_assoc()))$K=null;}}if(!support("table")&&!$o){if(!$Z){$I=$Xb->select($a,array("*"),$Z,array("*"));$K=($I?$I->fetch_assoc():false);if(!$K)$K=array($Xb->primary=>"");}if($K){foreach($K
    5695 as$x=>$X){if(!$Z)$K[$x]=null;$o[$x]=array("field"=>$x,"null"=>($x!=$Xb->primary),"auto_increment"=>($x==$Xb->primary));}}}edit_form($a,$o,$K,$Jh);}elseif(isset($_GET["create"])){$a=$_GET["create"];$mf=array();foreach(array('HASH','LINEAR HASH','KEY','LINEAR KEY','RANGE','LIST')as$x)$mf[$x]=$x;$Vf=referencable_primary($a);$Pc=array();foreach($Vf
    5696 as$Tg=>$n)$Pc[str_replace("`","``",$Tg)."`".str_replace("`","``",$n["field"])]=$Tg;$df=array();$R=array();if($a!=""){$df=fields($a);$R=table_status($a);if(!$R)$m=lang(9);}$K=$_POST;$K["fields"]=(array)$K["fields"];if($K["auto_increment_col"])$K["fields"][$K["auto_increment_col"]]["auto_increment"]=true;if($_POST&&!process_fields($K["fields"])&&!$m){if($_POST["drop"])queries_redirect(substr(ME,0,-1),lang(157),drop_tables(array($a)));else{$o=array();$Da=array();$Nh=false;$Nc=array();ksort($K["fields"]);$cf=reset($df);$Aa=" FIRST";foreach($K["fields"]as$x=>$n){$p=$Pc[$n["type"]];$_h=($p!==null?$Vf[$p]:$n);if($n["field"]!=""){if(!$n["has_default"])$n["default"]=null;if($x==$K["auto_increment_col"])$n["auto_increment"]=true;$Jf=process_field($n,$_h);$Da[]=array($n["orig"],$Jf,$Aa);if($Jf!=process_field($cf,$cf)){$o[]=array($n["orig"],$Jf,$Aa);if($n["orig"]!=""||$Aa)$Nh=true;}if($p!==null)$Nc[idf_escape($n["field"])]=($a!=""&&$w!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$Pc[$n["type"]],'source'=>array($n["field"]),'target'=>array($_h["field"]),'on_delete'=>$n["on_delete"],));$Aa=" AFTER ".idf_escape($n["field"]);}elseif($n["orig"]!=""){$Nh=true;$o[]=array($n["orig"]);}if($n["orig"]!=""){$cf=next($df);if(!$cf)$Aa="";}}$of="";if($mf[$K["partition_by"]]){$pf=array();if($K["partition_by"]=='RANGE'||$K["partition_by"]=='LIST'){foreach(array_filter($K["partition_names"])as$x=>$X){$Y=$K["partition_values"][$x];$pf[]="\n  PARTITION ".idf_escape($X)." VALUES ".($K["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$of.="\nPARTITION BY $K[partition_by]($K[partition])".($pf?" (".implode(",",$pf)."\n)":($K["partitions"]?" PARTITIONS ".(+$K["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$of.="\nREMOVE PARTITIONING";$me=lang(158);if($a==""){cookie("adminer_engine",$K["Engine"]);$me=lang(159);}$C=trim($K["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($C),$me,alter_table($a,$C,($w=="sqlite"&&($Nh||$Nc)?$Da:$o),$Nc,($K["Comment"]!=$R["Comment"]?$K["Comment"]:null),($K["Engine"]&&$K["Engine"]!=$R["Engine"]?$K["Engine"]:""),($K["Collation"]&&$K["Collation"]!=$R["Collation"]?$K["Collation"]:""),($K["Auto_increment"]!=""?number($K["Auto_increment"]):""),$of));}}page_header(($a!=""?lang(41):lang(66)),$m,array("table"=>$a),h($a));if(!$_POST){$K=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($Bh["int"])?"int":(isset($Bh["integer"])?"integer":"")))),"partition_names"=>array(""),);if($a!=""){$K=$R;$K["name"]=$a;$K["fields"]=array();if(!$_GET["auto_increment"])$K["Auto_increment"]="";foreach($df
    5697 as$n){$n["has_default"]=isset($n["default"]);$K["fields"][]=$n;}if(support("partitioning")){$Uc="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$I=$h->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $Uc ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($K["partition_by"],$K["partitions"],$K["partition"])=$I->fetch_row();$pf=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $Uc AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$pf[""]="";$K["partition_names"]=array_keys($pf);$K["partition_values"]=array_values($pf);}}}$nb=collations();$pc=engines();foreach($pc
    5698 as$oc){if(!strcasecmp($oc,$K["Engine"])){$K["Engine"]=$oc;break;}}echo'
     5703';$wc="<input type='submit' value='".lang(142)."' title='Ctrl+Enter'>";if(!isset($_GET["import"])){$Lf=$_GET["sql"];if($_POST)$Lf=$_POST["query"];elseif($_GET["history"]=="all")$Lf=$ed;elseif($_GET["history"]!="")$Lf=$ed[$_GET["history"]][0];echo"<p>";textarea("query",$Lf,20);echo($_POST?"":"<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n"),"<p>$wc\n",lang(143).": <input type='number' name='limit' class='size' value='".h($_POST?$_POST["limit"]:$_GET["limit"])."'>\n";}else{echo"<fieldset><legend>".lang(144)."</legend><div>",(ini_bool("file_uploads")?"SQL (&lt; ".ini_get("upload_max_filesize")."B): <input type='file' name='sql_file[]' multiple>\n$wc":lang(145)),"</div></fieldset>\n","<fieldset><legend>".lang(146)."</legend><div>",lang(147,"<code>adminer.sql".(extension_loaded("zlib")?"[.gz]":"")."</code>"),' <input type="submit" name="webfile" value="'.lang(148).'">',"</div></fieldset>\n","<p>";}echo
     5704checkbox("error_stops",1,($_POST?$_POST["error_stops"]:isset($_GET["import"])),lang(149))."\n",checkbox("only_errors",1,($_POST?$_POST["only_errors"]:isset($_GET["import"])),lang(150))."\n","<input type='hidden' name='token' value='$T'>\n";if(!isset($_GET["import"])&&$ed){print_fieldset("history",lang(151),$_GET["history"]!="");for($X=end($ed);$X;$X=prev($ed)){$x=key($ed);list($Lf,$ih,$hc)=$X;echo'<a href="'.h(ME."sql=&history=$x").'">'.lang(10)."</a>"." <span class='time' title='".@date('Y-m-d',$ih)."'>".@date("H:i:s",$ih)."</span>"." <code class='jush-$w'>".shorten_utf8(ltrim(str_replace("\n"," ",str_replace("\r","",preg_replace('~^(#|-- ).*~m','',$Lf)))),80,"</code>").($hc?" <span class='time'>($hc)</span>":"")."<br>\n";}echo"<input type='submit' name='clear' value='".lang(152)."'>\n","<a href='".h(ME."sql=&history=all")."'>".lang(153)."</a>\n","</div></fieldset>\n";}echo'</form>
     5705';}elseif(isset($_GET["edit"])){$a=$_GET["edit"];$p=fields($a);$Z=(isset($_GET["select"])?(count($_POST["check"])==1?where_check($_POST["check"][0],$p):""):where($_GET,$p));$Jh=(isset($_GET["select"])?$_POST["edit"]:$Z);foreach($p
     5706as$C=>$o){if(!isset($o["privileges"][$Jh?"update":"insert"])||$b->fieldName($o)=="")unset($p[$C]);}if($_POST&&!$n&&!isset($_GET["select"])){$A=$_POST["referer"];if($_POST["insert"])$A=($Jh?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$A))$A=ME."select=".urlencode($a);$v=indexes($a);$Eh=unique_array($_GET["where"],$v);$Of="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($A,lang(154),$Wb->delete($a,$Of,!$Eh));else{$O=array();foreach($p
     5707as$C=>$o){$X=process_input($o);if($X!==false&&$X!==null)$O[idf_escape($C)]=$X;}if($Jh){if(!$O)redirect($A);queries_redirect($A,lang(155),$Wb->update($a,$O,$Of,!$Eh));if(is_ajax()){page_headers();page_messages($n);exit;}}else{$I=$Wb->insert($a,$O);$Rd=($I?last_id():0);queries_redirect($A,lang(156,($Rd?" $Rd":"")),$I);}}}$K=null;if($_POST["save"])$K=(array)$_POST["fields"];elseif($Z){$M=array();foreach($p
     5708as$C=>$o){if(isset($o["privileges"]["select"])){$Ga=convert_field($o);if($_POST["clone"]&&$o["auto_increment"])$Ga="''";if($w=="sql"&&preg_match("~enum|set~",$o["type"]))$Ga="1*".idf_escape($C);$M[]=($Ga?"$Ga AS ":"").idf_escape($C);}}$K=array();if(!support("table"))$M=array("*");if($M){$I=$Wb->select($a,$M,array($Z),$M,array(),(isset($_GET["select"])?2:1));$K=$I->fetch_assoc();if(!$K)$K=false;if(isset($_GET["select"])&&(!$K||$I->fetch_assoc()))$K=null;}}if(!support("table")&&!$p){if(!$Z){$I=$Wb->select($a,array("*"),$Z,array("*"));$K=($I?$I->fetch_assoc():false);if(!$K)$K=array($Wb->primary=>"");}if($K){foreach($K
     5709as$x=>$X){if(!$Z)$K[$x]=null;$p[$x]=array("field"=>$x,"null"=>($x!=$Wb->primary),"auto_increment"=>($x==$Wb->primary));}}}edit_form($a,$p,$K,$Jh);}elseif(isset($_GET["create"])){$a=$_GET["create"];$mf=array();foreach(array('HASH','LINEAR HASH','KEY','LINEAR KEY','RANGE','LIST')as$x)$mf[$x]=$x;$Vf=referencable_primary($a);$Oc=array();foreach($Vf
     5710as$Tg=>$o)$Oc[str_replace("`","``",$Tg)."`".str_replace("`","``",$o["field"])]=$Tg;$df=array();$R=array();if($a!=""){$df=fields($a);$R=table_status($a);if(!$R)$n=lang(9);}$K=$_POST;$K["fields"]=(array)$K["fields"];if($K["auto_increment_col"])$K["fields"][$K["auto_increment_col"]]["auto_increment"]=true;if($_POST&&!process_fields($K["fields"])&&!$n){if($_POST["drop"])queries_redirect(substr(ME,0,-1),lang(157),drop_tables(array($a)));else{$p=array();$Da=array();$Nh=false;$Mc=array();ksort($K["fields"]);$cf=reset($df);$Aa=" FIRST";foreach($K["fields"]as$x=>$o){$q=$Oc[$o["type"]];$_h=($q!==null?$Vf[$q]:$o);if($o["field"]!=""){if(!$o["has_default"])$o["default"]=null;if($x==$K["auto_increment_col"])$o["auto_increment"]=true;$Jf=process_field($o,$_h);$Da[]=array($o["orig"],$Jf,$Aa);if($Jf!=process_field($cf,$cf)){$p[]=array($o["orig"],$Jf,$Aa);if($o["orig"]!=""||$Aa)$Nh=true;}if($q!==null)$Mc[idf_escape($o["field"])]=($a!=""&&$w!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$Oc[$o["type"]],'source'=>array($o["field"]),'target'=>array($_h["field"]),'on_delete'=>$o["on_delete"],));$Aa=" AFTER ".idf_escape($o["field"]);}elseif($o["orig"]!=""){$Nh=true;$p[]=array($o["orig"]);}if($o["orig"]!=""){$cf=next($df);if(!$cf)$Aa="";}}$of="";if($mf[$K["partition_by"]]){$pf=array();if($K["partition_by"]=='RANGE'||$K["partition_by"]=='LIST'){foreach(array_filter($K["partition_names"])as$x=>$X){$Y=$K["partition_values"][$x];$pf[]="\n  PARTITION ".idf_escape($X)." VALUES ".($K["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$of.="\nPARTITION BY $K[partition_by]($K[partition])".($pf?" (".implode(",",$pf)."\n)":($K["partitions"]?" PARTITIONS ".(+$K["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$of.="\nREMOVE PARTITIONING";$me=lang(158);if($a==""){cookie("adminer_engine",$K["Engine"]);$me=lang(159);}$C=trim($K["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($C),$me,alter_table($a,$C,($w=="sqlite"&&($Nh||$Mc)?$Da:$p),$Mc,($K["Comment"]!=$R["Comment"]?$K["Comment"]:null),($K["Engine"]&&$K["Engine"]!=$R["Engine"]?$K["Engine"]:""),($K["Collation"]&&$K["Collation"]!=$R["Collation"]?$K["Collation"]:""),($K["Auto_increment"]!=""?number($K["Auto_increment"]):""),$of));}}page_header(($a!=""?lang(41):lang(66)),$n,array("table"=>$a),h($a));if(!$_POST){$K=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($Bh["int"])?"int":(isset($Bh["integer"])?"integer":"")))),"partition_names"=>array(""),);if($a!=""){$K=$R;$K["name"]=$a;$K["fields"]=array();if(!$_GET["auto_increment"])$K["Auto_increment"]="";foreach($df
     5711as$o){$o["has_default"]=isset($o["default"]);$K["fields"][]=$o;}if(support("partitioning")){$Tc="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$I=$h->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $Tc ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($K["partition_by"],$K["partitions"],$K["partition"])=$I->fetch_row();$pf=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $Tc AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$pf[""]="";$K["partition_names"]=array_keys($pf);$K["partition_values"]=array_values($pf);}}}$nb=collations();$oc=engines();foreach($oc
     5712as$nc){if(!strcasecmp($nc,$K["Engine"])){$K["Engine"]=$nc;break;}}echo'
    56995713<form action="" method="post" id="form">
    57005714<p>
    57015715';if(support("columns")||$a==""){echo
    57025716lang(160),': <input name="name" maxlength="64" value="',h($K["name"]),'" autocapitalize="off">
    5703 ';if($a==""&&!$_POST){?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php }echo($pc?"<select name='Engine' onchange='helpClose();'".on_help("getTarget(event).value",1).">".optionlist(array(""=>"(".lang(161).")")+$pc,$K["Engine"])."</select>":""),' ',($nb&&!preg_match("~sqlite|mssql~",$w)?html_select("Collation",array(""=>"(".lang(87).")")+$nb,$K["Collation"]):""),' <input type="submit" value="',lang(14),'">
     5717';if($a==""&&!$_POST){?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php }echo($oc?"<select name='Engine' onchange='helpClose();'".on_help("getTarget(event).value",1).">".optionlist(array(""=>"(".lang(161).")")+$oc,$K["Engine"])."</select>":""),' ',($nb&&!preg_match("~sqlite|mssql~",$w)?html_select("Collation",array(""=>"(".lang(87).")")+$nb,$K["Collation"]):""),' <input type="submit" value="',lang(14),'">
    57045718';}echo'
    57055719';if(support("columns")){echo'<table cellspacing="0" id="edit-fields" class="nowrap">
    5706 ';$sb=($_POST?$_POST["comments"]:$K["Comment"]!="");if(!$_POST&&!$sb){foreach($K["fields"]as$n){if($n["comment"]!=""){$sb=true;break;}}}edit_fields($K["fields"],$nb,"TABLE",$Pc,$sb);echo'</table>
     5720';$sb=($_POST?$_POST["comments"]:$K["Comment"]!="");if(!$_POST&&!$sb){foreach($K["fields"]as$o){if($o["comment"]!=""){$sb=true;break;}}}edit_fields($K["fields"],$nb,"TABLE",$Oc,$sb);echo'</table>
    57075721<p>
    57085722',lang(56),': <input type="number" name="Auto_increment" size="6" value="',h($K["Auto_increment"]),'">
     
    57195733';}echo'<input type="hidden" name="token" value="',$T,'">
    57205734</form>
    5721 ';}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$pd=array("PRIMARY","UNIQUE","INDEX");$R=table_status($a,true);if(preg_match('~MyISAM|M?aria'.($h->server_info>=5.6?'|InnoDB':'').'~i',$R["Engine"]))$pd[]="FULLTEXT";$v=indexes($a);$Cf=array();if($w=="mongo"){$Cf=$v["_id_"];unset($pd[0]);unset($v["_id_"]);}$K=$_POST;if($_POST&&!$m&&!$_POST["add"]&&!$_POST["drop_col"]){$c=array();foreach($K["indexes"]as$u){$C=$u["name"];if(in_array($u["type"],$pd)){$f=array();$Wd=array();$Qb=array();$O=array();ksort($u["columns"]);foreach($u["columns"]as$x=>$e){if($e!=""){$y=$u["lengths"][$x];$Pb=$u["descs"][$x];$O[]=idf_escape($e).($y?"(".(+$y).")":"").($Pb?" DESC":"");$f[]=$e;$Wd[]=($y?$y:null);$Qb[]=$Pb;}}if($f){$yc=$v[$C];if($yc){ksort($yc["columns"]);ksort($yc["lengths"]);ksort($yc["descs"]);if($u["type"]==$yc["type"]&&array_values($yc["columns"])===$f&&(!$yc["lengths"]||array_values($yc["lengths"])===$Wd)&&array_values($yc["descs"])===$Qb){unset($v[$C]);continue;}}$c[]=array($u["type"],$C,$O);}}}foreach($v
    5722 as$C=>$yc)$c[]=array($yc["type"],$C,"DROP");if(!$c)redirect(ME."table=".urlencode($a));queries_redirect(ME."table=".urlencode($a),lang(167),alter_indexes($a,$c));}page_header(lang(121),$m,array("table"=>$a),h($a));$o=array_keys(fields($a));if($_POST["add"]){foreach($K["indexes"]as$x=>$u){if($u["columns"][count($u["columns"])]!="")$K["indexes"][$x]["columns"][]="";}$u=end($K["indexes"]);if($u["type"]||array_filter($u["columns"],'strlen'))$K["indexes"][]=array("columns"=>array(1=>""));}if(!$K){foreach($v
     5735';}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$pd=array("PRIMARY","UNIQUE","INDEX");$R=table_status($a,true);if(preg_match('~MyISAM|M?aria'.($h->server_info>=5.6?'|InnoDB':'').'~i',$R["Engine"]))$pd[]="FULLTEXT";$v=indexes($a);$Cf=array();if($w=="mongo"){$Cf=$v["_id_"];unset($pd[0]);unset($v["_id_"]);}$K=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["drop_col"]){$c=array();foreach($K["indexes"]as$u){$C=$u["name"];if(in_array($u["type"],$pd)){$f=array();$Wd=array();$Pb=array();$O=array();ksort($u["columns"]);foreach($u["columns"]as$x=>$e){if($e!=""){$y=$u["lengths"][$x];$Ob=$u["descs"][$x];$O[]=idf_escape($e).($y?"(".(+$y).")":"").($Ob?" DESC":"");$f[]=$e;$Wd[]=($y?$y:null);$Pb[]=$Ob;}}if($f){$xc=$v[$C];if($xc){ksort($xc["columns"]);ksort($xc["lengths"]);ksort($xc["descs"]);if($u["type"]==$xc["type"]&&array_values($xc["columns"])===$f&&(!$xc["lengths"]||array_values($xc["lengths"])===$Wd)&&array_values($xc["descs"])===$Pb){unset($v[$C]);continue;}}$c[]=array($u["type"],$C,$O);}}}foreach($v
     5736as$C=>$xc)$c[]=array($xc["type"],$C,"DROP");if(!$c)redirect(ME."table=".urlencode($a));queries_redirect(ME."table=".urlencode($a),lang(167),alter_indexes($a,$c));}page_header(lang(121),$n,array("table"=>$a),h($a));$p=array_keys(fields($a));if($_POST["add"]){foreach($K["indexes"]as$x=>$u){if($u["columns"][count($u["columns"])]!="")$K["indexes"][$x]["columns"][]="";}$u=end($K["indexes"]);if($u["type"]||array_filter($u["columns"],'strlen'))$K["indexes"][]=array("columns"=>array(1=>""));}if(!$K){foreach($v
    57235737as$x=>$u){$v[$x]["name"]=$x;$v[$x]["columns"][]="";}$v[]=array("columns"=>array(1=>""));$K["indexes"]=$v;}echo'
    57245738<form action="" method="post">
     
    57265740<thead><tr>
    57275741<th>',lang(168),'<th><input type="submit" style="left: -1000px; position: absolute;">',lang(169),'<th>',lang(170);?>
    5728 <th><noscript><input type='image' class='icon' name='add[0]' src='" . h(preg_replace("~\\?.*~", "", ME)) . "?file=plus.gif&amp;version=4.2.0' alt='+' title='<?php echo
     5742<th><noscript><input type='image' class='icon' name='add[0]' src='" . h(preg_replace("~\\?.*~", "", ME)) . "?file=plus.gif&amp;version=4.2.1' alt='+' title='<?php echo
    57295743lang(97),'\'></noscript>&nbsp;
    57305744</thead>
    57315745';if($Cf){echo"<tr><td>PRIMARY<td>";foreach($Cf["columns"]as$x=>$e){echo
    5732 select_input(" disabled",$o,$e),"<label><input disabled type='checkbox'>".lang(50)."</label> ";}echo"<td><td>\n";}$Fd=1;foreach($K["indexes"]as$u){if(!$_POST["drop_col"]||$Fd!=key($_POST["drop_col"])){echo"<tr><td>".html_select("indexes[$Fd][type]",array(-1=>"")+$pd,$u["type"],($Fd==count($K["indexes"])?"indexesAddRow(this);":1)),"<td>";ksort($u["columns"]);$r=1;foreach($u["columns"]as$x=>$e){echo"<span>".select_input(" name='indexes[$Fd][columns][$r]' onchange=\"".($r==count($u["columns"])?"indexesAddColumn":"indexesChangeColumn")."(this, '".js_escape($w=="sql"?"":$_GET["indexes"]."_")."');\"",($o?array_combine($o,$o):$o),$e),($w=="sql"||$w=="mssql"?"<input type='number' name='indexes[$Fd][lengths][$r]' class='size' value='".h($u["lengths"][$x])."'>":""),($w!="sql"?checkbox("indexes[$Fd][descs][$r]",1,$u["descs"][$x],lang(50)):"")," </span>";$r++;}echo"<td><input name='indexes[$Fd][name]' value='".h($u["name"])."' autocapitalize='off'>\n","<td><input type='image' class='icon' name='drop_col[$Fd]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&amp;version=4.2.0' alt='x' title='".lang(100)."' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";}$Fd++;}echo'</table>
     5746select_input(" disabled",$p,$e),"<label><input disabled type='checkbox'>".lang(50)."</label> ";}echo"<td><td>\n";}$Fd=1;foreach($K["indexes"]as$u){if(!$_POST["drop_col"]||$Fd!=key($_POST["drop_col"])){echo"<tr><td>".html_select("indexes[$Fd][type]",array(-1=>"")+$pd,$u["type"],($Fd==count($K["indexes"])?"indexesAddRow(this);":1)),"<td>";ksort($u["columns"]);$s=1;foreach($u["columns"]as$x=>$e){echo"<span>".select_input(" name='indexes[$Fd][columns][$s]' onchange=\"".($s==count($u["columns"])?"indexesAddColumn":"indexesChangeColumn")."(this, '".js_escape($w=="sql"?"":$_GET["indexes"]."_")."');\"",($p?array_combine($p,$p):$p),$e),($w=="sql"||$w=="mssql"?"<input type='number' name='indexes[$Fd][lengths][$s]' class='size' value='".h($u["lengths"][$x])."'>":""),($w!="sql"?checkbox("indexes[$Fd][descs][$s]",1,$u["descs"][$x],lang(50)):"")," </span>";$s++;}echo"<td><input name='indexes[$Fd][name]' value='".h($u["name"])."' autocapitalize='off'>\n","<td><input type='image' class='icon' name='drop_col[$Fd]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&amp;version=4.2.1' alt='x' title='".lang(100)."' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";}$Fd++;}echo'</table>
    57335747<p>
    57345748<input type="submit" value="',lang(14),'">
    57355749<input type="hidden" name="token" value="',$T,'">
    57365750</form>
    5737 ';}elseif(isset($_GET["database"])){$K=$_POST;if($_POST&&!$m&&!isset($_POST["add_x"])){$C=trim($K["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),lang(171),drop_databases(array(DB)));}elseif(DB!==$C){if(DB!=""){$_GET["db"]=$C;queries_redirect(preg_replace('~\bdb=[^&]*&~','',ME)."db=".urlencode($C),lang(172),rename_database($C,$K["collation"]));}else{$k=explode("\n",str_replace("\r","",$C));$Ng=true;$Qd="";foreach($k
    5738 as$l){if(count($k)==1||$l!=""){if(!create_database($l,$K["collation"]))$Ng=false;$Qd=$l;}}restart_session();set_session("dbs",null);queries_redirect(ME."db=".urlencode($Qd),lang(173),$Ng);}}else{if(!$K["collation"])redirect(substr(ME,0,-1));query_redirect("ALTER DATABASE ".idf_escape($C).(preg_match('~^[a-z0-9_]+$~i',$K["collation"])?" COLLATE $K[collation]":""),substr(ME,0,-1),lang(174));}}page_header(DB!=""?lang(59):lang(175),$m,array(),h(DB));$nb=collations();$C=DB;if($_POST)$C=$K["name"];elseif(DB!="")$K["collation"]=db_collation(DB,$nb);elseif($w=="sql"){foreach(get_vals("SHOW GRANTS")as$Wc){if(preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~',$Wc,$B)&&$B[1]){$C=stripcslashes(idf_unescape("`$B[2]`"));break;}}}echo'
     5751';}elseif(isset($_GET["database"])){$K=$_POST;if($_POST&&!$n&&!isset($_POST["add_x"])){$C=trim($K["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),lang(171),drop_databases(array(DB)));}elseif(DB!==$C){if(DB!=""){$_GET["db"]=$C;queries_redirect(preg_replace('~\bdb=[^&]*&~','',ME)."db=".urlencode($C),lang(172),rename_database($C,$K["collation"]));}else{$l=explode("\n",str_replace("\r","",$C));$Ng=true;$Qd="";foreach($l
     5752as$m){if(count($l)==1||$m!=""){if(!create_database($m,$K["collation"]))$Ng=false;$Qd=$m;}}restart_session();set_session("dbs",null);queries_redirect(ME."db=".urlencode($Qd),lang(173),$Ng);}}else{if(!$K["collation"])redirect(substr(ME,0,-1));query_redirect("ALTER DATABASE ".idf_escape($C).(preg_match('~^[a-z0-9_]+$~i',$K["collation"])?" COLLATE $K[collation]":""),substr(ME,0,-1),lang(174));}}page_header(DB!=""?lang(59):lang(175),$n,array(),h(DB));$nb=collations();$C=DB;if($_POST)$C=$K["name"];elseif(DB!="")$K["collation"]=db_collation(DB,$nb);elseif($w=="sql"){foreach(get_vals("SHOW GRANTS")as$Vc){if(preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~',$Vc,$B)&&$B[1]){$C=stripcslashes(idf_unescape("`$B[2]`"));break;}}}echo'
    57395753<form action="" method="post">
    57405754<p>
     
    57435757<input type="submit" value="<?php echo
    57445758lang(14),'">
    5745 ';if(DB!="")echo"<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n";elseif(!$_POST["add_x"]&&$_GET["db"]=="")echo"<input type='image' class='icon' name='add' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.0' alt='+' title='".lang(97)."'>\n";echo'<input type="hidden" name="token" value="',$T,'">
     5759';if(DB!="")echo"<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n";elseif(!$_POST["add_x"]&&$_GET["db"]=="")echo"<input type='image' class='icon' name='add' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&amp;version=4.2.1' alt='+' title='".lang(97)."'>\n";echo'<input type="hidden" name="token" value="',$T,'">
    57465760</form>
    5747 ';}elseif(isset($_GET["scheme"])){$K=$_POST;if($_POST&&!$m){$_=preg_replace('~ns=[^&]*&~','',ME)."ns=";if($_POST["drop"])query_redirect("DROP SCHEMA ".idf_escape($_GET["ns"]),$_,lang(176));else{$C=trim($K["name"]);$_.=urlencode($C);if($_GET["ns"]=="")query_redirect("CREATE SCHEMA ".idf_escape($C),$_,lang(177));elseif($_GET["ns"]!=$C)query_redirect("ALTER SCHEMA ".idf_escape($_GET["ns"])." RENAME TO ".idf_escape($C),$_,lang(178));else
    5748 redirect($_);}}page_header($_GET["ns"]!=""?lang(60):lang(61),$m);if(!$K)$K["name"]=$_GET["ns"];echo'
     5761';}elseif(isset($_GET["scheme"])){$K=$_POST;if($_POST&&!$n){$_=preg_replace('~ns=[^&]*&~','',ME)."ns=";if($_POST["drop"])query_redirect("DROP SCHEMA ".idf_escape($_GET["ns"]),$_,lang(176));else{$C=trim($K["name"]);$_.=urlencode($C);if($_GET["ns"]=="")query_redirect("CREATE SCHEMA ".idf_escape($C),$_,lang(177));elseif($_GET["ns"]!=$C)query_redirect("ALTER SCHEMA ".idf_escape($_GET["ns"])." RENAME TO ".idf_escape($C),$_,lang(178));else
     5762redirect($_);}}page_header($_GET["ns"]!=""?lang(60):lang(61),$n);if(!$K)$K["name"]=$_GET["ns"];echo'
    57495763<form action="" method="post">
    57505764<p><input name="name" id="name" value="',h($K["name"]);?>" autocapitalize="off">
     
    57545768';if($_GET["ns"]!="")echo"<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n";echo'<input type="hidden" name="token" value="',$T,'">
    57555769</form>
    5756 ';}elseif(isset($_GET["call"])){$da=$_GET["call"];page_header(lang(179).": ".h($da),$m);$ig=routine($da,(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$nd=array();$gf=array();foreach($ig["fields"]as$r=>$n){if(substr($n["inout"],-3)=="OUT")$gf[$r]="@".idf_escape($n["field"])." AS ".idf_escape($n["field"]);if(!$n["inout"]||substr($n["inout"],0,2)=="IN")$nd[]=$r;}if(!$m&&$_POST){$Ya=array();foreach($ig["fields"]as$x=>$n){if(in_array($x,$nd)){$X=process_input($n);if($X===false)$X="''";if(isset($gf[$x]))$h->query("SET @".idf_escape($n["field"])." = $X");}$Ya[]=(isset($gf[$x])?"@".idf_escape($n["field"]):$X);}$H=(isset($_GET["callf"])?"SELECT":"CALL")." ".idf_escape($da)."(".implode(", ",$Ya).")";echo"<p><code class='jush-$w'>".h($H)."</code> <a href='".h(ME)."sql=".urlencode($H)."'>".lang(10)."</a>\n";if(!$h->multi_query($H))echo"<p class='error'>".error()."\n";else{$i=connect();if(is_object($i))$i->select_db(DB);do{$I=$h->store_result();if(is_object($I))select($I,$i);else
     5770';}elseif(isset($_GET["call"])){$da=$_GET["call"];page_header(lang(179).": ".h($da),$n);$ig=routine($da,(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$nd=array();$gf=array();foreach($ig["fields"]as$s=>$o){if(substr($o["inout"],-3)=="OUT")$gf[$s]="@".idf_escape($o["field"])." AS ".idf_escape($o["field"]);if(!$o["inout"]||substr($o["inout"],0,2)=="IN")$nd[]=$s;}if(!$n&&$_POST){$Ya=array();foreach($ig["fields"]as$x=>$o){if(in_array($x,$nd)){$X=process_input($o);if($X===false)$X="''";if(isset($gf[$x]))$h->query("SET @".idf_escape($o["field"])." = $X");}$Ya[]=(isset($gf[$x])?"@".idf_escape($o["field"]):$X);}$H=(isset($_GET["callf"])?"SELECT":"CALL")." ".idf_escape($da)."(".implode(", ",$Ya).")";echo"<p><code class='jush-$w'>".h($H)."</code> <a href='".h(ME)."sql=".urlencode($H)."'>".lang(10)."</a>\n";if(!$h->multi_query($H))echo"<p class='error'>".error()."\n";else{$i=connect();if(is_object($i))$i->select_db(DB);do{$I=$h->store_result();if(is_object($I))select($I,$i);else
    57575771echo"<p class='message'>".lang(180,$h->affected_rows)."\n";}while($h->next_result());if($gf)select($h->query("SELECT ".implode(", ",$gf)));}}echo'
    57585772<form action="" method="post">
    57595773';if($nd){echo"<table cellspacing='0'>\n";foreach($nd
    5760 as$x){$n=$ig["fields"][$x];$C=$n["field"];echo"<tr><th>".$b->fieldName($n);$Y=$_POST["fields"][$C];if($Y!=""){if($n["type"]=="enum")$Y=+$Y;if($n["type"]=="set")$Y=array_sum($Y);}input($n,$Y,(string)$_POST["function"][$C]);echo"\n";}echo"</table>\n";}echo'<p>
     5774as$x){$o=$ig["fields"][$x];$C=$o["field"];echo"<tr><th>".$b->fieldName($o);$Y=$_POST["fields"][$C];if($Y!=""){if($o["type"]=="enum")$Y=+$Y;if($o["type"]=="set")$Y=array_sum($Y);}input($o,$Y,(string)$_POST["function"][$C]);echo"\n";}echo"</table>\n";}echo'<p>
    57615775<input type="submit" value="',lang(179),'">
    57625776<input type="hidden" name="token" value="',$T,'">
    57635777</form>
    5764 ';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$C=$_GET["name"];$K=$_POST;if($_POST&&!$m&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$me=($_POST["drop"]?lang(181):($C!=""?lang(182):lang(183)));$A=ME."table=".urlencode($a);$K["source"]=array_filter($K["source"],'strlen');ksort($K["source"]);$bh=array();foreach($K["source"]as$x=>$X)$bh[$x]=$K["target"][$x];$K["target"]=$bh;if($w=="sqlite")queries_redirect($A,$me,recreate_table($a,$a,array(),array(),array(" $C"=>($_POST["drop"]?"":" ".format_foreign_key($K)))));else{$c="ALTER TABLE ".table($a);$Zb="\nDROP ".($w=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($C);if($_POST["drop"])query_redirect($c.$Zb,$A,$me);else{query_redirect($c.($C!=""?"$Zb,":"")."\nADD".format_foreign_key($K),$A,$me);$m=lang(184)."<br>$m";}}}page_header(lang(185),$m,array("table"=>$a),h($a));if($_POST){ksort($K["source"]);if($_POST["add"])$K["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$K["target"]=array();}elseif($C!=""){$Pc=foreign_keys($a);$K=$Pc[$C];$K["source"][]="";}else{$K["table"]=$a;$K["source"]=array("");}$Dg=array_keys(fields($a));$bh=($a===$K["table"]?$Dg:array_keys(fields($K["table"])));$Uf=array_keys(array_filter(table_status('',true),'fk_support'));echo'
     5778';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$C=$_GET["name"];$K=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$me=($_POST["drop"]?lang(181):($C!=""?lang(182):lang(183)));$A=ME."table=".urlencode($a);$K["source"]=array_filter($K["source"],'strlen');ksort($K["source"]);$bh=array();foreach($K["source"]as$x=>$X)$bh[$x]=$K["target"][$x];$K["target"]=$bh;if($w=="sqlite")queries_redirect($A,$me,recreate_table($a,$a,array(),array(),array(" $C"=>($_POST["drop"]?"":" ".format_foreign_key($K)))));else{$c="ALTER TABLE ".table($a);$Yb="\nDROP ".($w=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($C);if($_POST["drop"])query_redirect($c.$Yb,$A,$me);else{query_redirect($c.($C!=""?"$Yb,":"")."\nADD".format_foreign_key($K),$A,$me);$n=lang(184)."<br>$n";}}}page_header(lang(185),$n,array("table"=>$a),h($a));if($_POST){ksort($K["source"]);if($_POST["add"])$K["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$K["target"]=array();}elseif($C!=""){$Oc=foreign_keys($a);$K=$Oc[$C];$K["source"][]="";}else{$K["table"]=$a;$K["source"]=array("");}$Dg=array_keys(fields($a));$bh=($a===$K["table"]?$Dg:array_keys(fields($K["table"])));$Uf=array_keys(array_filter(table_status('',true),'fk_support'));echo'
    57655779<form action="" method="post">
    57665780<p>
     
    57785792';}if($C!=""){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    57795793</form>
    5780 ';}elseif(isset($_GET["view"])){$a=$_GET["view"];$K=$_POST;if($_POST&&!$m){$C=trim($K["name"]);$Ga=" AS\n$K[select]";$A=ME."table=".urlencode($C);$me=lang(189);if($_GET["materialized"])$U="MATERIALIZED VIEW";else{$U="VIEW";if($w=="pgsql"){$Ig=table_status($C);$U=($Ig?strtoupper($Ig["Engine"]):$U);}}if(!$_POST["drop"]&&$a==$C&&$w!="sqlite"&&$U!="MATERIALIZED VIEW")query_redirect(($w=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($C).$Ga,$A,$me);else{$dh=$C."_adminer_".uniqid();drop_create("DROP $U ".table($a),"CREATE $U ".table($C).$Ga,"DROP $U ".table($C),"CREATE $U ".table($dh).$Ga,"DROP $U ".table($dh),($_POST["drop"]?substr(ME,0,-1):$A),lang(190),$me,lang(191),$a,$C);}}if(!$_POST&&$a!=""){$K=view($a);$K["name"]=$a;if(!$m)$m=error();}page_header(($a!=""?lang(40):lang(192)),$m,array("table"=>$a),h($a));echo'
     5794';}elseif(isset($_GET["view"])){$a=$_GET["view"];$K=$_POST;if($_POST&&!$n){$C=trim($K["name"]);$Ga=" AS\n$K[select]";$A=ME."table=".urlencode($C);$me=lang(189);if($_GET["materialized"])$U="MATERIALIZED VIEW";else{$U="VIEW";if($w=="pgsql"){$Ig=table_status($C);$U=($Ig?strtoupper($Ig["Engine"]):$U);}}if(!$_POST["drop"]&&$a==$C&&$w!="sqlite"&&$U!="MATERIALIZED VIEW")query_redirect(($w=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($C).$Ga,$A,$me);else{$dh=$C."_adminer_".uniqid();drop_create("DROP $U ".table($a),"CREATE $U ".table($C).$Ga,"DROP $U ".table($C),"CREATE $U ".table($dh).$Ga,"DROP $U ".table($dh),($_POST["drop"]?substr(ME,0,-1):$A),lang(190),$me,lang(191),$a,$C);}}if(!$_POST&&$a!=""){$K=view($a);$K["name"]=$a;if(!$n)$n=error();}page_header(($a!=""?lang(40):lang(192)),$n,array("table"=>$a),h($a));echo'
    57815795<form action="" method="post">
    57825796<p>',lang(170),': <input name="name" value="',h($K["name"]),'" maxlength="64" autocapitalize="off">
     
    57855799';if($_GET["view"]!=""){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    57865800</form>
    5787 ';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$xd=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$Jg=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$K=$_POST;if($_POST&&!$m){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),lang(193));elseif(in_array($K["INTERVAL_FIELD"],$xd)&&isset($Jg[$K["STATUS"]])){$ng="\nON SCHEDULE ".($K["INTERVAL_VALUE"]?"EVERY ".q($K["INTERVAL_VALUE"])." $K[INTERVAL_FIELD]".($K["STARTS"]?" STARTS ".q($K["STARTS"]):"").($K["ENDS"]?" ENDS ".q($K["ENDS"]):""):"AT ".q($K["STARTS"]))." ON COMPLETION".($K["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?lang(194):lang(195)),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$ng.($aa!=$K["EVENT_NAME"]?"\nRENAME TO ".idf_escape($K["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($K["EVENT_NAME"]).$ng)."\n".$Jg[$K["STATUS"]]." COMMENT ".q($K["EVENT_COMMENT"]).rtrim(" DO\n$K[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?lang(196).": ".h($aa):lang(197)),$m);if(!$K&&$aa!=""){$L=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$K=reset($L);}echo'
     5801';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$xd=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$Jg=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$K=$_POST;if($_POST&&!$n){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),lang(193));elseif(in_array($K["INTERVAL_FIELD"],$xd)&&isset($Jg[$K["STATUS"]])){$ng="\nON SCHEDULE ".($K["INTERVAL_VALUE"]?"EVERY ".q($K["INTERVAL_VALUE"])." $K[INTERVAL_FIELD]".($K["STARTS"]?" STARTS ".q($K["STARTS"]):"").($K["ENDS"]?" ENDS ".q($K["ENDS"]):""):"AT ".q($K["STARTS"]))." ON COMPLETION".($K["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?lang(194):lang(195)),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$ng.($aa!=$K["EVENT_NAME"]?"\nRENAME TO ".idf_escape($K["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($K["EVENT_NAME"]).$ng)."\n".$Jg[$K["STATUS"]]." COMMENT ".q($K["EVENT_COMMENT"]).rtrim(" DO\n$K[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?lang(196).": ".h($aa):lang(197)),$n);if(!$K&&$aa!=""){$L=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$K=reset($L);}echo'
    57885802<form action="" method="post">
    57895803<table cellspacing="0">
     
    57975811';if($aa!=""){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    57985812</form>
    5799 ';}elseif(isset($_GET["procedure"])){$da=$_GET["procedure"];$ig=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$K=$_POST;$K["fields"]=(array)$K["fields"];if($_POST&&!process_fields($K["fields"])&&!$m){$dh="$K[name]_adminer_".uniqid();drop_create("DROP $ig ".idf_escape($da),create_routine($ig,$K),"DROP $ig ".idf_escape($K["name"]),create_routine($ig,array("name"=>$dh)+$K),"DROP $ig ".idf_escape($dh),substr(ME,0,-1),lang(202),lang(203),lang(204),$da,$K["name"]);}page_header(($da!=""?(isset($_GET["function"])?lang(205):lang(206)).": ".h($da):(isset($_GET["function"])?lang(207):lang(208))),$m);if(!$_POST&&$da!=""){$K=routine($da,$ig);$K["name"]=$da;}$nb=get_vals("SHOW CHARACTER SET");sort($nb);$jg=routine_languages();echo'
     5813';}elseif(isset($_GET["procedure"])){$da=$_GET["procedure"];$ig=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$K=$_POST;$K["fields"]=(array)$K["fields"];if($_POST&&!process_fields($K["fields"])&&!$n){$dh="$K[name]_adminer_".uniqid();drop_create("DROP $ig ".idf_escape($da),create_routine($ig,$K),"DROP $ig ".idf_escape($K["name"]),create_routine($ig,array("name"=>$dh)+$K),"DROP $ig ".idf_escape($dh),substr(ME,0,-1),lang(202),lang(203),lang(204),$da,$K["name"]);}page_header(($da!=""?(isset($_GET["function"])?lang(205):lang(206)).": ".h($da):(isset($_GET["function"])?lang(207):lang(208))),$n);if(!$_POST&&$da!=""){$K=routine($da,$ig);$K["name"]=$da;}$nb=get_vals("SHOW CHARACTER SET");sort($nb);$jg=routine_languages();echo'
    58005814<form action="" method="post" id="form">
    58015815<p>',lang(170),': <input name="name" value="',h($K["name"]),'" maxlength="64" autocapitalize="off">
     
    58075821';if($da!=""){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    58085822</form>
    5809 ';}elseif(isset($_GET["sequence"])){$fa=$_GET["sequence"];$K=$_POST;if($_POST&&!$m){$_=substr(ME,0,-1);$C=trim($K["name"]);if($_POST["drop"])query_redirect("DROP SEQUENCE ".idf_escape($fa),$_,lang(210));elseif($fa=="")query_redirect("CREATE SEQUENCE ".idf_escape($C),$_,lang(211));elseif($fa!=$C)query_redirect("ALTER SEQUENCE ".idf_escape($fa)." RENAME TO ".idf_escape($C),$_,lang(212));else
    5810 redirect($_);}page_header($fa!=""?lang(213).": ".h($fa):lang(214),$m);if(!$K)$K["name"]=$fa;echo'
     5823';}elseif(isset($_GET["sequence"])){$fa=$_GET["sequence"];$K=$_POST;if($_POST&&!$n){$_=substr(ME,0,-1);$C=trim($K["name"]);if($_POST["drop"])query_redirect("DROP SEQUENCE ".idf_escape($fa),$_,lang(210));elseif($fa=="")query_redirect("CREATE SEQUENCE ".idf_escape($C),$_,lang(211));elseif($fa!=$C)query_redirect("ALTER SEQUENCE ".idf_escape($fa)." RENAME TO ".idf_escape($C),$_,lang(212));else
     5824redirect($_);}page_header($fa!=""?lang(213).": ".h($fa):lang(214),$n);if(!$K)$K["name"]=$fa;echo'
    58115825<form action="" method="post">
    58125826<p><input name="name" value="',h($K["name"]),'" autocapitalize="off">
     
    58145828';if($fa!="")echo"<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n";echo'<input type="hidden" name="token" value="',$T,'">
    58155829</form>
    5816 ';}elseif(isset($_GET["type"])){$ga=$_GET["type"];$K=$_POST;if($_POST&&!$m){$_=substr(ME,0,-1);if($_POST["drop"])query_redirect("DROP TYPE ".idf_escape($ga),$_,lang(215));else
    5817 query_redirect("CREATE TYPE ".idf_escape(trim($K["name"]))." $K[as]",$_,lang(216));}page_header($ga!=""?lang(217).": ".h($ga):lang(218),$m);if(!$K)$K["as"]="AS ";echo'
     5830';}elseif(isset($_GET["type"])){$ga=$_GET["type"];$K=$_POST;if($_POST&&!$n){$_=substr(ME,0,-1);if($_POST["drop"])query_redirect("DROP TYPE ".idf_escape($ga),$_,lang(215));else
     5831query_redirect("CREATE TYPE ".idf_escape(trim($K["name"]))." $K[as]",$_,lang(216));}page_header($ga!=""?lang(217).": ".h($ga):lang(218),$n);if(!$K)$K["as"]="AS ";echo'
    58185832<form action="" method="post">
    58195833<p>
    58205834';if($ga!="")echo"<input type='submit' name='drop' value='".lang(116)."'".confirm().">\n";else{echo"<input name='name' value='".h($K['name'])."' autocapitalize='off'>\n";textarea("as",$K["as"]);echo"<p><input type='submit' value='".lang(14)."'>\n";}echo'<input type="hidden" name="token" value="',$T,'">
    58215835</form>
    5822 ';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$C=$_GET["name"];$yh=trigger_options();$K=(array)trigger($C)+array("Trigger"=>$a."_bi");if($_POST){if(!$m&&in_array($_POST["Timing"],$yh["Timing"])&&in_array($_POST["Event"],$yh["Event"])&&in_array($_POST["Type"],$yh["Type"])){$Me=" ON ".table($a);$Zb="DROP TRIGGER ".idf_escape($C).($w=="pgsql"?$Me:"");$A=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($Zb,$A,lang(219));else{if($C!="")queries($Zb);queries_redirect($A,($C!=""?lang(220):lang(221)),queries(create_trigger($Me,$_POST)));if($C!="")queries(create_trigger($Me,$K+array("Type"=>reset($yh["Type"]))));}}$K=$_POST;}page_header(($C!=""?lang(222).": ".h($C):lang(223)),$m,array("table"=>$a));echo'
     5836';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$C=$_GET["name"];$yh=trigger_options();$K=(array)trigger($C)+array("Trigger"=>$a."_bi");if($_POST){if(!$n&&in_array($_POST["Timing"],$yh["Timing"])&&in_array($_POST["Event"],$yh["Event"])&&in_array($_POST["Type"],$yh["Type"])){$Me=" ON ".table($a);$Yb="DROP TRIGGER ".idf_escape($C).($w=="pgsql"?$Me:"");$A=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($Yb,$A,lang(219));else{if($C!="")queries($Yb);queries_redirect($A,($C!=""?lang(220):lang(221)),queries(create_trigger($Me,$_POST)));if($C!="")queries(create_trigger($Me,$K+array("Type"=>reset($yh["Type"]))));}}$K=$_POST;}page_header(($C!=""?lang(222).": ".h($C):lang(223)),$n,array("table"=>$a));echo'
    58235837<form action="" method="post" id="form">
    58245838<table cellspacing="0">
     
    58305844';if($C!=""){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    58315845</form>
    5832 ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Hf=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$K){foreach(explode(",",($K["Privilege"]=="Grant option"?"":$K["Context"]))as$yb)$Hf[$yb][$K["Privilege"]]=$K["Comment"];}$Hf["Server Admin"]+=$Hf["File access on server"];$Hf["Databases"]["Create routine"]=$Hf["Procedures"]["Create routine"];unset($Hf["Procedures"]["Create routine"]);$Hf["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$Hf["Columns"][$X]=$Hf["Tables"][$X];unset($Hf["Server Admin"]["Usage"]);foreach($Hf["Tables"]as$x=>$X)unset($Hf["Databases"][$x]);$ze=array();if($_POST){foreach($_POST["objects"]as$x=>$X)$ze[$X]=(array)$ze[$X]+(array)$_POST["grants"][$x];}$Xc=array();$Ke="";if(isset($_GET["host"])&&($I=$h->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($K=$I->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$K[0],$B)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$B[1],$ee,PREG_SET_ORDER)){foreach($ee
    5833 as$X){if($X[1]!="USAGE")$Xc["$B[2]$X[2]"][$X[1]]=true;if(preg_match('~ WITH GRANT OPTION~',$K[0]))$Xc["$B[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$K[0],$B))$Ke=$B[1];}}if($_POST&&!$m){$Le=(isset($_GET["host"])?q($ha)."@".q($_GET["host"]):"''");if($_POST["drop"])query_redirect("DROP USER $Le",ME."privileges=",lang(226));else{$Ae=q($_POST["user"])."@".q($_POST["host"]);$qf=$_POST["pass"];if($qf!=''&&!$_POST["hashed"]){$qf=$h->result("SELECT PASSWORD(".q($qf).")");$m=!$qf;}$Db=false;if(!$m){if($Le!=$Ae){$Db=queries(($h->server_info<5?"GRANT USAGE ON *.* TO":"CREATE USER")." $Ae IDENTIFIED BY PASSWORD ".q($qf));$m=!$Db;}elseif($qf!=$Ke)queries("SET PASSWORD FOR $Ae = ".q($qf));}if(!$m){$fg=array();foreach($ze
    5834 as$Fe=>$Wc){if(isset($_GET["grant"]))$Wc=array_filter($Wc);$Wc=array_keys($Wc);if(isset($_GET["grant"]))$fg=array_diff(array_keys(array_filter($ze[$Fe],'strlen')),$Wc);elseif($Le==$Ae){$Ie=array_keys((array)$Xc[$Fe]);$fg=array_diff($Ie,$Wc);$Wc=array_diff($Wc,$Ie);unset($Xc[$Fe]);}if(preg_match('~^(.+)\\s*(\\(.*\\))?$~U',$Fe,$B)&&(!grant("REVOKE",$fg,$B[2]," ON $B[1] FROM $Ae")||!grant("GRANT",$Wc,$B[2]," ON $B[1] TO $Ae"))){$m=true;break;}}}if(!$m&&isset($_GET["host"])){if($Le!=$Ae)queries("DROP USER $Le");elseif(!isset($_GET["grant"])){foreach($Xc
    5835 as$Fe=>$fg){if(preg_match('~^(.+)(\\(.*\\))?$~U',$Fe,$B))grant("REVOKE",array_keys($fg),$B[2]," ON $B[1] FROM $Ae");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?lang(227):lang(228)),!$m);if($Db)$h->query("DROP USER $Ae");}}page_header((isset($_GET["host"])?lang(33).": ".h("$ha@$_GET[host]"):lang(135)),$m,array("privileges"=>array('',lang(63))));if($_POST){$K=$_POST;$Xc=$ze;}else{$K=$_GET+array("host"=>$h->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$K["pass"]=$Ke;if($Ke!="")$K["hashed"]=true;$Xc[(DB==""||$Xc?"":idf_escape(addcslashes(DB,"%_\\"))).".*"]=array();}echo'<form action="" method="post">
     5846';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Hf=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$K){foreach(explode(",",($K["Privilege"]=="Grant option"?"":$K["Context"]))as$yb)$Hf[$yb][$K["Privilege"]]=$K["Comment"];}$Hf["Server Admin"]+=$Hf["File access on server"];$Hf["Databases"]["Create routine"]=$Hf["Procedures"]["Create routine"];unset($Hf["Procedures"]["Create routine"]);$Hf["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$Hf["Columns"][$X]=$Hf["Tables"][$X];unset($Hf["Server Admin"]["Usage"]);foreach($Hf["Tables"]as$x=>$X)unset($Hf["Databases"][$x]);$ze=array();if($_POST){foreach($_POST["objects"]as$x=>$X)$ze[$X]=(array)$ze[$X]+(array)$_POST["grants"][$x];}$Wc=array();$Ke="";if(isset($_GET["host"])&&($I=$h->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($K=$I->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$K[0],$B)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$B[1],$ee,PREG_SET_ORDER)){foreach($ee
     5847as$X){if($X[1]!="USAGE")$Wc["$B[2]$X[2]"][$X[1]]=true;if(preg_match('~ WITH GRANT OPTION~',$K[0]))$Wc["$B[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$K[0],$B))$Ke=$B[1];}}if($_POST&&!$n){$Le=(isset($_GET["host"])?q($ha)."@".q($_GET["host"]):"''");if($_POST["drop"])query_redirect("DROP USER $Le",ME."privileges=",lang(226));else{$Ae=q($_POST["user"])."@".q($_POST["host"]);$qf=$_POST["pass"];if($qf!=''&&!$_POST["hashed"]){$qf=$h->result("SELECT PASSWORD(".q($qf).")");$n=!$qf;}$Cb=false;if(!$n){if($Le!=$Ae){$Cb=queries(($h->server_info<5?"GRANT USAGE ON *.* TO":"CREATE USER")." $Ae IDENTIFIED BY PASSWORD ".q($qf));$n=!$Cb;}elseif($qf!=$Ke)queries("SET PASSWORD FOR $Ae = ".q($qf));}if(!$n){$fg=array();foreach($ze
     5848as$Fe=>$Vc){if(isset($_GET["grant"]))$Vc=array_filter($Vc);$Vc=array_keys($Vc);if(isset($_GET["grant"]))$fg=array_diff(array_keys(array_filter($ze[$Fe],'strlen')),$Vc);elseif($Le==$Ae){$Ie=array_keys((array)$Wc[$Fe]);$fg=array_diff($Ie,$Vc);$Vc=array_diff($Vc,$Ie);unset($Wc[$Fe]);}if(preg_match('~^(.+)\\s*(\\(.*\\))?$~U',$Fe,$B)&&(!grant("REVOKE",$fg,$B[2]," ON $B[1] FROM $Ae")||!grant("GRANT",$Vc,$B[2]," ON $B[1] TO $Ae"))){$n=true;break;}}}if(!$n&&isset($_GET["host"])){if($Le!=$Ae)queries("DROP USER $Le");elseif(!isset($_GET["grant"])){foreach($Wc
     5849as$Fe=>$fg){if(preg_match('~^(.+)(\\(.*\\))?$~U',$Fe,$B))grant("REVOKE",array_keys($fg),$B[2]," ON $B[1] FROM $Ae");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?lang(227):lang(228)),!$n);if($Cb)$h->query("DROP USER $Ae");}}page_header((isset($_GET["host"])?lang(33).": ".h("$ha@$_GET[host]"):lang(135)),$n,array("privileges"=>array('',lang(63))));if($_POST){$K=$_POST;$Wc=$ze;}else{$K=$_GET+array("host"=>$h->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$K["pass"]=$Ke;if($Ke!="")$K["hashed"]=true;$Wc[(DB==""||$Wc?"":idf_escape(addcslashes(DB,"%_\\"))).".*"]=array();}echo'<form action="" method="post">
    58365850<table cellspacing="0">
    58375851<tr><th>',lang(32),'<td><input name="host" maxlength="60" value="',h($K["host"]),'" autocapitalize="off">
     
    58415855checkbox("hashed",1,$K["hashed"],lang(229),"typePassword(this.form['pass'], this.checked);"),'</table>
    58425856
    5843 ';echo"<table cellspacing='0'>\n","<thead><tr><th colspan='2'>".lang(63).doc_link(array('sql'=>"grant.html#priv_level"));$r=0;foreach($Xc
    5844 as$Fe=>$Wc){echo'<th>'.($Fe!="*.*"?"<input name='objects[$r]' value='".h($Fe)."' size='10' autocapitalize='off'>":"<input type='hidden' name='objects[$r]' value='*.*' size='10'>*.*");$r++;}echo"</thead>\n";foreach(array(""=>"","Server Admin"=>lang(32),"Databases"=>lang(35),"Tables"=>lang(119),"Columns"=>lang(120),"Procedures"=>lang(230),)as$yb=>$Pb){foreach((array)$Hf[$yb]as$Gf=>$rb){echo"<tr".odd()."><td".($Pb?">$Pb<td":" colspan='2'").' lang="en" title="'.h($rb).'">'.h($Gf);$r=0;foreach($Xc
    5845 as$Fe=>$Wc){$C="'grants[$r][".h(strtoupper($Gf))."]'";$Y=$Wc[strtoupper($Gf)];if($yb=="Server Admin"&&$Fe!=(isset($Xc["*.*"])?"*.*":".*"))echo"<td>&nbsp;";elseif(isset($_GET["grant"]))echo"<td><select name=$C><option><option value='1'".($Y?" selected":"").">".lang(231)."<option value='0'".($Y=="0"?" selected":"").">".lang(232)."</select>";else
    5846 echo"<td align='center'><label class='block'><input type='checkbox' name=$C value='1'".($Y?" checked":"").($Gf=="All privileges"?" id='grants-$r-all'":($Gf=="Grant option"?"":" onclick=\"if (this.checked) formUncheck('grants-$r-all');\""))."></label>";$r++;}}}echo"</table>\n",'<p>
     5857';echo"<table cellspacing='0'>\n","<thead><tr><th colspan='2'>".lang(63).doc_link(array('sql'=>"grant.html#priv_level"));$s=0;foreach($Wc
     5858as$Fe=>$Vc){echo'<th>'.($Fe!="*.*"?"<input name='objects[$s]' value='".h($Fe)."' size='10' autocapitalize='off'>":"<input type='hidden' name='objects[$s]' value='*.*' size='10'>*.*");$s++;}echo"</thead>\n";foreach(array(""=>"","Server Admin"=>lang(32),"Databases"=>lang(35),"Tables"=>lang(119),"Columns"=>lang(120),"Procedures"=>lang(230),)as$yb=>$Ob){foreach((array)$Hf[$yb]as$Gf=>$rb){echo"<tr".odd()."><td".($Ob?">$Ob<td":" colspan='2'").' lang="en" title="'.h($rb).'">'.h($Gf);$s=0;foreach($Wc
     5859as$Fe=>$Vc){$C="'grants[$s][".h(strtoupper($Gf))."]'";$Y=$Vc[strtoupper($Gf)];if($yb=="Server Admin"&&$Fe!=(isset($Wc["*.*"])?"*.*":".*"))echo"<td>&nbsp;";elseif(isset($_GET["grant"]))echo"<td><select name=$C><option><option value='1'".($Y?" selected":"").">".lang(231)."<option value='0'".($Y=="0"?" selected":"").">".lang(232)."</select>";else
     5860echo"<td align='center'><label class='block'><input type='checkbox' name=$C value='1'".($Y?" checked":"").($Gf=="All privileges"?" id='grants-$s-all'":($Gf=="Grant option"?"":" onclick=\"if (this.checked) formUncheck('grants-$s-all');\""))."></label>";$s++;}}}echo"</table>\n",'<p>
    58475861<input type="submit" value="',lang(14),'">
    58485862';if(isset($_GET["host"])){echo'<input type="submit" name="drop" value="',lang(116),'"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
    58495863</form>
    5850 ';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$m){$Md=0;foreach((array)$_POST["kill"]as$X){if(queries("KILL ".number($X)))$Md++;}queries_redirect(ME."processlist=",lang(233,$Md),$Md||!$_POST["kill"]);}page_header(lang(105),$m);echo'
     5864';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$n){$Md=0;foreach((array)$_POST["kill"]as$X){if(queries("KILL ".number($X)))$Md++;}queries_redirect(ME."processlist=",lang(233,$Md),$Md||!$_POST["kill"]);}page_header(lang(105),$n);echo'
    58515865<form action="" method="post">
    58525866<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
    5853 ';$r=-1;foreach(process_list()as$r=>$K){if(!$r){echo"<thead><tr lang='en'>".(support("kill")?"<th>&nbsp;":"");foreach($K
     5867';$s=-1;foreach(process_list()as$s=>$K){if(!$s){echo"<thead><tr lang='en'>".(support("kill")?"<th>&nbsp;":"");foreach($K
    58545868as$x=>$X)echo"<th>$x".doc_link(array('sql'=>"show-processlist.html#processlist_".strtolower($x),'pgsql'=>"monitoring-stats.html#PG-STAT-ACTIVITY-VIEW",'oracle'=>"../b14237/dynviews_2088.htm",));echo"</thead>\n";}echo"<tr".odd().">".(support("kill")?"<td>".checkbox("kill[]",$K["Id"],0):"");foreach($K
    58555869as$x=>$X)echo"<td>".(($w=="sql"&&$x=="Info"&&preg_match("~Query|Killed~",$K["Command"])&&$X!="")||($w=="pgsql"&&$x=="current_query"&&$X!="<IDLE>")||($w=="oracle"&&$x=="sql_text"&&$X!="")?"<code class='jush-$w'>".shorten_utf8($X,100,"</code>").' <a href="'.h(ME.($K["db"]!=""?"db=".urlencode($K["db"])."&":"")."sql=".urlencode($X)).'">'.lang(234).'</a>':nbsp($X));echo"\n";}echo'</table>
    58565870<script type=\'text/javascript\'>tableCheck();</script>
    58575871<p>
    5858 ';if(support("kill")){echo($r+1)."/".lang(235,$h->result("SELECT @@max_connections")),"<p><input type='submit' value='".lang(236)."'>\n";}echo'<input type="hidden" name="token" value="',$T,'">
     5872';if(support("kill")){echo($s+1)."/".lang(235,$h->result("SELECT @@max_connections")),"<p><input type='submit' value='".lang(236)."'>\n";}echo'<input type="hidden" name="token" value="',$T,'">
    58595873</form>
    5860 ';}elseif(isset($_GET["select"])){$a=$_GET["select"];$R=table_status1($a);$v=indexes($a);$o=fields($a);$Pc=column_foreign_keys($a);$He="";if($R["Oid"]){$He=($w=="sqlite"?"rowid":"oid");$v[]=array("type"=>"PRIMARY","columns"=>array($He));}parse_str($_COOKIE["adminer_import"],$ya);$gg=array();$f=array();$hh=null;foreach($o
    5861 as$x=>$n){$C=$b->fieldName($n);if(isset($n["privileges"]["select"])&&$C!=""){$f[$x]=html_entity_decode(strip_tags($C),ENT_QUOTES);if(is_shortable($n))$hh=$b->selectLengthProcess();}$gg+=$n["privileges"];}list($M,$Yc)=$b->selectColumnsProcess($f,$v);$Ad=count($Yc)<count($M);$Z=$b->selectSearchProcess($o,$v);$Xe=$b->selectOrderProcess($o,$v);$z=$b->selectLimitProcess();$Uc=($M?implode(", ",$M):"*".($He?", $He":"")).convert_fields($f,$o,$M)."\nFROM ".table($a);$Zc=($Yc&&$Ad?"\nGROUP BY ".implode(", ",$Yc):"").($Xe?"\nORDER BY ".implode(", ",$Xe):"");if($_GET["val"]&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$Fh=>$K){$Ga=convert_field($o[key($K)]);$M=array($Ga?$Ga:idf_escape(key($K)));$Z[]=where_check($Fh,$o);$J=$Xb->select($a,$M,$Z,$M);if($J)echo
    5862 reset($J->fetch_row());}exit;}if($_POST&&!$m){$ci=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$eb=array();foreach($_POST["check"]as$bb)$eb[]=where_check($bb,$o);$ci[]="((".implode(") OR (",$eb)."))";}$ci=($ci?"\nWHERE ".implode(" AND ",$ci):"");$Cf=$Hh=null;foreach($v
     5874';}elseif(isset($_GET["select"])){$a=$_GET["select"];$R=table_status1($a);$v=indexes($a);$p=fields($a);$Oc=column_foreign_keys($a);$He="";if($R["Oid"]){$He=($w=="sqlite"?"rowid":"oid");$v[]=array("type"=>"PRIMARY","columns"=>array($He));}parse_str($_COOKIE["adminer_import"],$ya);$gg=array();$f=array();$hh=null;foreach($p
     5875as$x=>$o){$C=$b->fieldName($o);if(isset($o["privileges"]["select"])&&$C!=""){$f[$x]=html_entity_decode(strip_tags($C),ENT_QUOTES);if(is_shortable($o))$hh=$b->selectLengthProcess();}$gg+=$o["privileges"];}list($M,$Xc)=$b->selectColumnsProcess($f,$v);$Ad=count($Xc)<count($M);$Z=$b->selectSearchProcess($p,$v);$Xe=$b->selectOrderProcess($p,$v);$z=$b->selectLimitProcess();$Tc=($M?implode(", ",$M):"*".($He?", $He":"")).convert_fields($f,$p,$M)."\nFROM ".table($a);$Yc=($Xc&&$Ad?"\nGROUP BY ".implode(", ",$Xc):"").($Xe?"\nORDER BY ".implode(", ",$Xe):"");if($_GET["val"]&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$Fh=>$K){$Ga=convert_field($p[key($K)]);$M=array($Ga?$Ga:idf_escape(key($K)));$Z[]=where_check($Fh,$p);$J=$Wb->select($a,$M,$Z,$M);if($J)echo
     5876reset($J->fetch_row());}exit;}if($_POST&&!$n){$ci=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$eb=array();foreach($_POST["check"]as$bb)$eb[]=where_check($bb,$p);$ci[]="((".implode(") OR (",$eb)."))";}$ci=($ci?"\nWHERE ".implode(" AND ",$ci):"");$Cf=$Hh=null;foreach($v
    58635877as$u){if($u["type"]=="PRIMARY"){$Cf=array_flip($u["columns"]);$Hh=($M?$Cf:array());break;}}foreach((array)$Hh
    5864 as$x=>$X){if(in_array(idf_escape($x),$M))unset($Hh[$x]);}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"])||$Hh===array())$H="SELECT $Uc$ci$Zc";else{$Dh=array();foreach($_POST["check"]as$X)$Dh[]="(SELECT".limit($Uc,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$o).$Zc,1).")";$H=implode(" UNION ALL ",$Dh);}$b->dumpData($a,"table",$H);exit;}if(!$b->selectEmailProcess($Z,$Pc)){if($_POST["save"]||$_POST["delete"]){$I=true;$za=0;$O=array();if(!$_POST["delete"]){foreach($f
    5865 as$C=>$X){$X=process_input($o[$C]);if($X!==null&&($_POST["clone"]||$X!==false))$O[idf_escape($C)]=($X!==false?$X:idf_escape($C));}}if($_POST["delete"]||$O){if($_POST["clone"])$H="INTO ".table($a)." (".implode(", ",array_keys($O)).")\nSELECT ".implode(", ",$O)."\nFROM ".table($a);if($_POST["all"]||($Hh===array()&&is_array($_POST["check"]))||$Ad){$I=($_POST["delete"]?$Xb->delete($a,$ci):($_POST["clone"]?queries("INSERT $H$ci"):$Xb->update($a,$O,$ci)));$za=$h->affected_rows;}else{foreach((array)$_POST["check"]as$X){$bi="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$o);$I=($_POST["delete"]?$Xb->delete($a,$bi,1):($_POST["clone"]?queries("INSERT".limit1($H,$bi)):$Xb->update($a,$O,$bi)));if(!$I)break;$za+=$h->affected_rows;}}}$me=lang(237,$za);if($_POST["clone"]&&$I&&$za==1){$Rd=last_id();if($Rd)$me=lang(156," $Rd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$me,$I);if(!$_POST["delete"]){edit_form($a,$o,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$m=lang(238);else{$I=true;$za=0;foreach($_POST["val"]as$Fh=>$K){$O=array();foreach($K
    5866 as$x=>$X){$x=bracket_escape($x,1);$O[idf_escape($x)]=(preg_match('~char|text~',$o[$x]["type"])||$X!=""?$b->processInput($o[$x],$X):"NULL");}$I=$Xb->update($a,$O," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($Fh,$o),!($Ad||$Hh===array())," ");if(!$I)break;$za+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(237,$za),$I);}}elseif(!is_string($Ic=get_file("csv_file",true)))$m=upload_error($Ic);elseif(!preg_match('~~u',$Ic))$m=lang(239);else{cookie("adminer_import","output=".urlencode($ya["output"])."&format=".urlencode($_POST["separator"]));$I=true;$ob=array_keys($o);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$Ic,$ee);$za=count($ee[0]);$Xb->begin();$vg=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$L=array();foreach($ee[0]as$x=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$vg]*)$vg~",$X.$vg,$fe);if(!$x&&!array_diff($fe[1],$ob)){$ob=$fe[1];$za--;}else{$O=array();foreach($fe[1]as$r=>$lb)$O[idf_escape($ob[$r])]=($lb==""&&$o[$ob[$r]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$lb))));$L[]=$O;}}$I=(!$L||$Xb->insertUpdate($a,$L,$Cf));if($I)$Xb->commit();queries_redirect(remove_from_uri("page"),lang(240,$za),$I);$Xb->rollback();}}}$Tg=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
    5867 page_header(lang(44).": $Tg",$m);$O=null;if(isset($gg["insert"])||!support("table")){$O="";foreach((array)$_GET["where"]as$X){if(count($Pc[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$O.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$O);if(!$f&&support("table"))echo"<p class='error'>".lang(241).($o?".":": ".error())."\n";else{echo"<form action='' id='form'>\n","<div style='display: none;'>";hidden_fields_get();echo(DB!=""?'<input type="hidden" name="db" value="'.h(DB).'">'.(isset($_GET["ns"])?'<input type="hidden" name="ns" value="'.h($_GET["ns"]).'">':""):"");echo'<input type="hidden" name="select" value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($M,$f);$b->selectSearchPrint($Z,$f,$v);$b->selectOrderPrint($Xe,$f,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($hh);$b->selectActionPrint($v);echo"</form>\n";$E=$_GET["page"];if($E=="last"){$Sc=$h->result(count_rows($a,$Z,$Ad,$Yc));$E=floor(max(0,$Sc-1)/$z);}$sg=$M;if(!$sg){$sg[]="*";if($He)$sg[]=$He;}$zb=convert_fields($f,$o,$M);if($zb)$sg[]=substr($zb,2);$I=$Xb->select($a,$sg,$Z,$Yc,$Xe,$z,$E,true);if(!$I)echo"<p class='error'>".error()."\n";else{if($w=="mssql"&&$E)$I->seek($z*$E);$mc=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$L=array();while($K=$I->fetch_assoc()){if($E&&$w=="oracle")unset($K["RNUM"]);$L[]=$K;}if($_GET["page"]!="last"&&+$z&&$Yc&&$Ad&&$w=="sql")$Sc=$h->result(" SELECT FOUND_ROWS()");if(!$L)echo"<p class='message'>".lang(12)."\n";else{$Pa=$b->backwardKeys($a,$Tg);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Yc&&$M?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(242)."</a>");$ye=array();$Vc=array();reset($M);$Qf=1;foreach($L[0]as$x=>$X){if($x!=$He){$X=$_GET["columns"][key($M)];$n=$o[$M?($X?$X["col"]:current($M)):$x];$C=($n?$b->fieldName($n,$Qf):($X["fun"]?"*":$x));if($C!=""){$Qf++;$ye[$x]=$C;$e=idf_escape($x);$jd=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($x);$Pb="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($jd.($Xe[0]==$e||$Xe[0]==$x||(!$Xe&&$Ad&&$Yc[0]==$e)?$Pb:'')).'">';echo
    5868 apply_sql_function($X["fun"],$C)."</a>";echo"<span class='column hidden'>","<a href='".h($jd.$Pb)."' title='".lang(50)."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($x)).'\'); return false;" title="'.lang(47).'" class="text jsonly"> =</a>';echo"</span>";}$Vc[$x]=$X["fun"];next($M);}}$Wd=array();if($_GET["modify"]){foreach($L
     5878as$x=>$X){if(in_array(idf_escape($x),$M))unset($Hh[$x]);}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"])||$Hh===array())$H="SELECT $Tc$ci$Yc";else{$Dh=array();foreach($_POST["check"]as$X)$Dh[]="(SELECT".limit($Tc,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p).$Yc,1).")";$H=implode(" UNION ALL ",$Dh);}$b->dumpData($a,"table",$H);exit;}if(!$b->selectEmailProcess($Z,$Oc)){if($_POST["save"]||$_POST["delete"]){$I=true;$za=0;$O=array();if(!$_POST["delete"]){foreach($f
     5879as$C=>$X){$X=process_input($p[$C]);if($X!==null&&($_POST["clone"]||$X!==false))$O[idf_escape($C)]=($X!==false?$X:idf_escape($C));}}if($_POST["delete"]||$O){if($_POST["clone"])$H="INTO ".table($a)." (".implode(", ",array_keys($O)).")\nSELECT ".implode(", ",$O)."\nFROM ".table($a);if($_POST["all"]||($Hh===array()&&is_array($_POST["check"]))||$Ad){$I=($_POST["delete"]?$Wb->delete($a,$ci):($_POST["clone"]?queries("INSERT $H$ci"):$Wb->update($a,$O,$ci)));$za=$h->affected_rows;}else{foreach((array)$_POST["check"]as$X){$bi="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p);$I=($_POST["delete"]?$Wb->delete($a,$bi,1):($_POST["clone"]?queries("INSERT".limit1($H,$bi)):$Wb->update($a,$O,$bi)));if(!$I)break;$za+=$h->affected_rows;}}}$me=lang(237,$za);if($_POST["clone"]&&$I&&$za==1){$Rd=last_id();if($Rd)$me=lang(156," $Rd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$me,$I);if(!$_POST["delete"]){edit_form($a,$p,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$n=lang(238);else{$I=true;$za=0;foreach($_POST["val"]as$Fh=>$K){$O=array();foreach($K
     5880as$x=>$X){$x=bracket_escape($x,1);$O[idf_escape($x)]=(preg_match('~char|text~',$p[$x]["type"])||$X!=""?$b->processInput($p[$x],$X):"NULL");}$I=$Wb->update($a,$O," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($Fh,$p),!($Ad||$Hh===array())," ");if(!$I)break;$za+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(237,$za),$I);}}elseif(!is_string($Hc=get_file("csv_file",true)))$n=upload_error($Hc);elseif(!preg_match('~~u',$Hc))$n=lang(239);else{cookie("adminer_import","output=".urlencode($ya["output"])."&format=".urlencode($_POST["separator"]));$I=true;$ob=array_keys($p);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$Hc,$ee);$za=count($ee[0]);$Wb->begin();$vg=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$L=array();foreach($ee[0]as$x=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$vg]*)$vg~",$X.$vg,$fe);if(!$x&&!array_diff($fe[1],$ob)){$ob=$fe[1];$za--;}else{$O=array();foreach($fe[1]as$s=>$lb)$O[idf_escape($ob[$s])]=($lb==""&&$p[$ob[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$lb))));$L[]=$O;}}$I=(!$L||$Wb->insertUpdate($a,$L,$Cf));if($I)$Wb->commit();queries_redirect(remove_from_uri("page"),lang(240,$za),$I);$Wb->rollback();}}}$Tg=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
     5881page_header(lang(44).": $Tg",$n);$O=null;if(isset($gg["insert"])||!support("table")){$O="";foreach((array)$_GET["where"]as$X){if(count($Oc[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$O.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$O);if(!$f&&support("table"))echo"<p class='error'>".lang(241).($p?".":": ".error())."\n";else{echo"<form action='' id='form'>\n","<div style='display: none;'>";hidden_fields_get();echo(DB!=""?'<input type="hidden" name="db" value="'.h(DB).'">'.(isset($_GET["ns"])?'<input type="hidden" name="ns" value="'.h($_GET["ns"]).'">':""):"");echo'<input type="hidden" name="select" value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($M,$f);$b->selectSearchPrint($Z,$f,$v);$b->selectOrderPrint($Xe,$f,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($hh);$b->selectActionPrint($v);echo"</form>\n";$E=$_GET["page"];if($E=="last"){$Rc=$h->result(count_rows($a,$Z,$Ad,$Xc));$E=floor(max(0,$Rc-1)/$z);}$sg=$M;if(!$sg){$sg[]="*";if($He)$sg[]=$He;}$zb=convert_fields($f,$p,$M);if($zb)$sg[]=substr($zb,2);$I=$Wb->select($a,$sg,$Z,$Xc,$Xe,$z,$E,true);if(!$I)echo"<p class='error'>".error()."\n";else{if($w=="mssql"&&$E)$I->seek($z*$E);$lc=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$L=array();while($K=$I->fetch_assoc()){if($E&&$w=="oracle")unset($K["RNUM"]);$L[]=$K;}if($_GET["page"]!="last"&&+$z&&$Xc&&$Ad&&$w=="sql")$Rc=$h->result(" SELECT FOUND_ROWS()");if(!$L)echo"<p class='message'>".lang(12)."\n";else{$Pa=$b->backwardKeys($a,$Tg);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Xc&&$M?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(242)."</a>");$ye=array();$Uc=array();reset($M);$Qf=1;foreach($L[0]as$x=>$X){if($x!=$He){$X=$_GET["columns"][key($M)];$o=$p[$M?($X?$X["col"]:current($M)):$x];$C=($o?$b->fieldName($o,$Qf):($X["fun"]?"*":$x));if($C!=""){$Qf++;$ye[$x]=$C;$e=idf_escape($x);$id=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($x);$Ob="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($id.($Xe[0]==$e||$Xe[0]==$x||(!$Xe&&$Ad&&$Xc[0]==$e)?$Ob:'')).'">';echo
     5882apply_sql_function($X["fun"],$C)."</a>";echo"<span class='column hidden'>","<a href='".h($id.$Ob)."' title='".lang(50)."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($x)).'\'); return false;" title="'.lang(47).'" class="text jsonly"> =</a>';echo"</span>";}$Uc[$x]=$X["fun"];next($M);}}$Wd=array();if($_GET["modify"]){foreach($L
    58695883as$K){foreach($K
    5870 as$x=>$X)$Wd[$x]=max($Wd[$x],min(40,strlen(utf8_decode($X))));}}echo($Pa?"<th>".lang(243):"")."</thead>\n";if(is_ajax()){if($z%2==1&&$E%2==1)odd();ob_end_clean();}foreach($b->rowDescriptions($L,$Pc)as$xe=>$K){$Eh=unique_array($L[$xe],$v);if(!$Eh){$Eh=array();foreach($L[$xe]as$x=>$X){if(!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~',$x))$Eh[$x]=$X;}}$Fh="";foreach($Eh
    5871 as$x=>$X){if(($w=="sql"||$w=="pgsql")&&strlen($X)>64){$x=(strpos($x,'(')?$x:idf_escape($x));$x="MD5(".($w=='sql'&&preg_match("~^utf8_~",$o[$x]["collation"])?$x:"CONVERT($x USING ".charset($h).")").")";$X=md5($X);}$Fh.="&".($X!==null?urlencode("where[".bracket_escape($x)."]")."=".urlencode($X):"null%5B%5D=".urlencode($x));}echo"<tr".odd().">".(!$Yc&&$M?"":"<td>".checkbox("check[]",substr($Fh,1),in_array(substr($Fh,1),(array)$_POST["check"]),"","this.form['all'].checked = false; formUncheck('all-page');").($Ad||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$Fh)."'>".lang(244)."</a>"));foreach($K
    5872 as$x=>$X){if(isset($ye[$x])){$n=$o[$x];if($X!=""&&(!isset($mc[$x])||$mc[$x]!=""))$mc[$x]=(is_mail($X)?$ye[$x]:"");$_="";if(preg_match('~blob|bytea|raw|file~',$n["type"])&&$X!="")$_=ME.'download='.urlencode($a).'&field='.urlencode($x).$Fh;if(!$_&&$X!==null){foreach((array)$Pc[$x]as$p){if(count($Pc[$x])==1||end($p["source"])==$x){$_="";foreach($p["source"]as$r=>$Dg)$_.=where_link($r,$p["target"][$r],$L[$xe][$Dg]);$_=($p["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\\1'.urlencode($p["db"]),ME):ME).'select='.urlencode($p["table"]).$_;if(count($p["source"])==1)break;}}}if($x=="COUNT(*)"){$_=ME."select=".urlencode($a);$r=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$Eh))$_.=where_link($r++,$W["col"],$W["val"],$W["op"]);}foreach($Eh
    5873 as$Gd=>$W)$_.=where_link($r++,$Gd,$W);}$X=select_value($X,$_,$n,$hh);$s=h("val[$Fh][".bracket_escape($x)."]");$Y=$_POST["val"][$Fh][bracket_escape($x)];$hc=!is_array($K[$x])&&is__utf8($X)&&$L[$xe][$x]==$K[$x]&&!$Vc[$x];$gh=preg_match('~text|lob~',$n["type"]);if(($_GET["modify"]&&$hc)||$Y!==null){$bd=h($Y!==null?$Y:$K[$x]);echo"<td>".($gh?"<textarea name='$s' cols='30' rows='".(substr_count($K[$x],"\n")+1)."'>$bd</textarea>":"<input name='$s' value='$bd' size='$Wd[$x]'>");}else{$be=strpos($X,"<i>...</i>");echo"<td id='$s' onclick=\"selectClick(this, event, ".($be?2:($gh?1:0)).($hc?"":", '".h(lang(245))."'").");\">$X";}}}if($Pa)echo"<td>";$b->backwardKeysPrint($Pa,$L[$xe]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n";}if(($L||$E)&&!is_ajax()){$wc=true;if($_GET["page"]!="last"){if(!+$z)$Sc=count($L);elseif($w!="sql"||!$Ad){$Sc=($Ad?false:found_rows($R,$Z));if($Sc<max(1e4,2*($E+1)*$z))$Sc=reset(slow_query(count_rows($a,$Z,$Ad,$Yc)));else$wc=false;}}if(+$z&&($Sc===false||$Sc>$z||$E)){echo"<p class='pages'>";$he=($Sc===false?$E+(count($L)>=$z?2:1):floor(($Sc-1)/$z));if($w!="simpledb"){echo'<a href="'.h(remove_from_uri("page"))."\" onclick=\"pageClick(this.href, +prompt('".lang(246)."', '".($E+1)."'), event); return false;\">".lang(246)."</a>:",pagination(0,$E).($E>5?" ...":"");for($r=max(1,$E-4);$r<min($he,$E+5);$r++)echo
    5874 pagination($r,$E);if($he>0){echo($E+5<$he?" ...":""),($wc&&$Sc!==false?pagination($he,$E):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$he'>".lang(247)."</a>");}echo(($Sc===false?count($L)+1:$Sc-$E*$z)>$z?' <a href="'.h(remove_from_uri("page")."&page=".($E+1)).'" onclick="return !selectLoadMore(this, '.(+$z).', \''.lang(248).'...\');" class="loadmore">'.lang(249).'</a>':'');}else{echo
    5875 lang(246).":",pagination(0,$E).($E>1?" ...":""),($E?pagination($E,$E):""),($he>$E?pagination($E+1,$E).($he>$E+1?" ...":""):"");}}echo"<p class='count'>\n",($Sc!==false?"(".($wc?"":"~ ").lang(138,$Sc).") ":"");$Ub=($wc?"":"~ ").$Sc;echo
    5876 checkbox("all",1,0,lang(250),"var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$Ub' : checked); selectCount('selected2', this.checked || !checked ? '$Ub' : checked);")."\n";if($b->selectCommandPrint()){echo'<fieldset',($_GET["modify"]?'':' class="jsonly"'),'><legend>',lang(242),'</legend><div>
     5884as$x=>$X)$Wd[$x]=max($Wd[$x],min(40,strlen(utf8_decode($X))));}}echo($Pa?"<th>".lang(243):"")."</thead>\n";if(is_ajax()){if($z%2==1&&$E%2==1)odd();ob_end_clean();}foreach($b->rowDescriptions($L,$Oc)as$xe=>$K){$Eh=unique_array($L[$xe],$v);if(!$Eh){$Eh=array();foreach($L[$xe]as$x=>$X){if(!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~',$x))$Eh[$x]=$X;}}$Fh="";foreach($Eh
     5885as$x=>$X){if(($w=="sql"||$w=="pgsql")&&strlen($X)>64){$x=(strpos($x,'(')?$x:idf_escape($x));$x="MD5(".($w=='sql'&&preg_match("~^utf8_~",$p[$x]["collation"])?$x:"CONVERT($x USING ".charset($h).")").")";$X=md5($X);}$Fh.="&".($X!==null?urlencode("where[".bracket_escape($x)."]")."=".urlencode($X):"null%5B%5D=".urlencode($x));}echo"<tr".odd().">".(!$Xc&&$M?"":"<td>".checkbox("check[]",substr($Fh,1),in_array(substr($Fh,1),(array)$_POST["check"]),"","this.form['all'].checked = false; formUncheck('all-page');").($Ad||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$Fh)."'>".lang(244)."</a>"));foreach($K
     5886as$x=>$X){if(isset($ye[$x])){$o=$p[$x];if($X!=""&&(!isset($lc[$x])||$lc[$x]!=""))$lc[$x]=(is_mail($X)?$ye[$x]:"");$_="";if(preg_match('~blob|bytea|raw|file~',$o["type"])&&$X!="")$_=ME.'download='.urlencode($a).'&field='.urlencode($x).$Fh;if(!$_&&$X!==null){foreach((array)$Oc[$x]as$q){if(count($Oc[$x])==1||end($q["source"])==$x){$_="";foreach($q["source"]as$s=>$Dg)$_.=where_link($s,$q["target"][$s],$L[$xe][$Dg]);$_=($q["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\\1'.urlencode($q["db"]),ME):ME).'select='.urlencode($q["table"]).$_;if(count($q["source"])==1)break;}}}if($x=="COUNT(*)"){$_=ME."select=".urlencode($a);$s=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$Eh))$_.=where_link($s++,$W["col"],$W["val"],$W["op"]);}foreach($Eh
     5887as$Gd=>$W)$_.=where_link($s++,$Gd,$W);}$X=select_value($X,$_,$o,$hh);$jd=h("val[$Fh][".bracket_escape($x)."]");$Y=$_POST["val"][$Fh][bracket_escape($x)];$gc=!is_array($K[$x])&&is__utf8($X)&&$L[$xe][$x]==$K[$x]&&!$Uc[$x];$gh=preg_match('~text|lob~',$o["type"]);if(($_GET["modify"]&&$gc)||$Y!==null){$ad=h($Y!==null?$Y:$K[$x]);echo"<td>".($gh?"<textarea name='$jd' cols='30' rows='".(substr_count($K[$x],"\n")+1)."'>$ad</textarea>":"<input name='$jd' value='$ad' size='$Wd[$x]'>");}else{$be=strpos($X,"<i>...</i>");echo"<td id='$jd' onclick=\"selectClick(this, event, ".($be?2:($gh?1:0)).($gc?"":", '".h(lang(245))."'").");\">$X";}}}if($Pa)echo"<td>";$b->backwardKeysPrint($Pa,$L[$xe]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n";}if(($L||$E)&&!is_ajax()){$vc=true;if($_GET["page"]!="last"){if(!+$z)$Rc=count($L);elseif($w!="sql"||!$Ad){$Rc=($Ad?false:found_rows($R,$Z));if($Rc<max(1e4,2*($E+1)*$z))$Rc=reset(slow_query(count_rows($a,$Z,$Ad,$Xc)));else$vc=false;}}if(+$z&&($Rc===false||$Rc>$z||$E)){echo"<p class='pages'>";$he=($Rc===false?$E+(count($L)>=$z?2:1):floor(($Rc-1)/$z));if($w!="simpledb"){echo'<a href="'.h(remove_from_uri("page"))."\" onclick=\"pageClick(this.href, +prompt('".lang(246)."', '".($E+1)."'), event); return false;\">".lang(246)."</a>:",pagination(0,$E).($E>5?" ...":"");for($s=max(1,$E-4);$s<min($he,$E+5);$s++)echo
     5888pagination($s,$E);if($he>0){echo($E+5<$he?" ...":""),($vc&&$Rc!==false?pagination($he,$E):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$he'>".lang(247)."</a>");}echo(($Rc===false?count($L)+1:$Rc-$E*$z)>$z?' <a href="'.h(remove_from_uri("page")."&page=".($E+1)).'" onclick="return !selectLoadMore(this, '.(+$z).', \''.lang(248).'...\');" class="loadmore">'.lang(249).'</a>':'');}else{echo
     5889lang(246).":",pagination(0,$E).($E>1?" ...":""),($E?pagination($E,$E):""),($he>$E?pagination($E+1,$E).($he>$E+1?" ...":""):"");}}echo"<p class='count'>\n",($Rc!==false?"(".($vc?"":"~ ").lang(138,$Rc).") ":"");$Tb=($vc?"":"~ ").$Rc;echo
     5890checkbox("all",1,0,lang(250),"var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$Tb' : checked); selectCount('selected2', this.checked || !checked ? '$Tb' : checked);")."\n";if($b->selectCommandPrint()){echo'<fieldset',($_GET["modify"]?'':' class="jsonly"'),'><legend>',lang(242),'</legend><div>
    58775891<input type="submit" value="',lang(14),'"',($_GET["modify"]?'':' title="'.lang(238).'"'),'>
    58785892</div></fieldset>
     
    58825896<input type="submit" name="delete" value="',lang(18),'"',confirm(),'>
    58835897</div></fieldset>
    5884 ';}$Qc=$b->dumpFormat();foreach((array)$_GET["columns"]as$e){if($e["fun"]){unset($Qc['sql']);break;}}if($Qc){print_fieldset("export",lang(65)." <span id='selected2'></span>");$hf=$b->dumpOutput();echo($hf?html_select("output",$hf,$ya["output"])." ":""),html_select("format",$Qc,$ya["format"])," <input type='submit' name='export' value='".lang(65)."'>\n","</div></fieldset>\n";}echo(!$Yc&&$M?"":"<script type='text/javascript'>tableCheck();</script>\n");}if($b->selectImportPrint()){print_fieldset("import",lang(64),!$L);echo"<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$ya["format"],1);echo" <input type='submit' name='import' value='".lang(64)."'>","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($mc,'strlen'),$f);echo"<p><input type='hidden' name='token' value='$T'></p>\n","</form>\n";}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$Ig=isset($_GET["status"]);page_header($Ig?lang(107):lang(106));$Uh=($Ig?show_status():show_variables());if(!$Uh)echo"<p class='message'>".lang(12)."\n";else{echo"<table cellspacing='0'>\n";foreach($Uh
     5898';}$Pc=$b->dumpFormat();foreach((array)$_GET["columns"]as$e){if($e["fun"]){unset($Pc['sql']);break;}}if($Pc){print_fieldset("export",lang(65)." <span id='selected2'></span>");$hf=$b->dumpOutput();echo($hf?html_select("output",$hf,$ya["output"])." ":""),html_select("format",$Pc,$ya["format"])," <input type='submit' name='export' value='".lang(65)."'>\n","</div></fieldset>\n";}echo(!$Xc&&$M?"":"<script type='text/javascript'>tableCheck();</script>\n");}if($b->selectImportPrint()){print_fieldset("import",lang(64),!$L);echo"<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$ya["format"],1);echo" <input type='submit' name='import' value='".lang(64)."'>","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($lc,'strlen'),$f);echo"<p><input type='hidden' name='token' value='$T'></p>\n","</form>\n";}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$Ig=isset($_GET["status"]);page_header($Ig?lang(107):lang(106));$Uh=($Ig?show_status():show_variables());if(!$Uh)echo"<p class='message'>".lang(12)."\n";else{echo"<table cellspacing='0'>\n";foreach($Uh
    58855899as$x=>$X){echo"<tr>","<th><code class='jush-".$w.($Ig?"status":"set")."'>".h($x)."</code>","<td>".nbsp($X);}echo"</table>\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$Qg=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$C=>$R){json_row("Comment-$C",nbsp($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$x)json_row("$x-$C",nbsp($R[$x]));foreach($Qg+array("Auto_increment"=>0,"Rows"=>0)as$x=>$X){if($R[$x]!=""){$X=format_number($R[$x]);json_row("$x-$C",($x=="Rows"&&$X&&$R["Engine"]==($Fg=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($Qg[$x]))$Qg[$x]+=($R["Engine"]!="InnoDB"||$x!="Data_free"?$R[$x]:0);}elseif(array_key_exists($x,$R))json_row("$x-$C");}}}foreach($Qg
    5886 as$x=>$X)json_row("sum-$x",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$h->query("KILL ".number($_POST["kill"]));else{foreach(count_tables($b->databases())as$l=>$X){json_row("tables-$l",$X);json_row("size-$l",db_size($l));}json_row("");}exit;}else{$Zg=array_merge((array)$_POST["tables"],(array)$_POST["views"]);if($Zg&&!$m&&!$_POST["search"]){$I=true;$me="";if($w=="sql"&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$I=truncate_tables($_POST["tables"]);$me=lang(251);}elseif($_POST["move"]){$I=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$me=lang(252);}elseif($_POST["copy"]){$I=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$me=lang(253);}elseif($_POST["drop"]){if($_POST["views"])$I=drop_views($_POST["views"]);if($I&&$_POST["tables"])$I=drop_tables($_POST["tables"]);$me=lang(254);}elseif($w!="sql"){$I=($w=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$me=lang(255);}elseif(!$_POST["tables"])$me=lang(9);elseif($I=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($K=$I->fetch_assoc())$me.="<b>".h($K["Table"])."</b>: ".h($K["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$me,$I);}page_header(($_GET["ns"]==""?lang(35).": ".h(DB):lang(68).": ".h($_GET["ns"])),$m,true);if($b->homepage()){if($_GET["ns"]!==""){echo"<h3 id='tables-views'>".lang(256)."</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(257)." <span id='selected2'></span></legend><div>","<input type='search' name='query' value='".h($_POST["query"])."'> <input type='submit' name='search' value='".lang(47)."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!="")search_tables();}echo"<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n",'<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';$Vb=doc_link(array('sql'=>'show-table-status.html'));echo'<th>'.lang(119),'<td>'.lang(258).doc_link(array('sql'=>'storage-engines.html')),'<td>'.lang(111).doc_link(array('sql'=>'charset-mysql.html')),'<td>'.lang(259).$Vb,'<td>'.lang(260).$Vb,'<td>'.lang(261).$Vb,'<td>'.lang(56).doc_link(array('sql'=>'example-auto-increment.html')),'<td>'.lang(262).$Vb,(support("comment")?'<td>'.lang(96).$Vb:''),"</thead>\n";$S=0;foreach($Yg
    5887 as$C=>$U){$Xh=($U!==null&&!preg_match('~table~i',$U));echo'<tr'.odd().'><td>'.checkbox(($Xh?"views[]":"tables[]"),$C,in_array($C,$Zg,true),"","formUncheck('check-all');"),'<th>'.(support("table")||support("indexes")?'<a href="'.h(ME).'table='.urlencode($C).'" title="'.lang(39).'">'.h($C).'</a>':h($C));if($Xh){echo'<td colspan="6"><a href="'.h(ME)."view=".urlencode($C).'" title="'.lang(40).'">'.(preg_match('~materialized~i',$U)?lang(263):lang(118)).'</a>','<td align="right"><a href="'.h(ME)."select=".urlencode($C).'" title="'.lang(38).'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",lang(41)),"Index_length"=>array("indexes",lang(122)),"Data_free"=>array("edit",lang(42)),"Auto_increment"=>array("auto_increment=1&create",lang(41)),"Rows"=>array("select",lang(38)),)as$x=>$_){$s=" id='$x-".h($C)."'";echo($_?"<td align='right'>".(support("table")||$x=="Rows"||(support("indexes")&&$x!="Data_length")?"<a href='".h(ME."$_[0]=").urlencode($C)."'$s title='$_[1]'>?</a>":"<span$s>?</span>"):"<td id='$x-".h($C)."'>&nbsp;");}$S++;}echo(support("comment")?"<td id='Comment-".h($C)."'>&nbsp;":"");}echo"<tr><td>&nbsp;<th>".lang(235,count($Yg)),"<td>".nbsp($w=="sql"?$h->result("SELECT @@storage_engine"):""),"<td>".nbsp(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$x)echo"<td align='right' id='sum-$x'>&nbsp;";echo"</table>\n";if(!information_schema(DB)){$Rh="<input type='submit' value='".lang(264)."'".on_help("'VACUUM'")."> ";$Te="<input type='submit' name='optimize' value='".lang(265)."'".on_help($w=="sql"?"'OPTIMIZE TABLE'":"'VACUUM OPTIMIZE'")."> ";echo"<fieldset><legend>".lang(115)." <span id='selected'></span></legend><div>".($w=="sqlite"?$Rh:($w=="pgsql"?$Rh.$Te:($w=="sql"?"<input type='submit' value='".lang(266)."'".on_help("'ANALYZE TABLE'")."> ".$Te."<input type='submit' name='check' value='".lang(267)."'".on_help("'CHECK TABLE'")."> "."<input type='submit' name='repair' value='".lang(268)."'".on_help("'REPAIR TABLE'")."> ":"")))."<input type='submit' name='truncate' value='".lang(269)."'".confirm().on_help($w=="sqlite"?"'DELETE'":"'TRUNCATE".($w=="pgsql"?"'":" TABLE'"))."> "."<input type='submit' name='drop' value='".lang(116)."'".confirm().on_help("'DROP TABLE'").">\n";$k=(support("scheme")?$b->schemas():$b->databases());if(count($k)!=1&&$w!="sqlite"){$l=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".lang(270).": ",($k?html_select("target",$k,$l):'<input name="target" value="'.h($l).'" autocapitalize="off">')," <input type='submit' name='move' value='".lang(271)."'>",(support("copy")?" <input type='submit' name='copy' value='".lang(272)."'>":""),"\n";}echo"<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^(tables|views)\[/));".(support("table")?" selectCount('selected2', formChecked(this, /^tables\[/) || $S);":"")."\">\n";echo"<input type='hidden' name='token' value='$T'>\n","</div></fieldset>\n";}echo"</form>\n","<script type='text/javascript'>tableCheck();</script>\n";}echo'<p class="links"><a href="'.h(ME).'create=">'.lang(66)."</a>\n",(support("view")?'<a href="'.h(ME).'view=">'.lang(192)."</a>\n":""),(support("materializedview")?'<a href="'.h(ME).'view=&amp;materialized=1">'.lang(273)."</a>\n":"");if(support("routine")){echo"<h3 id='routines'>".lang(132)."</h3>\n";$kg=routines();if($kg){echo"<table cellspacing='0'>\n",'<thead><tr><th>'.lang(170).'<td>'.lang(92).'<td>'.lang(209)."<td>&nbsp;</thead>\n";odd('');foreach($kg
     5900as$x=>$X)json_row("sum-$x",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$h->query("KILL ".number($_POST["kill"]));else{foreach(count_tables($b->databases())as$m=>$X){json_row("tables-$m",$X);json_row("size-$m",db_size($m));}json_row("");}exit;}else{$Zg=array_merge((array)$_POST["tables"],(array)$_POST["views"]);if($Zg&&!$n&&!$_POST["search"]){$I=true;$me="";if($w=="sql"&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$I=truncate_tables($_POST["tables"]);$me=lang(251);}elseif($_POST["move"]){$I=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$me=lang(252);}elseif($_POST["copy"]){$I=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$me=lang(253);}elseif($_POST["drop"]){if($_POST["views"])$I=drop_views($_POST["views"]);if($I&&$_POST["tables"])$I=drop_tables($_POST["tables"]);$me=lang(254);}elseif($w!="sql"){$I=($w=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$me=lang(255);}elseif(!$_POST["tables"])$me=lang(9);elseif($I=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($K=$I->fetch_assoc())$me.="<b>".h($K["Table"])."</b>: ".h($K["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$me,$I);}page_header(($_GET["ns"]==""?lang(35).": ".h(DB):lang(68).": ".h($_GET["ns"])),$n,true);if($b->homepage()){if($_GET["ns"]!==""){echo"<h3 id='tables-views'>".lang(256)."</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(257)." <span id='selected2'></span></legend><div>","<input type='search' name='query' value='".h($_POST["query"])."'> <input type='submit' name='search' value='".lang(47)."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!="")search_tables();}echo"<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n",'<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';$Ub=doc_link(array('sql'=>'show-table-status.html'));echo'<th>'.lang(119),'<td>'.lang(258).doc_link(array('sql'=>'storage-engines.html')),'<td>'.lang(111).doc_link(array('sql'=>'charset-mysql.html')),'<td>'.lang(259).$Ub,'<td>'.lang(260).$Ub,'<td>'.lang(261).$Ub,'<td>'.lang(56).doc_link(array('sql'=>'example-auto-increment.html')),'<td>'.lang(262).$Ub,(support("comment")?'<td>'.lang(96).$Ub:''),"</thead>\n";$S=0;foreach($Yg
     5901as$C=>$U){$Xh=($U!==null&&!preg_match('~table~i',$U));echo'<tr'.odd().'><td>'.checkbox(($Xh?"views[]":"tables[]"),$C,in_array($C,$Zg,true),"","formUncheck('check-all');"),'<th>'.(support("table")||support("indexes")?'<a href="'.h(ME).'table='.urlencode($C).'" title="'.lang(39).'">'.h($C).'</a>':h($C));if($Xh){echo'<td colspan="6"><a href="'.h(ME)."view=".urlencode($C).'" title="'.lang(40).'">'.(preg_match('~materialized~i',$U)?lang(263):lang(118)).'</a>','<td align="right"><a href="'.h(ME)."select=".urlencode($C).'" title="'.lang(38).'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",lang(41)),"Index_length"=>array("indexes",lang(122)),"Data_free"=>array("edit",lang(42)),"Auto_increment"=>array("auto_increment=1&create",lang(41)),"Rows"=>array("select",lang(38)),)as$x=>$_){$jd=" id='$x-".h($C)."'";echo($_?"<td align='right'>".(support("table")||$x=="Rows"||(support("indexes")&&$x!="Data_length")?"<a href='".h(ME."$_[0]=").urlencode($C)."'$jd title='$_[1]'>?</a>":"<span$jd>?</span>"):"<td id='$x-".h($C)."'>&nbsp;");}$S++;}echo(support("comment")?"<td id='Comment-".h($C)."'>&nbsp;":"");}echo"<tr><td>&nbsp;<th>".lang(235,count($Yg)),"<td>".nbsp($w=="sql"?$h->result("SELECT @@storage_engine"):""),"<td>".nbsp(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$x)echo"<td align='right' id='sum-$x'>&nbsp;";echo"</table>\n";if(!information_schema(DB)){$Rh="<input type='submit' value='".lang(264)."'".on_help("'VACUUM'")."> ";$Te="<input type='submit' name='optimize' value='".lang(265)."'".on_help($w=="sql"?"'OPTIMIZE TABLE'":"'VACUUM OPTIMIZE'")."> ";echo"<fieldset><legend>".lang(115)." <span id='selected'></span></legend><div>".($w=="sqlite"?$Rh:($w=="pgsql"?$Rh.$Te:($w=="sql"?"<input type='submit' value='".lang(266)."'".on_help("'ANALYZE TABLE'")."> ".$Te."<input type='submit' name='check' value='".lang(267)."'".on_help("'CHECK TABLE'")."> "."<input type='submit' name='repair' value='".lang(268)."'".on_help("'REPAIR TABLE'")."> ":"")))."<input type='submit' name='truncate' value='".lang(269)."'".confirm().on_help($w=="sqlite"?"'DELETE'":"'TRUNCATE".($w=="pgsql"?"'":" TABLE'"))."> "."<input type='submit' name='drop' value='".lang(116)."'".confirm().on_help("'DROP TABLE'").">\n";$l=(support("scheme")?$b->schemas():$b->databases());if(count($l)!=1&&$w!="sqlite"){$m=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".lang(270).": ",($l?html_select("target",$l,$m):'<input name="target" value="'.h($m).'" autocapitalize="off">')," <input type='submit' name='move' value='".lang(271)."'>",(support("copy")?" <input type='submit' name='copy' value='".lang(272)."'>":""),"\n";}echo"<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^(tables|views)\[/));".(support("table")?" selectCount('selected2', formChecked(this, /^tables\[/) || $S);":"")."\">\n";echo"<input type='hidden' name='token' value='$T'>\n","</div></fieldset>\n";}echo"</form>\n","<script type='text/javascript'>tableCheck();</script>\n";}echo'<p class="links"><a href="'.h(ME).'create=">'.lang(66)."</a>\n",(support("view")?'<a href="'.h(ME).'view=">'.lang(192)."</a>\n":""),(support("materializedview")?'<a href="'.h(ME).'view=&amp;materialized=1">'.lang(273)."</a>\n":"");if(support("routine")){echo"<h3 id='routines'>".lang(132)."</h3>\n";$kg=routines();if($kg){echo"<table cellspacing='0'>\n",'<thead><tr><th>'.lang(170).'<td>'.lang(92).'<td>'.lang(209)."<td>&nbsp;</thead>\n";odd('');foreach($kg
    58885902as$K){echo'<tr'.odd().'>','<th><a href="'.h(ME).($K["ROUTINE_TYPE"]!="PROCEDURE"?'callf=':'call=').urlencode($K["ROUTINE_NAME"]).'">'.h($K["ROUTINE_NAME"]).'</a>','<td>'.h($K["ROUTINE_TYPE"]),'<td>'.h($K["DTD_IDENTIFIER"]),'<td><a href="'.h(ME).($K["ROUTINE_TYPE"]!="PROCEDURE"?'function=':'procedure=').urlencode($K["ROUTINE_NAME"]).'">'.lang(125)."</a>";}echo"</table>\n";}echo'<p class="links">'.(support("procedure")?'<a href="'.h(ME).'procedure=">'.lang(208).'</a>':'').'<a href="'.h(ME).'function=">'.lang(207)."</a>\n";}if(support("sequence")){echo"<h3 id='sequences'>".lang(274)."</h3>\n";$wg=get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema() ORDER BY sequence_name");if($wg){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(170)."</thead>\n";odd('');foreach($wg
    58895903as$X)echo"<tr".odd()."><th><a href='".h(ME)."sequence=".urlencode($X)."'>".h($X)."</a>\n";echo"</table>\n";}echo"<p class='links'><a href='".h(ME)."sequence='>".lang(214)."</a>\n";}if(support("type")){echo"<h3 id='user-types'>".lang(23)."</h3>\n";$Ph=types();if($Ph){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(170)."</thead>\n";odd('');foreach($Ph
    58905904as$X)echo"<tr".odd()."><th><a href='".h(ME)."type=".urlencode($X)."'>".h($X)."</a>\n";echo"</table>\n";}echo"<p class='links'><a href='".h(ME)."type='>".lang(218)."</a>\n";}if(support("event")){echo"<h3 id='events'>".lang(133)."</h3>\n";$L=get_rows("SHOW EVENTS");if($L){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(170)."<td>".lang(275)."<td>".lang(198)."<td>".lang(199)."<td></thead>\n";foreach($L
    5891 as$K){echo"<tr>","<th>".h($K["Name"]),"<td>".($K["Execute at"]?lang(276)."<td>".$K["Execute at"]:lang(200)." ".$K["Interval value"]." ".$K["Interval field"]."<td>$K[Starts]"),"<td>$K[Ends]",'<td><a href="'.h(ME).'event='.urlencode($K["Name"]).'">'.lang(125).'</a>';}echo"</table>\n";$uc=$h->result("SELECT @@event_scheduler");if($uc&&$uc!="ON")echo"<p class='error'><code class='jush-sqlset'>event_scheduler</code>: ".h($uc)."\n";}echo'<p class="links"><a href="'.h(ME).'event=">'.lang(197)."</a>\n";}if($Yg)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}}}page_footer();
     5905as$K){echo"<tr>","<th>".h($K["Name"]),"<td>".($K["Execute at"]?lang(276)."<td>".$K["Execute at"]:lang(200)." ".$K["Interval value"]." ".$K["Interval field"]."<td>$K[Starts]"),"<td>$K[Ends]",'<td><a href="'.h(ME).'event='.urlencode($K["Name"]).'">'.lang(125).'</a>';}echo"</table>\n";$tc=$h->result("SELECT @@event_scheduler");if($tc&&$tc!="ON")echo"<p class='error'><code class='jush-sqlset'>event_scheduler</code>: ".h($tc)."\n";}echo'<p class="links"><a href="'.h(ME).'event=">'.lang(197)."</a>\n";}if($Yg)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}}}page_footer();
  • _plugins_/adminer/plugin.xml

    r87499 r87842  
    33        <slogan>Utiliser Adminer pour explorer la base SPIP</slogan>
    44        <auteur>Jakub Vrana (http://www.vrana.cz/), mis en plugin par Fil</auteur>
    5         <version>4.2.0.1</version>
     5        <version>4.2.1.0</version>
    66        <etat>test</etat>
    77        <prefix>adminer</prefix>
Note: See TracChangeset for help on using the changeset viewer.