Changeset 120903 in spip-zone


Ignore:
Timestamp:
Jan 31, 2020, 11:25:58 AM (4 months ago)
Author:
real3t@…
Message:

[Adminer] : Passage en 4.7.6 (avec l'habituel renommage de la fonction is_utf8 en isutf8 pour ne pas avoir de conflit avec la fonction de SPIP du même nom)

Location:
_plugins_/adminer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/adminer/adminer.php

    r118925 r120903  
    66* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
    77* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
    8 * @version 4.7.5
    9 */error_reporting(6135);$Xc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Xc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Ji=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Ji)$$X=$Ji;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function
     8* @version 4.7.6
     9*/error_reporting(6135);$Zc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($Zc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Li=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Li)$$X=$Li;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function
    1010connection(){global$h;return$h;}function
    1111adminer(){global$b;return$b;}function
    1212version(){global$ia;return$ia;}function
    13 idf_unescape($u){$qe=substr($u,-1);return
    14 str_replace($qe.$qe,$qe,substr($u,1,-1));}function
     13idf_unescape($u){$se=substr($u,-1);return
     14str_replace($se.$se,$se,substr($u,1,-1));}function
    1515escape_string($X){return
    1616substr(q($X),1,-1);}function
     
    1818preg_replace('~[^0-9]+~','',$X);}function
    1919number_type(){return'((?<!o)int(?!er)|numeric|real|float|double|decimal|money)';}function
    20 remove_slashes($tg,$Xc=false){if(get_magic_quotes_gpc()){while(list($y,$X)=each($tg)){foreach($X
    21 as$fe=>$W){unset($tg[$y][$fe]);if(is_array($W)){$tg[$y][stripslashes($fe)]=$W;$tg[]=&$tg[$y][stripslashes($fe)];}else$tg[$y][stripslashes($fe)]=($Xc?$W:stripslashes($W));}}}}function
    22 bracket_escape($u,$Pa=false){static$vi=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return
    23 strtr($u,($Pa?array_flip($vi):$vi));}function
    24 min_version($bj,$Ee="",$i=null){global$h;if(!$i)$i=$h;$oh=$i->server_info;if($Ee&&preg_match('~([\d.]+)-MariaDB~',$oh,$A)){$oh=$A[1];$bj=$Ee;}return(version_compare($oh,$bj)>=0);}function
     20remove_slashes($vg,$Zc=false){if(get_magic_quotes_gpc()){while(list($y,$X)=each($vg)){foreach($X
     21as$he=>$W){unset($vg[$y][$he]);if(is_array($W)){$vg[$y][stripslashes($he)]=$W;$vg[]=&$vg[$y][stripslashes($he)];}else$vg[$y][stripslashes($he)]=($Zc?$W:stripslashes($W));}}}}function
     22bracket_escape($u,$Pa=false){static$xi=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return
     23strtr($u,($Pa?array_flip($xi):$xi));}function
     24min_version($dj,$Ge="",$i=null){global$h;if(!$i)$i=$h;$qh=$i->server_info;if($Ge&&preg_match('~([\d.]+)-MariaDB~',$qh,$A)){$qh=$A[1];$dj=$Ge;}return(version_compare($qh,$dj)>=0);}function
    2525charset($h){return(min_version("5.5.3",0,$h)?"utf8mb4":"utf8");}function
    26 script($zh,$ui="\n"){return"<script".nonce().">$zh</script>$ui";}function
    27 script_src($Oi){return"<script src='".h($Oi)."'".nonce()."></script>\n";}function
     26script($Ah,$wi="\n"){return"<script".nonce().">$Ah</script>$wi";}function
     27script_src($Qi){return"<script src='".h($Qi)."'".nonce()."></script>\n";}function
    2828nonce(){return' nonce="'.get_nonce().'"';}function
    2929target_blank(){return' target="_blank" rel="noreferrer noopener"';}function
     
    3232nl_br($P){return
    3333str_replace("\n","<br>",$P);}function
    34 checkbox($B,$Y,$gb,$me="",$vf="",$lb="",$ne=""){$H="<input type='checkbox' name='$B' value='".h($Y)."'".($gb?" checked":"").($ne?" aria-labelledby='$ne'":"").">".($vf?script("qsl('input').onclick = function () { $vf };",""):"");return($me!=""||$lb?"<label".($lb?" class='$lb'":"").">$H".h($me)."</label>":$H);}function
    35 optionlist($Af,$ih=null,$Ti=false){$H="";foreach($Af
    36 as$fe=>$W){$Bf=array($fe=>$W);if(is_array($W)){$H.='<optgroup label="'.h($fe).'">';$Bf=$W;}foreach($Bf
    37 as$y=>$X)$H.='<option'.($Ti||is_string($y)?' value="'.h($y).'"':'').(($Ti||is_string($y)?(string)$y:$X)===$ih?' selected':'').'>'.h($X);if(is_array($W))$H.='</optgroup>';}return$H;}function
    38 html_select($B,$Af,$Y="",$uf=true,$ne=""){if($uf)return"<select name='".h($B)."'".($ne?" aria-labelledby='$ne'":"").">".optionlist($Af,$Y)."</select>".(is_string($uf)?script("qsl('select').onchange = function () { $uf };",""):"");$H="";foreach($Af
     34checkbox($B,$Y,$gb,$oe="",$xf="",$lb="",$pe=""){$H="<input type='checkbox' name='$B' value='".h($Y)."'".($gb?" checked":"").($pe?" aria-labelledby='$pe'":"").">".($xf?script("qsl('input').onclick = function () { $xf };",""):"");return($oe!=""||$lb?"<label".($lb?" class='$lb'":"").">$H".h($oe)."</label>":$H);}function
     35optionlist($Cf,$kh=null,$Vi=false){$H="";foreach($Cf
     36as$he=>$W){$Df=array($he=>$W);if(is_array($W)){$H.='<optgroup label="'.h($he).'">';$Df=$W;}foreach($Df
     37as$y=>$X)$H.='<option'.($Vi||is_string($y)?' value="'.h($y).'"':'').(($Vi||is_string($y)?(string)$y:$X)===$kh?' selected':'').'>'.h($X);if(is_array($W))$H.='</optgroup>';}return$H;}function
     38html_select($B,$Cf,$Y="",$wf=true,$pe=""){if($wf)return"<select name='".h($B)."'".($pe?" aria-labelledby='$pe'":"").">".optionlist($Cf,$Y)."</select>".(is_string($wf)?script("qsl('select').onchange = function () { $wf };",""):"");$H="";foreach($Cf
    3939as$y=>$X)$H.="<label><input type='radio' name='".h($B)."' value='".h($y)."'".($y==$Y?" checked":"").">".h($X)."</label>";return$H;}function
    40 select_input($Ka,$Af,$Y="",$uf="",$fg=""){$Zh=($Af?"select":"input");return"<$Zh$Ka".($Af?"><option value=''>$fg".optionlist($Af,$Y,true)."</select>":" size='10' value='".h($Y)."' placeholder='$fg'>").($uf?script("qsl('$Zh').onchange = $uf;",""):"");}function
    41 confirm($Oe="",$jh="qsl('input')"){return
    42 script("$jh.onclick = function () { return confirm('".($Oe?js_escape($Oe):lang(0))."'); };","");}function
    43 print_fieldset($t,$ve,$ej=false){echo"<fieldset><legend>","<a href='#fieldset-$t'>$ve</a>",script("qsl('a').onclick = partial(toggle, 'fieldset-$t');",""),"</legend>","<div id='fieldset-$t'".($ej?"":" class='hidden'").">\n";}function
     40select_input($Ka,$Cf,$Y="",$wf="",$hg=""){$bi=($Cf?"select":"input");return"<$bi$Ka".($Cf?"><option value=''>$hg".optionlist($Cf,$Y,true)."</select>":" size='10' value='".h($Y)."' placeholder='$hg'>").($wf?script("qsl('$bi').onchange = $wf;",""):"");}function
     41confirm($Qe="",$lh="qsl('input')"){return
     42script("$lh.onclick = function () { return confirm('".($Qe?js_escape($Qe):lang(0))."'); };","");}function
     43print_fieldset($t,$xe,$gj=false){echo"<fieldset><legend>","<a href='#fieldset-$t'>$xe</a>",script("qsl('a').onclick = partial(toggle, 'fieldset-$t');",""),"</legend>","<div id='fieldset-$t'".($gj?"":" class='hidden'").">\n";}function
    4444bold($Xa,$lb=""){return($Xa?" class='active $lb'":($lb?" class='$lb'":""));}function
    4545odd($H=' class="odd"'){static$s=0;if(!$H)$s=-1;return($s++%2?$H:'');}function
    4646js_escape($P){return
    4747addcslashes($P,"\r\n'\\/");}function
    48 json_row($y,$X=null){static$Yc=true;if($Yc)echo"{";if($y!=""){echo($Yc?"":",")."\n\t\"".addcslashes($y,"\r\n\t\"\\/").'": '.($X!==null?'"'.addcslashes($X,"\r\n\"\\/").'"':'null');$Yc=false;}else{echo"\n}\n";$Yc=true;}}function
    49 ini_bool($Sd){$X=ini_get($Sd);return(preg_match('~^(on|true|yes)$~i',$X)||(int)$X);}function
     48json_row($y,$X=null){static$ad=true;if($ad)echo"{";if($y!=""){echo($ad?"":",")."\n\t\"".addcslashes($y,"\r\n\t\"\\/").'": '.($X!==null?'"'.addcslashes($X,"\r\n\"\\/").'"':'null');$ad=false;}else{echo"\n}\n";$ad=true;}}function
     49ini_bool($Ud){$X=ini_get($Ud);return(preg_match('~^(on|true|yes)$~i',$X)||(int)$X);}function
    5050sid(){static$H;if($H===null)$H=(SID&&!($_COOKIE&&ini_bool("session.use_cookies")));return$H;}function
    51 set_password($aj,$M,$V,$E){$_SESSION["pwds"][$aj][$M][$V]=($_COOKIE["adminer_key"]&&is_string($E)?array(encrypt_string($E,$_COOKIE["adminer_key"])):$E);}function
     51set_password($cj,$M,$V,$E){$_SESSION["pwds"][$cj][$M][$V]=($_COOKIE["adminer_key"]&&is_string($E)?array(encrypt_string($E,$_COOKIE["adminer_key"])):$E);}function
    5252get_password(){$H=get_session("pwds");if(is_array($H))$H=($_COOKIE["adminer_key"]?decrypt_string($H[0],$_COOKIE["adminer_key"]):false);return$H;}function
    5353q($P){global$h;return$h->quote($P);}function
    5454get_vals($F,$e=0){global$h;$H=array();$G=$h->query($F);if(is_object($G)){while($I=$G->fetch_row())$H[]=$I[$e];}return$H;}function
    55 get_key_vals($F,$i=null,$rh=true){global$h;if(!is_object($i))$i=$h;$H=array();$G=$i->query($F);if(is_object($G)){while($I=$G->fetch_row()){if($rh)$H[$I[0]]=$I[1];else$H[]=$I[0];}}return$H;}function
    56 get_rows($F,$i=null,$n="<p class='error'>"){global$h;$yb=(is_object($i)?$i:$h);$H=array();$G=$yb->query($F);if(is_object($G)){while($I=$G->fetch_assoc())$H[]=$I;}elseif(!$G&&!is_object($i)&&$n&&defined("PAGE_HEADER"))echo$n.error()."\n";return$H;}function
     55get_key_vals($F,$i=null,$th=true){global$h;if(!is_object($i))$i=$h;$H=array();$G=$i->query($F);if(is_object($G)){while($I=$G->fetch_row()){if($th)$H[$I[0]]=$I[1];else$H[]=$I[0];}}return$H;}function
     56get_rows($F,$i=null,$n="<p class='error'>"){global$h;$zb=(is_object($i)?$i:$h);$H=array();$G=$zb->query($F);if(is_object($G)){while($I=$G->fetch_assoc())$H[]=$I;}elseif(!$G&&!is_object($i)&&$n&&defined("PAGE_HEADER"))echo$n.error()."\n";return$H;}function
    5757unique_array($I,$w){foreach($w
    5858as$v){if(preg_match("~PRIMARY|UNIQUE~",$v["type"])){$H=array();foreach($v["columns"]as$y){if(!isset($I[$y]))continue
     
    6464where_check($X,$p=array()){parse_str($X,$eb);remove_slashes(array(&$eb));return
    6565where($eb,$p);}function
    66 where_link($s,$e,$Y,$xf="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($e)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$xf:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
     66where_link($s,$e,$Y,$zf="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($e)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$zf:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
    6767convert_fields($f,$p,$K=array()){$H="";foreach($f
    6868as$y=>$X){if($K&&!in_array(idf_escape($y),$K))continue;$Ha=convert_field($p[$y]);if($Ha)$H.=", $Ha AS ".idf_escape($y);}return$H;}function
    69 cookie($B,$Y,$ye=2592000){global$ba;return
    70 header("Set-Cookie: $B=".urlencode($Y).($ye?"; expires=".gmdate("D, d M Y H:i:s",time()+$ye)." GMT":"")."; path=".preg_replace('~\?.*~','',$_SERVER["REQUEST_URI"]).($ba?"; secure":"")."; HttpOnly; SameSite=lax",false);}function
     69cookie($B,$Y,$_e=2592000){global$ba;return
     70header("Set-Cookie: $B=".urlencode($Y).($_e?"; expires=".gmdate("D, d M Y H:i:s",time()+$_e)." GMT":"")."; path=".preg_replace('~\?.*~','',$_SERVER["REQUEST_URI"]).($ba?"; secure":"")."; HttpOnly; SameSite=lax",false);}function
    7171restart_session(){if(!ini_bool("session.use_cookies"))session_start();}function
    72 stop_session($dd=false){$Si=ini_bool("session.use_cookies");if(!$Si||$dd){session_write_close();if($Si&&@ini_set("session.use_cookies",false)===false)session_start();}}function&get_session($y){return$_SESSION[$y][DRIVER][SERVER][$_GET["username"]];}function
     72stop_session($fd=false){$Ui=ini_bool("session.use_cookies");if(!$Ui||$fd){session_write_close();if($Ui&&@ini_set("session.use_cookies",false)===false)session_start();}}function&get_session($y){return$_SESSION[$y][DRIVER][SERVER][$_GET["username"]];}function
    7373set_session($y,$X){$_SESSION[$y][DRIVER][SERVER][$_GET["username"]]=$X;}function
    74 auth_url($aj,$M,$V,$l=null){global$gc;preg_match('~([^?]*)\??(.*)~',remove_from_uri(implode("|",array_keys($gc))."|username|".($l!==null?"db|":"").session_name()),$A);return"$A[1]?".(sid()?SID."&":"").($aj!="server"||$M!=""?urlencode($aj)."=".urlencode($M)."&":"")."username=".urlencode($V).($l!=""?"&db=".urlencode($l):"").($A[2]?"&$A[2]":"");}function
     74auth_url($cj,$M,$V,$l=null){global$ic;preg_match('~([^?]*)\??(.*)~',remove_from_uri(implode("|",array_keys($ic))."|username|".($l!==null?"db|":"").session_name()),$A);return"$A[1]?".(sid()?SID."&":"").($cj!="server"||$M!=""?urlencode($cj)."=".urlencode($M)."&":"")."username=".urlencode($V).($l!=""?"&db=".urlencode($l):"").($A[2]?"&$A[2]":"");}function
    7575is_ajax(){return($_SERVER["HTTP_X_REQUESTED_WITH"]=="XMLHttpRequest");}function
    76 redirect($_e,$Oe=null){if($Oe!==null){restart_session();$_SESSION["messages"][preg_replace('~^[^?]*~','',($_e!==null?$_e:$_SERVER["REQUEST_URI"]))][]=$Oe;}if($_e!==null){if($_e=="")$_e=".";header("Location: $_e");exit;}}function
    77 query_redirect($F,$_e,$Oe,$Eg=true,$Ec=true,$Pc=false,$hi=""){global$h,$n,$b;if($Ec){$Gh=microtime(true);$Pc=!$h->query($F);$hi=format_time($Gh);}$Bh="";if($F)$Bh=$b->messageQuery($F,$hi,$Pc);if($Pc){$n=error().$Bh.script("messagesPrint();");return
    78 false;}if($Eg)redirect($_e,$Oe.$Bh);return
     76redirect($Be,$Qe=null){if($Qe!==null){restart_session();$_SESSION["messages"][preg_replace('~^[^?]*~','',($Be!==null?$Be:$_SERVER["REQUEST_URI"]))][]=$Qe;}if($Be!==null){if($Be=="")$Be=".";header("Location: $Be");exit;}}function
     77query_redirect($F,$Be,$Qe,$Gg=true,$Gc=true,$Rc=false,$ji=""){global$h,$n,$b;if($Gc){$Ih=microtime(true);$Rc=!$h->query($F);$ji=format_time($Ih);}$Dh="";if($F)$Dh=$b->messageQuery($F,$ji,$Rc);if($Rc){$n=error().$Dh.script("messagesPrint();");return
     78false;}if($Gg)redirect($Be,$Qe.$Dh);return
    7979true;}function
    80 queries($F){global$h;static$yg=array();static$Gh;if(!$Gh)$Gh=microtime(true);if($F===null)return
    81 array(implode("\n",$yg),format_time($Gh));$yg[]=(preg_match('~;$~',$F)?"DELIMITER ;;\n$F;\nDELIMITER ":$F).";";return$h->query($F);}function
    82 apply_queries($F,$S,$Ac='table'){foreach($S
    83 as$Q){if(!queries("$F ".$Ac($Q)))return
     80queries($F){global$h;static$_g=array();static$Ih;if(!$Ih)$Ih=microtime(true);if($F===null)return
     81array(implode("\n",$_g),format_time($Ih));$_g[]=(preg_match('~;$~',$F)?"DELIMITER ;;\n$F;\nDELIMITER ":$F).";";return$h->query($F);}function
     82apply_queries($F,$S,$Cc='table'){foreach($S
     83as$Q){if(!queries("$F ".$Cc($Q)))return
    8484false;}return
    8585true;}function
    86 queries_redirect($_e,$Oe,$Eg){list($yg,$hi)=queries(null);return
    87 query_redirect($yg,$_e,$Oe,$Eg,false,!$Eg,$hi);}function
    88 format_time($Gh){return
    89 lang(1,max(0,microtime(true)-$Gh));}function
    90 remove_from_uri($Qf=""){return
    91 substr(preg_replace("~(?<=[?&])($Qf".(SID?"":"|".session_name()).")=[^&]*&~",'',"$_SERVER[REQUEST_URI]&"),0,-1);}function
    92 pagination($D,$Mb){return" ".($D==$Mb?$D+1:'<a href="'.h(remove_from_uri("page").($D?"&page=$D".($_GET["next"]?"&next=".urlencode($_GET["next"]):""):"")).'">'.($D+1)."</a>");}function
    93 get_file($y,$Ub=false){$Vc=$_FILES[$y];if(!$Vc)return
    94 null;foreach($Vc
    95 as$y=>$X)$Vc[$y]=(array)$X;$H='';foreach($Vc["error"]as$y=>$n){if($n)return$n;$B=$Vc["name"][$y];$pi=$Vc["tmp_name"][$y];$Ab=file_get_contents($Ub&&preg_match('~\.gz$~',$B)?"compress.zlib://$pi":$pi);if($Ub){$Gh=substr($Ab,0,3);if(function_exists("iconv")&&preg_match("~^\xFE\xFF|^\xFF\xFE~",$Gh,$Kg))$Ab=iconv("utf-16","utf-8",$Ab);elseif($Gh=="\xEF\xBB\xBF")$Ab=substr($Ab,3);$H.=$Ab."\n\n";}else$H.=$Ab;}return$H;}function
    96 upload_error($n){$Le=($n==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):0);return($n?lang(2).($Le?" ".lang(3,$Le):""):lang(4));}function
    97 repeat_pattern($dg,$we){return
    98 str_repeat("$dg{0,65535}",$we/65535)."$dg{0,".($we%65535)."}";}function
     86queries_redirect($Be,$Qe,$Gg){list($_g,$ji)=queries(null);return
     87query_redirect($_g,$Be,$Qe,$Gg,false,!$Gg,$ji);}function
     88format_time($Ih){return
     89lang(1,max(0,microtime(true)-$Ih));}function
     90remove_from_uri($Sf=""){return
     91substr(preg_replace("~(?<=[?&])($Sf".(SID?"":"|".session_name()).")=[^&]*&~",'',"$_SERVER[REQUEST_URI]&"),0,-1);}function
     92pagination($D,$Nb){return" ".($D==$Nb?$D+1:'<a href="'.h(remove_from_uri("page").($D?"&page=$D".($_GET["next"]?"&next=".urlencode($_GET["next"]):""):"")).'">'.($D+1)."</a>");}function
     93get_file($y,$Vb=false){$Xc=$_FILES[$y];if(!$Xc)return
     94null;foreach($Xc
     95as$y=>$X)$Xc[$y]=(array)$X;$H='';foreach($Xc["error"]as$y=>$n){if($n)return$n;$B=$Xc["name"][$y];$ri=$Xc["tmp_name"][$y];$Bb=file_get_contents($Vb&&preg_match('~\.gz$~',$B)?"compress.zlib://$ri":$ri);if($Vb){$Ih=substr($Bb,0,3);if(function_exists("iconv")&&preg_match("~^\xFE\xFF|^\xFF\xFE~",$Ih,$Mg))$Bb=iconv("utf-16","utf-8",$Bb);elseif($Ih=="\xEF\xBB\xBF")$Bb=substr($Bb,3);$H.=$Bb."\n\n";}else$H.=$Bb;}return$H;}function
     96upload_error($n){$Ne=($n==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):0);return($n?lang(2).($Ne?" ".lang(3,$Ne):""):lang(4));}function
     97repeat_pattern($fg,$ye){return
     98str_repeat("$fg{0,65535}",$ye/65535)."$fg{0,".($ye%65535)."}";}function
    9999isutf8($X){return(preg_match('~~u',$X)&&!preg_match('~[\0-\x8\xB\xC\xE-\x1F]~',$X));}function
    100 shorten_utf8($P,$we=80,$Nh=""){if(!preg_match("(^(".repeat_pattern("[\t\r\n -\x{10FFFF}]",$we).")($)?)u",$P,$A))preg_match("(^(".repeat_pattern("[\t\r\n -~]",$we).")($)?)",$P,$A);return
    101 h($A[1]).$Nh.(isset($A[2])?"":"<i>…</i>");}function
     100shorten_utf8($P,$ye=80,$Ph=""){if(!preg_match("(^(".repeat_pattern("[\t\r\n -\x{10FFFF}]",$ye).")($)?)u",$P,$A))preg_match("(^(".repeat_pattern("[\t\r\n -~]",$ye).")($)?)",$P,$A);return
     101h($A[1]).$Ph.(isset($A[2])?"":"<i>…</i>");}function
    102102format_number($X){return
    103103strtr(number_format($X,0,".",lang(5)),preg_split('~~u',lang(6),-1,PREG_SPLIT_NO_EMPTY));}function
    104104friendly_url($X){return
    105105preg_replace('~[^a-z0-9_]~i','-',$X);}function
    106 hidden_fields($tg,$Hd=array()){$H=false;while(list($y,$X)=each($tg)){if(!in_array($y,$Hd)){if(is_array($X)){foreach($X
    107 as$fe=>$W)$tg[$y."[$fe]"]=$W;}else{$H=true;echo'<input type="hidden" name="'.h($y).'" value="'.h($X).'">';}}}return$H;}function
     106hidden_fields($vg,$Jd=array()){$H=false;while(list($y,$X)=each($vg)){if(!in_array($y,$Jd)){if(is_array($X)){foreach($X
     107as$he=>$W)$vg[$y."[$he]"]=$W;}else{$H=true;echo'<input type="hidden" name="'.h($y).'" value="'.h($X).'">';}}}return$H;}function
    108108hidden_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
    109 table_status1($Q,$Qc=false){$H=table_status($Q,$Qc);return($H?$H:array("Name"=>$Q));}function
     109table_status1($Q,$Sc=false){$H=table_status($Q,$Sc);return($H?$H:array("Name"=>$Q));}function
    110110column_foreign_keys($Q){global$b;$H=array();foreach($b->foreignKeys($Q)as$q){foreach($q["source"]as$X)$H[$X][]=$q;}return$H;}function
    111 enum_input($T,$Ka,$o,$Y,$vc=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$Ge);$H=($vc!==null?"<label><input type='$T'$Ka value='$vc'".((is_array($Y)?in_array($vc,$Y):$Y===0)?" checked":"")."><i>".lang(7)."</i></label>":"");foreach($Ge[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$gb=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$H.=" <label><input type='$T'$Ka value='".($s+1)."'".($gb?' checked':'').'>'.h($b->editVal($X,$o)).'</label>';}return$H;}function
    112 input($o,$Y,$r){global$U,$b,$x;$B=h(bracket_escape($o["field"]));echo"<td class='function'>";if(is_array($Y)&&!$r){$Fa=array($Y);if(version_compare(PHP_VERSION,5.4)>=0)$Fa[]=JSON_PRETTY_PRINT;$Y=call_user_func_array('json_encode',$Fa);$r="json";}$Og=($x=="mssql"&&$o["auto_increment"]);if($Og&&!$_POST["save"])$r=null;$md=(isset($_GET["select"])||$Og?array("orig"=>lang(8)):array())+$b->editFunctions($o);$Ka=" name='fields[$B]'";if($o["type"]=="enum")echo
    113 h($md[""])."<td>".$b->editInput($_GET["edit"],$o,$Ka,$Y);else{$wd=(in_array($r,$md)||isset($md[$r]));echo(count($md)>1?"<select name='function[$B]'>".optionlist($md,$r===null||$wd?$r:"")."</select>".on_help("getTarget(event).value.replace(/^SQL\$/, '')",1).script("qsl('select').onchange = functionChange;",""):h(reset($md))).'<td>';$Ud=$b->editInput($_GET["edit"],$o,$Ka,$Y);if($Ud!="")echo$Ud;elseif(preg_match('~bool~',$o["type"]))echo"<input type='hidden'$Ka value='0'>"."<input type='checkbox'".(preg_match('~^(1|t|true|y|yes|on)$~i',$Y)?" checked='checked'":"")."$Ka value='1'>";elseif($o["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$Ge);foreach($Ge[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$gb=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$B][$s]' value='".(1<<$s)."'".($gb?' checked':'').">".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-$B'>";elseif(($fi=preg_match('~text|lob|memo~i',$o["type"]))||preg_match("~\n~",$Y)){if($fi&&$x!="sqlite")$Ka.=" cols='50' rows='12'";else{$J=min(12,substr_count($Y,"\n")+1);$Ka.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$Ka>".h($Y).'</textarea>';}elseif($r=="json"||preg_match('~^jsonb?$~',$o["type"]))echo"<textarea$Ka cols='50' rows='12' class='jush-js'>".h($Y).'</textarea>';else{$Ne=(!preg_match('~int~',$o["type"])&&preg_match('~^(\d+)(,(\d+))?$~',$o["length"],$A)?((preg_match("~binary~",$o["type"])?2:1)*$A[1]+($A[3]?1:0)+($A[2]&&!$o["unsigned"]?1:0)):($U[$o["type"]]?$U[$o["type"]]+($o["unsigned"]?0:1):0));if($x=='sql'&&min_version(5.6)&&preg_match('~time~',$o["type"]))$Ne+=7;echo"<input".((!$wd||$r==="")&&preg_match('~(?<!o)int(?!er)~',$o["type"])&&!preg_match('~\[\]~',$o["full_type"])?" type='number'":"")." value='".h($Y)."'".($Ne?" data-maxlength='$Ne'":"").(preg_match('~char|binary~',$o["type"])&&$Ne>20?" size='40'":"")."$Ka>";}echo$b->editHint($_GET["edit"],$o,$Y);$Yc=0;foreach($md
    114 as$y=>$X){if($y===""||!$X)break;$Yc++;}if($Yc)echo
    115 script("mixin(qsl('td'), {onchange: partial(skipOriginal, $Yc), oninput: function () { this.onchange(); }});");}}function
     111enum_input($T,$Ka,$o,$Y,$xc=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$Ie);$H=($xc!==null?"<label><input type='$T'$Ka value='$xc'".((is_array($Y)?in_array($xc,$Y):$Y===0)?" checked":"")."><i>".lang(7)."</i></label>":"");foreach($Ie[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$gb=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$H.=" <label><input type='$T'$Ka value='".($s+1)."'".($gb?' checked':'').'>'.h($b->editVal($X,$o)).'</label>';}return$H;}function
     112input($o,$Y,$r){global$U,$b,$x;$B=h(bracket_escape($o["field"]));echo"<td class='function'>";if(is_array($Y)&&!$r){$Fa=array($Y);if(version_compare(PHP_VERSION,5.4)>=0)$Fa[]=JSON_PRETTY_PRINT;$Y=call_user_func_array('json_encode',$Fa);$r="json";}$Qg=($x=="mssql"&&$o["auto_increment"]);if($Qg&&!$_POST["save"])$r=null;$od=(isset($_GET["select"])||$Qg?array("orig"=>lang(8)):array())+$b->editFunctions($o);$Ka=" name='fields[$B]'";if($o["type"]=="enum")echo
     113h($od[""])."<td>".$b->editInput($_GET["edit"],$o,$Ka,$Y);else{$yd=(in_array($r,$od)||isset($od[$r]));echo(count($od)>1?"<select name='function[$B]'>".optionlist($od,$r===null||$yd?$r:"")."</select>".on_help("getTarget(event).value.replace(/^SQL\$/, '')",1).script("qsl('select').onchange = functionChange;",""):h(reset($od))).'<td>';$Wd=$b->editInput($_GET["edit"],$o,$Ka,$Y);if($Wd!="")echo$Wd;elseif(preg_match('~bool~',$o["type"]))echo"<input type='hidden'$Ka value='0'>"."<input type='checkbox'".(preg_match('~^(1|t|true|y|yes|on)$~i',$Y)?" checked='checked'":"")."$Ka value='1'>";elseif($o["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$o["length"],$Ie);foreach($Ie[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$gb=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$B][$s]' value='".(1<<$s)."'".($gb?' checked':'').">".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-$B'>";elseif(($hi=preg_match('~text|lob|memo~i',$o["type"]))||preg_match("~\n~",$Y)){if($hi&&$x!="sqlite")$Ka.=" cols='50' rows='12'";else{$J=min(12,substr_count($Y,"\n")+1);$Ka.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$Ka>".h($Y).'</textarea>';}elseif($r=="json"||preg_match('~^jsonb?$~',$o["type"]))echo"<textarea$Ka cols='50' rows='12' class='jush-js'>".h($Y).'</textarea>';else{$Pe=(!preg_match('~int~',$o["type"])&&preg_match('~^(\d+)(,(\d+))?$~',$o["length"],$A)?((preg_match("~binary~",$o["type"])?2:1)*$A[1]+($A[3]?1:0)+($A[2]&&!$o["unsigned"]?1:0)):($U[$o["type"]]?$U[$o["type"]]+($o["unsigned"]?0:1):0));if($x=='sql'&&min_version(5.6)&&preg_match('~time~',$o["type"]))$Pe+=7;echo"<input".((!$yd||$r==="")&&preg_match('~(?<!o)int(?!er)~',$o["type"])&&!preg_match('~\[\]~',$o["full_type"])?" type='number'":"")." value='".h($Y)."'".($Pe?" data-maxlength='$Pe'":"").(preg_match('~char|binary~',$o["type"])&&$Pe>20?" size='40'":"")."$Ka>";}echo$b->editHint($_GET["edit"],$o,$Y);$ad=0;foreach($od
     114as$y=>$X){if($y===""||!$X)break;$ad++;}if($ad)echo
     115script("mixin(qsl('td'), {onchange: partial(skipOriginal, $ad), oninput: function () { this.onchange(); }});");}}function
    116116process_input($o){global$b,$m;$u=bracket_escape($o["field"]);$r=$_POST["function"][$u];$Y=$_POST["fields"][$u];if($o["type"]=="enum"){if($Y==-1)return
    117117false;if($Y=="")return"NULL";return+$Y;}if($o["auto_increment"]&&$Y=="")return
    118118null;if($r=="orig")return(preg_match('~^CURRENT_TIMESTAMP~i',$o["on_update"])?idf_escape($o["field"]):false);if($r=="NULL")return"NULL";if($o["type"]=="set")return
    119119array_sum((array)$Y);if($r=="json"){$r="";$Y=json_decode($Y,true);if(!is_array($Y))return
    120 false;return$Y;}if(preg_match('~blob|bytea|raw|file~',$o["type"])&&ini_bool("file_uploads")){$Vc=get_file("fields-$u");if(!is_string($Vc))return
    121 false;return$m->quoteBinary($Vc);}return$b->processInput($o,$Y,$r);}function
     120false;return$Y;}if(preg_match('~blob|bytea|raw|file~',$o["type"])&&ini_bool("file_uploads")){$Xc=get_file("fields-$u");if(!is_string($Xc))return
     121false;return$m->quoteBinary($Xc);}return$b->processInput($o,$Y,$r);}function
    122122fields_from_edit(){global$m;$H=array();foreach((array)$_POST["field_keys"]as$y=>$X){if($X!=""){$X=bracket_escape($X);$_POST["function"][$X]=$_POST["field_funs"][$y];$_POST["fields"][$X]=$_POST["field_vals"][$y];}}foreach((array)$_POST["fields"]as$y=>$X){$B=bracket_escape($y,1);$H[$B]=array("field"=>$B,"privileges"=>array("insert"=>1,"update"=>1),"null"=>1,"auto_increment"=>($y==$m->primary),);}return$H;}function
    123 search_tables(){global$b,$h;$_GET["where"][0]["val"]=$_POST["query"];$lh="<ul>\n";foreach(table_status('',true)as$Q=>$R){$B=$b->tableName($R);if(isset($R["Engine"])&&$B!=""&&(!$_POST["tables"]||in_array($Q,$_POST["tables"]))){$G=$h->query("SELECT".limit("1 FROM ".table($Q)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($Q),array())),1));if(!$G||$G->fetch_row()){$pg="<a href='".h(ME."select=".urlencode($Q)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$B</a>";echo"$lh<li>".($G?$pg:"<p class='error'>$pg: ".error())."\n";$lh="";}}}echo($lh?"<p class='message'>".lang(9):"</ul>")."\n";}function
    124 dump_headers($Ed,$Xe=false){global$b;$H=$b->dumpHeaders($Ed,$Xe);$Nf=$_POST["output"];if($Nf!="text")header("Content-Disposition: attachment; filename=".$b->dumpFilename($Ed).".$H".($Nf!="file"&&!preg_match('~[^0-9a-z]~',$Nf)?".$Nf":""));session_write_close();ob_flush();flush();return$H;}function
     123search_tables(){global$b,$h;$_GET["where"][0]["val"]=$_POST["query"];$nh="<ul>\n";foreach(table_status('',true)as$Q=>$R){$B=$b->tableName($R);if(isset($R["Engine"])&&$B!=""&&(!$_POST["tables"]||in_array($Q,$_POST["tables"]))){$G=$h->query("SELECT".limit("1 FROM ".table($Q)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($Q),array())),1));if(!$G||$G->fetch_row()){$rg="<a href='".h(ME."select=".urlencode($Q)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$B</a>";echo"$nh<li>".($G?$rg:"<p class='error'>$rg: ".error())."\n";$nh="";}}}echo($nh?"<p class='message'>".lang(9):"</ul>")."\n";}function
     124dump_headers($Gd,$Ze=false){global$b;$H=$b->dumpHeaders($Gd,$Ze);$Pf=$_POST["output"];if($Pf!="text")header("Content-Disposition: attachment; filename=".$b->dumpFilename($Gd).".$H".($Pf!="file"&&!preg_match('~[^0-9a-z]~',$Pf)?".$Pf":""));session_write_close();ob_flush();flush();return$H;}function
    125125dump_csv($I){foreach($I
    126126as$y=>$X){if(preg_match("~[\"\n,;\t]~",$X)||$X==="")$I[$y]='"'.str_replace('"','""',$X).'"';}echo
    127127implode(($_POST["format"]=="csv"?",":($_POST["format"]=="tsv"?"\t":";")),$I)."\r\n";}function
    128128apply_sql_function($r,$e){return($r?($r=="unixepoch"?"DATETIME($e, '$r')":($r=="count distinct"?"COUNT(DISTINCT ":strtoupper("$r("))."$e)"):$e);}function
    129 get_temp_dir(){$H=ini_get("upload_tmp_dir");if(!$H){if(function_exists('sys_get_temp_dir'))$H=sys_get_temp_dir();else{$Wc=@tempnam("","");if(!$Wc)return
    130 false;$H=dirname($Wc);unlink($Wc);}}return$H;}function
    131 file_open_lock($Wc){$kd=@fopen($Wc,"r+");if(!$kd){$kd=@fopen($Wc,"w");if(!$kd)return;chmod($Wc,0660);}flock($kd,LOCK_EX);return$kd;}function
    132 file_write_unlock($kd,$Ob){rewind($kd);fwrite($kd,$Ob);ftruncate($kd,strlen($Ob));flock($kd,LOCK_UN);fclose($kd);}function
    133 password_file($Gb){$Wc=get_temp_dir()."/adminer.key";$H=@file_get_contents($Wc);if($H||!$Gb)return$H;$kd=@fopen($Wc,"w");if($kd){chmod($Wc,0660);$H=rand_string();fwrite($kd,$H);fclose($kd);}return$H;}function
     129get_temp_dir(){$H=ini_get("upload_tmp_dir");if(!$H){if(function_exists('sys_get_temp_dir'))$H=sys_get_temp_dir();else{$Yc=@tempnam("","");if(!$Yc)return
     130false;$H=dirname($Yc);unlink($Yc);}}return$H;}function
     131file_open_lock($Yc){$md=@fopen($Yc,"r+");if(!$md){$md=@fopen($Yc,"w");if(!$md)return;chmod($Yc,0660);}flock($md,LOCK_EX);return$md;}function
     132file_write_unlock($md,$Pb){rewind($md);fwrite($md,$Pb);ftruncate($md,strlen($Pb));flock($md,LOCK_UN);fclose($md);}function
     133password_file($Hb){$Yc=get_temp_dir()."/adminer.key";$H=@file_get_contents($Yc);if($H||!$Hb)return$H;$md=@fopen($Yc,"w");if($md){chmod($Yc,0660);$H=rand_string();fwrite($md,$H);fclose($md);}return$H;}function
    134134rand_string(){return
    135135md5(uniqid(mt_rand(),true));}function
    136 select_value($X,$_,$o,$gi){global$b;if(is_array($X)){$H="";foreach($X
    137 as$fe=>$W)$H.="<tr>".($X!=array_values($X)?"<th>".h($fe):"")."<td>".select_value($W,$_,$o,$gi);return"<table cellspacing='0'>$H</table>";}if(!$_)$_=$b->selectLink($X,$o);if($_===null){if(is_mail($X))$_="mailto:$X";if(is_url($X))$_=$X;}$H=$b->editVal($X,$o);if($H!==null){if(!isutf8($H))$H="\0";elseif($gi!=""&&is_shortable($o))$H=shorten_utf8($H,max(0,+$gi));else$H=h($H);}return$b->selectVal($H,$_,$o,$X);}function
    138 is_mail($sc){$Ia='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$fc='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$dg="$Ia+(\\.$Ia+)*@($fc?\\.)+$fc";return
    139 is_string($sc)&&preg_match("(^$dg(,\\s*$dg)*\$)i",$sc);}function
    140 is_url($P){$fc='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return
    141 preg_match("~^(https?)://($fc?\\.)+$fc(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$P);}function
     136select_value($X,$_,$o,$ii){global$b;if(is_array($X)){$H="";foreach($X
     137as$he=>$W)$H.="<tr>".($X!=array_values($X)?"<th>".h($he):"")."<td>".select_value($W,$_,$o,$ii);return"<table cellspacing='0'>$H</table>";}if(!$_)$_=$b->selectLink($X,$o);if($_===null){if(is_mail($X))$_="mailto:$X";if(is_url($X))$_=$X;}$H=$b->editVal($X,$o);if($H!==null){if(!isutf8($H))$H="\0";elseif($ii!=""&&is_shortable($o))$H=shorten_utf8($H,max(0,+$ii));else$H=h($H);}return$b->selectVal($H,$_,$o,$X);}function
     138is_mail($uc){$Ia='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$hc='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$fg="$Ia+(\\.$Ia+)*@($hc?\\.)+$hc";return
     139is_string($uc)&&preg_match("(^$fg(,\\s*$fg)*\$)i",$uc);}function
     140is_url($P){$hc='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return
     141preg_match("~^(https?)://($hc?\\.)+$hc(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$P);}function
    142142is_shortable($o){return
    143143preg_match('~char|text|json|lob|geometry|point|linestring|polygon|string|bytea~',$o["type"]);}function
    144 count_rows($Q,$Z,$ae,$pd){global$x;$F=" FROM ".table($Q).($Z?" WHERE ".implode(" AND ",$Z):"");return($ae&&($x=="sql"||count($pd)==1)?"SELECT COUNT(DISTINCT ".implode(", ",$pd).")$F":"SELECT COUNT(*)".($ae?" FROM (SELECT 1$F GROUP BY ".implode(", ",$pd).") x":$F));}function
    145 slow_query($F){global$b,$ri,$m;$l=$b->database();$ii=$b->queryTimeout();$wh=$m->slowQuery($F,$ii);if(!$wh&&support("kill")&&is_object($i=connect())&&($l==""||$i->select_db($l))){$ke=$i->result(connection_id());echo'<script',nonce(),'>
     144count_rows($Q,$Z,$ce,$rd){global$x;$F=" FROM ".table($Q).($Z?" WHERE ".implode(" AND ",$Z):"");return($ce&&($x=="sql"||count($rd)==1)?"SELECT COUNT(DISTINCT ".implode(", ",$rd).")$F":"SELECT COUNT(*)".($ce?" FROM (SELECT 1$F GROUP BY ".implode(", ",$rd).") x":$F));}function
     145slow_query($F){global$b,$ti,$m;$l=$b->database();$ki=$b->queryTimeout();$yh=$m->slowQuery($F,$ki);if(!$yh&&support("kill")&&is_object($i=connect())&&($l==""||$i->select_db($l))){$me=$i->result(connection_id());echo'<script',nonce(),'>
    146146var timeout = setTimeout(function () {
    147147        ajax(\'',js_escape(ME),'script=kill\', function () {
    148         }, \'kill=',$ke,'&token=',$ri,'\');
    149 }, ',1000*$ii,');
     148        }, \'kill=',$me,'&token=',$ti,'\');
     149}, ',1000*$ki,');
    150150</script>
    151 ';}else$i=null;ob_flush();flush();$H=@get_key_vals(($wh?$wh:$F),$i,false);if($i){echo
     151';}else$i=null;ob_flush();flush();$H=@get_key_vals(($yh?$yh:$F),$i,false);if($i){echo
    152152script("clearTimeout(timeout);");ob_flush();flush();}return$H;}function
    153 get_token(){$Ag=rand(1,1e6);return($Ag^$_SESSION["token"]).":$Ag";}function
    154 verify_token(){list($ri,$Ag)=explode(":",$_POST["token"]);return($Ag^$_SESSION["token"])==$ri;}function
    155 lzw_decompress($Ta){$cc=256;$Ua=8;$nb=array();$Qg=0;$Rg=0;for($s=0;$s<strlen($Ta);$s++){$Qg=($Qg<<8)+ord($Ta[$s]);$Rg+=8;if($Rg>=$Ua){$Rg-=$Ua;$nb[]=$Qg>>$Rg;$Qg&=(1<<$Rg)-1;$cc++;if($cc>>$Ua)$Ua++;}}$bc=range("\0","\xFF");$H="";foreach($nb
    156 as$s=>$mb){$rc=$bc[$mb];if(!isset($rc))$rc=$pj.$pj[0];$H.=$rc;if($s)$bc[]=$pj.$rc[0];$pj=$rc;}return$H;}function
    157 on_help($tb,$th=0){return
    158 script("mixin(qsl('select, input'), {onmouseover: function (event) { helpMouseover.call(this, event, $tb, $th) }, onmouseout: helpMouseout});","");}function
    159 edit_form($a,$p,$I,$Mi){global$b,$x,$ri,$n;$Sh=$b->tableName(table_status1($a,true));page_header(($Mi?lang(10):lang(11)),$n,array("select"=>array($a,$Sh)),$Sh);if($I===false)echo"<p class='error'>".lang(12)."\n";echo'<form action="" method="post" enctype="multipart/form-data" id="form">
     153get_token(){$Cg=rand(1,1e6);return($Cg^$_SESSION["token"]).":$Cg";}function
     154verify_token(){list($ti,$Cg)=explode(":",$_POST["token"]);return($Cg^$_SESSION["token"])==$ti;}function
     155lzw_decompress($Ta){$ec=256;$Ua=8;$nb=array();$Sg=0;$Tg=0;for($s=0;$s<strlen($Ta);$s++){$Sg=($Sg<<8)+ord($Ta[$s]);$Tg+=8;if($Tg>=$Ua){$Tg-=$Ua;$nb[]=$Sg>>$Tg;$Sg&=(1<<$Tg)-1;$ec++;if($ec>>$Ua)$Ua++;}}$dc=range("\0","\xFF");$H="";foreach($nb
     156as$s=>$mb){$tc=$dc[$mb];if(!isset($tc))$tc=$rj.$rj[0];$H.=$tc;if($s)$dc[]=$rj.$tc[0];$rj=$tc;}return$H;}function
     157on_help($tb,$vh=0){return
     158script("mixin(qsl('select, input'), {onmouseover: function (event) { helpMouseover.call(this, event, $tb, $vh) }, onmouseout: helpMouseout});","");}function
     159edit_form($a,$p,$I,$Oi){global$b,$x,$ti,$n;$Uh=$b->tableName(table_status1($a,true));page_header(($Oi?lang(10):lang(11)),$n,array("select"=>array($a,$Uh)),$Uh);if($I===false)echo"<p class='error'>".lang(12)."\n";echo'<form action="" method="post" enctype="multipart/form-data" id="form">
    160160';if(!$p)echo"<p class='error'>".lang(13)."\n";else{echo"<table cellspacing='0' class='layout'>".script("qsl('table').onkeydown = editingKeydown;");foreach($p
    161 as$B=>$o){echo"<tr><th>".$b->fieldName($o);$Vb=$_GET["set"][bracket_escape($B)];if($Vb===null){$Vb=$o["default"];if($o["type"]=="bit"&&preg_match("~^b'([01]*)'\$~",$Vb,$Kg))$Vb=$Kg[1];}$Y=($I!==null?($I[$B]!=""&&$x=="sql"&&preg_match("~enum|set~",$o["type"])?(is_array($I[$B])?array_sum($I[$B]):+$I[$B]):$I[$B]):(!$Mi&&$o["auto_increment"]?"":(isset($_GET["select"])?false:$Vb)));if(!$_POST["save"]&&is_string($Y))$Y=$b->editVal($Y,$o);$r=($_POST["save"]?(string)$_POST["function"][$B]:($Mi&&preg_match('~^CURRENT_TIMESTAMP~i',$o["on_update"])?"now":($Y===false?null:($Y!==null?'':'NULL'))));if(preg_match("~time~",$o["type"])&&preg_match('~^CURRENT_TIMESTAMP~i',$Y)){$Y="";$r="now";}input($o,$Y,$r);echo"\n";}if(!support("table"))echo"<tr>"."<th><input name='field_keys[]'>".script("qsl('input').oninput = fieldChange;")."<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='".($Mi?lang(15):lang(16))."' title='Ctrl+Shift+Enter'>\n",($Mi?script("qsl('input').onclick = function () { return !ajaxForm(this.form, '".lang(17)."…', this); };"):"");}}echo($Mi?"<input type='submit' name='delete' value='".lang(18)."'>".confirm()."\n":($_POST||!$p?"":script("focus(qsa('td', qs('#form'))[1].firstChild);")));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"]),'">
     161as$B=>$o){echo"<tr><th>".$b->fieldName($o);$Wb=$_GET["set"][bracket_escape($B)];if($Wb===null){$Wb=$o["default"];if($o["type"]=="bit"&&preg_match("~^b'([01]*)'\$~",$Wb,$Mg))$Wb=$Mg[1];}$Y=($I!==null?($I[$B]!=""&&$x=="sql"&&preg_match("~enum|set~",$o["type"])?(is_array($I[$B])?array_sum($I[$B]):+$I[$B]):$I[$B]):(!$Oi&&$o["auto_increment"]?"":(isset($_GET["select"])?false:$Wb)));if(!$_POST["save"]&&is_string($Y))$Y=$b->editVal($Y,$o);$r=($_POST["save"]?(string)$_POST["function"][$B]:($Oi&&preg_match('~^CURRENT_TIMESTAMP~i',$o["on_update"])?"now":($Y===false?null:($Y!==null?'':'NULL'))));if(preg_match("~time~",$o["type"])&&preg_match('~^CURRENT_TIMESTAMP~i',$Y)){$Y="";$r="now";}input($o,$Y,$r);echo"\n";}if(!support("table"))echo"<tr>"."<th><input name='field_keys[]'>".script("qsl('input').oninput = fieldChange;")."<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='".($Oi?lang(15):lang(16))."' title='Ctrl+Shift+Enter'>\n",($Oi?script("qsl('input').onclick = function () { return !ajaxForm(this.form, '".lang(17)."…', this); };"):"");}}echo($Oi?"<input type='submit' name='delete' value='".lang(18)."'>".confirm()."\n":($_POST||!$p?"":script("focus(qsa('td', qs('#form'))[1].firstChild);")));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"]),'">
    162162<input type="hidden" name="save" value="1">
    163 <input type="hidden" name="token" value="',$ri,'">
     163<input type="hidden" name="token" value="',$ti,'">
    164164</form>
    165165';}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");header("Cache-Control: immutable");if($_GET["file"]=="favicon.ico"){header("Content-Type: image/x-icon");echo
     
    3793796Á7\0Ë6+¤%°.È
    380380
    381 Þ³a7E8VSå?(DG¨Ó³Bë%;ò¬ùÔ/<’´ú¥À\r ì´>ûQV–t/8®c8å\$\0ÈðŒ©RVæI8àRWÿ´\nÿäv¶¥yCìÌ-¢5FóŒæiQ0Ëè_ÔIE”sIR!¥ðŠX
    382 kè€z@¶`»¥·D‚`DV!Cæ8Ž¥\r­´Ÿb“3©!3â@Ù33N}âZBó3F.H}ä30ÚÜM(ê>‚Ê}ä\\Ñtê‚f 
     381Þ³a7E8VSå?(DG¨Ó³Bë%;ò¬ùÔ/<’´ú¥À\r ì´>ûMÀ°@¶¾€H D
     382
     383°Z[tH£Enx(ðŒ©R xñû@¯þGkjW”>ÌÂÚ#T/8®c8éQ0Ëè_ÔIIGII’!¥ðŠYEdËE´^tdéthÂ`DV!Cæ8Ž¥\r­´Ÿb“3©!3â@Ù33N}âZBó3   Ï3ä30ÚÜM(ê>‚Ê}ä\\Ñtê‚f 
    383384fŒËâI\r®
    384385€ó337 XÔ\"tdÎ,\nbtNO`Pâ;­Ü•Ò­ÀÔ¯\$\n‚žßäZÑ­5U5WUµ^ho
    385 ýàætÙPM/5K4Ej³KQ&53GX“Xx)Ò<5D”^íûVô\nßr¢5b܀\\J\">§è1S\r[-¦ÊD
     386ýàætÙPM/5K4Ej³KQ&53GX“Xx)Ò<5D
     387\rûVô\nßr¢5b܀\\J\">§è1S\r[-¦ÊD
    386388uÀ\rÒâ§Ã)00óYõÈË¢
    387 ·k{\nµÄ#µÞ\r³^·‹|èuÜ»Uå_nïU4ÉUŠ~YtÓ\rIšÃ@䏳™R ó3:ÒuePMSè0TµwW¯XÈòòD¨ò¤KF5Üà•‡;Uõ\n OYéYÍQ,M[\0÷_ªDšÍÈW ¾J*ì\rg(]à¨\r\"ZC‰©6uê+µYóˆY6ô0ªqõ(Ùó8}ó3AX3T h9j¶jàfcMtåPJbqMP5>ðÈø¶©Y‡k%&\\‚1
     389·k{\nµÄ#µÞ\r³^·‹|èuÜ»Uå_nïU4ÉUŠ~YtÓ\rIšÃ@䏳™R ó3:ÒuePMSè0TµwW¯XÈòòD¨ò¤KOUÜà•‡;Uõ\n OYéYÍQ,M[\0÷_ªDšÍÈW ¾J*ì\rg(]à¨\r\"ZC‰©6uê+µYóˆY6ô0ªqõ(Ùó8}ó3AX3T h9j¶jàfõMtåPJbqMP5>ðÈø¶©Y‡k%&\\‚1
    388390d¢ØE4À µYnÊ
    389391í\$<¥U]Ӊ1‰mbÖ¶^Òõš ê\"NVéßp¶ëpõ±eMÚÞ×WéÜ¢î\\ä)\n Ë\nf7\n×2
    390 ´cr8‹—=K
    391 7tVš‡µž7P¦¶LÉía6òòv@'‚6
    392 iàïj&>±â;­ã`Òÿa       \0pÚ¨(µJ‘ë)«\\¿ªnûòĬm\0¼¨2€ôeqJö­PôhŒë±f
     392´õr8‹—=Ek7tVš‡µž7P¦¶LÉía6òòv@'‚6
     393iàïj&>±â;­ã`Òÿa       \0pÚ¨(µJÑë)«\\¿ªnûòĬm\0¼¨2€ôeqJö­PôtŒë±f
    393394jüÂ\"[\0¨·†¢X,<\\Œî¶×â
    394395÷æ·+md†å~â
     
    397398¸
    398399×mE‚H]‚¦˜üÖHW­M0Dï߀—å~Ë˜K˜
    399 îE}ø¸´à|fØ^“Ü×\r>Ô-z]2s‚xD˜d[s‡tŒ
    400 ¶\0Qf-K`­¢‚tà؄wT«9€æZ€à    ø\nB£9 Nb–ã<ÚBþI5o×oJñpÀÏJdåË\rhލÐ2\"àyG¡C‚sÓ•V”¹Ò%zr+z±ùþ\\’÷•œôm Þ±T
    401  öò ÷@Y2lQ<2O+¥%“Í.Ӄhù,AÞñ¸ŠÃZ‹2R¦À1£Š/¯hH\r¨X
    402 ÈaNB&§ ÄM@Ö[xŒ‡Ê®¥ê–â8&LÚV͜và±*šj¤ÛšHåÈ\\Ùª        ™®²&sÛ\0Qš`\\\"èb ° àÄ\rBs›‰wB     ™ÝžN`š7§Co(Ù¿à¨\n蝓h1™ùÈ*E—àñS
    403 ÓU0Uº
    404 tš#|Š4ƒ'{™ñ¡Ú #É5       å      p„àyBà@Rô·™pÞ@|„º7\rå\0€_Bú^z<Bú@W4&Kús¢úxO×·àPà@Xâ]Ô
    405 §úw>âZe{¨åLY‰¡Lڐ¢\\’(*R`   à¦\n
    406 ŠàŽºÄQC£(*Ž¹µc¢;œlÚp†X|`N¨‚¾\$€[†‰’@ÍU¢
     400îE}ø¸´à|fØ^“Ü×\r>Ô-z]2s‚xD˜d[s‡tŽ
     401¶\0Qf-K`­¢‚tà؄wT¯9€æZ€à    ø\nB£9 Nb–ã<ÚBþI5o×oJñpÀÏJNdåË\rhލÐ2\"àxæHCàݍ–:øý9Yn16Æôzr+z±ùþ\\’÷•œôm Þ±T
     402 öò ÷@Y2lQ<2O+¥%“Í.Ӄhù0AÞñ¸ŠÃZ‹2R¦À1£Š/¯hH\r¨X
     403ÈaNB&§ ÄM@Ö[xŒ‡Ê®¥ê–â8&LÚV͜và±*šj¤ÛšGHåÈ\\Ù®        ™²¶&sÛ\0Qš \\\"èb ° àÄ\rBs›Éw‚     ÙážBN`š7§Co(ÙÃà¨\n蝓¨1š9Ì*E˜ ñS
     404ÓU0Uº tš'|”m™°Þ?h[¢\$.#É5       å      p„àyBà@Rô]£
     405ê@|„§{™ÀÊP\0xô/¦ w¢%¤EsBd¿§šCUš~O×·àPà@Xâ]Ô
     406¨Z3¨¥1¦¥{©eLY‰¡ŒÚ¢\\’(*R`   à¦\n
     407ŠàŽºÌQCFÈ*Ž¹¹à霬Úp†X|`N¨‚¾\$€[†‰’@ÍU¢
    407408àð¦¶àZ¥`Zd\"\\\"
    408 ‚¢£)«Iˆ:àtšäoDæ
    409 \0[²(ూ-©“ 'í³        ™­ª`hu%¢Â,€”¨ãIµ7Ä«±Èó´‚m§VÞ}®ºNÖͳ\$
    410 »E´ÕYf&1ùŠÀ›]]pzUx\rÐ}
    411 ·;w§UXû\\«ña^ ËUÂ0SZODšRK”¶&‡Z\\Oq}ƾw‡Ì
    412 ºg¦´I¥èV
    413 ºº     5ªk¸ûç?Ð={º‹ª
    414 ©*ã©k˜@[u¡hÜv´mˆÛa;]—Ûà&àé\"“­/\$\0C¡Ù‚dSg¸k‚ {\0”\n`ž    ÀÃüC ¢¹Üaçr\r»2G׌äèO{§Å[­ÅÊûCƒÊFKZÖj˜©Â’FYBäpFk–›0
    415 <ÛàÊD<JE™Zb^µ.“2–ü8éU@*Î5fkªÌFDìÈÉ4‹•DU76É4Qï@
     409‚¢£)«‡Iˆ:ètšìoDæ
     410\0[²¨à±‚-©“ gí³‰™®*`hu%£,€”¬ãIµ7Ä«²Hóµm¤6Þ}®ºNÖͳ\$
     411»MµUYf&1ùŽÀ›e]pz¥§ÚI¤Åm¶G/£ º
     412w Ü!•\\#5¥4I¥d¹EÂhq€å¦÷Ѭkçx|Úk¥qDšb
     413z?§º‰>úƒ¾:†“[èLÒƬZ°Xš®:ž¹„·ÚÇjßw5        ¶Y¾0 ©Â“­¯\$\0C¢†dSg¸ë‚ {@”\n`ž    ÀÃüC ¢·»Mºµâ
     414»²# t}xÎN„÷º‡{ºÛ°)êûCƒÊFKZÞj™Â\0PFY”BäpFk–›0
     415<Ú>ÊD<JE™šg\rõ.“2–ü8éU@*Î5fkªÌJDìÈÉ4•TDU76É/´è¯@
    416416·‚K+„ÃöJ®ºÃÂ
    417 í@Ó=ŒÜWIF\$³85MšNº\$Rô\0ø5¨\ràù_ðªœìEœñÏI«Ï³Nçl£Òåy\\ôˆÇqU€ÐQû
    418  ª\n@’¨€ÛÅcpš¬¨PÛ±+7Ô½N\rýR{*qmÝF     M}I8 
    419 `W
    420 \0Á
    421 8‚µT\rä*NpTöb¨d<ºË¤Ô8îFð²€_Ï+Ü»Tî®eN#]˜d;ó,šŠ
    422 €~ÀU|0VReõˆÅýˆÖŽY|,d YÃ<Ͳ]
    423 „ƒûᷗɔ=ç±ümś®,
    424 \rj\r5à±pÊdu è
    425 éˆ
    426 
    427 ÔfpÈ+¾Jü–’ºX^ æ\nâ¨Þ)ß>-“h€‚¼¥½<•6èßb¼dmh×â@qíÕAhÖ),J­×W–Çcm÷em]ŽÔ\\÷)1Zb0ßåþžYñ]ymŠè‡fØ
    428 e¸Â
    429 ;¹ÏêOÉÀWŸapDWûŒÉÜÓzE¤ŒÓ\"ö\$êÇ=kÝëå!8ú怂g@¢-Q¦/e&ßƇ¬v_€xn\rÄe3{UÕ4öÜÐn{Ü:B§ˆâÕsm¶­Y düÞò7}3?*‚túòéÏlTÚ}˜~€„€ä=cžý¬ÖÞǹ€{íƒ8SµA
    430 \$À}ãQ\" Ÿâ;TWè98ç‚Ó{IDqÍúÖÂ÷®Ç˜‚Oì[”&œ]ï؁
    431 ¤Ìs‘˜€¸-§˜\r6§£qqš h€e5
    432 \0Ò¢À±ú*àbøISÛêÄ
    433 †Î®9yýpÓ-øý`{ý
     417í@Ó=ŒÜWIOD³85MšNº\$Rô\0ø5¨\ràù_ðªœìEœñÏI«Ï³Nçl£Òåy\\ô‘ˆÇqU€ÐQû
     418
     419 ª\n@’¨€ÛºÃpš¬¨PÛ±«7Ô½N\rýR{*qmÝ\$\0R”×ԓŠÅåqÐ
     420È+U@ÞB¤çOf*†CˬºMCŽä`_
     421 èüò½ËµNêæTâ5Ù¦C×»© ¸à\\WÃe&_XŒ_؍hå—ÂÆBœ3ÀŒÛ%ÜFW£û|™Gޛ'Å[¯Å‚À°ÙÕV Ð#^\rç
     422¦GR€¾˜€P±ÝFg
     423¢ûî¯ÀYi û¥Çz\nâ¨Þ+ß^/“¨€‚¼¥½\\•6èßb¼dmh×â@qíÕAhÖ),J­×W–Çcm÷em]ŽÓeÏkZb0ßåþžYñ]ymŠè‡fØ
     424e¹B
     425;¹ÓêOÉÀwŸapDWûŒÉÜÓ{›\0˜À-2/bN¬sÖ½Þ¾Ra“Ï®h&qt\n\"ÕiöRmühzÏeø†àÜFS7µÐ
     426PPò䖤âÜ:B§ˆâÕsm¶­Y düÞò7}3?*‚túòéÏlTÚ}˜~€„€ä=cžý¬ÖÞÇ       žÚ3
     427;T²LÞ5*      ñ~#µA•¾ƒ‘sŽx-7÷Žf5`Ø#\"NÓb÷¯G˜Ÿ‹õ@Üeü[ïø
     428¤Ìs‘˜€¸-§˜M6§£qqš h€e5
     429\0Ò¢À±ú*àbøISÜÉÜFή9}ýpÓ-øý`{ý
    434430±É–kP˜0T<„©Z9
    435 â0<ՙͩ€;[ƒˆg¹\nKÔ
    436 \n•\0Á°*½\nb7(À_¸@,îE2\rÀ]”K
    437 *\0Éÿp
    438 C\\Ñ¢,0¬^ìMЧšº©“@Š;X\r•ð?\$\r‡j’*öOµ¬BöæP ¿1¹hLK¡¦Ó
    439 ‘3—/œ´a@|
    440 €¦²w¼(pÄÔ0Ûþ€»uo      T/b¼“ BÈádkœL8è‡DbÊDöë`ºÉÕª*3Ø
    441 Nêâ
    442 ¾ÃM    wëkÇzâ·¿¤¶Ì«q¬!Ün÷èäèð~éÖÏÌÊ´àÂEͦš}QÍ
    443 m\0ƒ4@;¥
    444 Ô&¡@è\"B»Ð   PÀ
    445 m5p¿ª­
    446 )Ƅ÷@2ÀM‘ð;¬\rŠàbˆ¤05         Î\0[²N9”hY
    447 à»ˆÞt1e¯AŒo`ÆXŽ
    448 ¡gÈUb5ÆXõ6†¼ÐÒhUp€“0&*ŠE¤:Úqt%>²ÃÔ
    449 Ya¡Ö²¯°hb¬
    450 b œáÖLÀú8U¾rC£¼[Vá£I¬9Dд{ÐÞê]È!Ñaœˆ‘=Tú´&B5º¯\0~y¾Uè+²Ö\"ª’hÌHÃTb\".\r­Ì <)‘o¡ðœF
    451 °m–¤jb!ڇDE¢%þ IñÚ¢
    452 øDAm2ki„!„«\"Œ©µN¾wTëǀÞu–¿*hò1U
    453 dV¬ÜD#)À®Á¾`‹x\\CM=r)Èð
    454  ¾¯80Ž¥ácSD¨ÜޕW
    455 ˆ”±)\\-€b!¢7ÅùåÏG
    456 _ŠÚZÃè2yÈ
    457 qÓ)®}(\$µÈËt\0‘'†È´pZ,aË˜ 8ÊE¼·Ñ—‹”ã4Ž#ö¾îŽ~RϐÞét¶Ý=¬ap~ŀ<wU–ÀQ+·Ál
    458 œ¦RÆÜ{ќV€     Õ¸o%
    459 Õôa.Yàc}\nÕ3'Z
    460 |`ŽÀ6Ò4HUep¿H1ÀýÇd¡‚\\\\¿ˆìüdo\\ŽiËa
    461 ³åÞ5‘Ô
    462 ¬uˆš8íA‚;­Õ€PÑ\"ǖ.玼~4œÅü’>ÑéŽÛžÇÚ%—‚¸¹VG'zªA!%\\=AGMƒp}CÜÂ?/XöÏþJˆ“ŠTR(ƹ‰”±`©Œ#Z6Æt¶iua‚ý
    463 u”¾tüÏÒp
    464 ˜þ‰˜”ö¨O1¸÷#pTa#»<.¨+°
    465 « ñ\\I{Ãà
    466 `M\nk% ÜIP|GʒPA¤˜;Wª»Å ñ5B9%.@I#“Pä:Eà§ä¿\$é+E¬ÇÐ,:Ï|U ‰µk¶“ e
    467 0òí2L
    468 ©9)–`T+\$€l¡ç²U
    469 \"+ØÝ\0\$\n _èђŸ(à‰4DR‚”³'¥1\"h6Ÿ%<*/
    470 ¥\\É\"ØÉ=y€£F}lªÜÕ#70¸ðE¦m šþéA(ÆTÎG]@ÉÑ®.IKâW’­ÀÑ¥xD¸.ÆV.¤D\\Ü÷*{°AAeԌf±ò­3êÏU؜@Uw.Œ5€ZĆS”*<BA#Ó\0O.„•Œá]ÉÁ
    471 
    472 ·™Npi¾ýU)Ás(¥ì’°ëžaÐÕagˆ%áÀÄ‚Èyx#¨
    473 ê[
    474 èeXÄ
    475 4« ,ÜHo€8NàIà    %y- p°ÄT‹¼¨ådw„
    476 „[Ï^gxfb§(UÁ©~ˆ¾\0PÙß+Ã'h×AküπÔúٟˆÈ.\"2
    477 @•f™
    478 ¹„ÅOí>tÑ£\"•¹£âi\0j3‚Xßâˆw!/„å^šòbqøŒ (5*ý\0ZÁ°9
    479 ˆ\\¤\rJ
    480 @ZAQE͑{ŽàxÛL/»‘| #  ÜD¹¬Í*kr¼‰ÛQE‚`.\0_€qdäB(Ð.4Ô%S™läç*ð—Ne(\nœÔ'4ñ–ˆ`@mxÀÅ:³”Èÿ¡SÌØÅ4‚’¿N4¬sš
    481 ç'=6 Á€½ƒ8žæY;©Ì†
    482 s™Pn'€ 9͌s,é&y!å>\0[ÏS(N€Û11\nÌVfОÌÅB‚ðÆ•á%š~E‚3
    483 ¤¬H4Œž(Bµ\"”“Œ˜Š s3mê'pÝ<±²ƒ ïÓàÔLÔ±
    484 pŸäŒÙE‡B€Æ5 Ã
    485 
    486 ëÙË2Yѧ&¥ˆ–‰³”­\"(ørG€XxÉ©€»R¨O0•Jn–až1`Ê呜gÌn²@(       Œãy%£œKˆc<ɕ„ª6‘†
    487 òö±†dH´;“c
    488 .”Þ¡â„KxØï^=Ä+®\0É3ô&ÅDå\rʉC¥ä•;)ä\\bù
    489 øÙE
    490 ÔԒ*Q–DԗåÉðݖðt‡Ê
    491 {\\–p3ˆTƒñE\0)       %bÄì*ì­¤2‰h{öX‰œÙåÞPµKˆH(ÕÎQ\n e !ÖúFŒÉ“e
    492 —aC©B€.Š%©     Ü¡ðC‹
    493 Jp¸Þá\$˜€òMáZ2|² )éNéZ\\Z_œÑ)T žy\"
    494 ‰ãÌq+ Yzxb§EU€e\"Ô
    495 LZc–½c/=aa©‹L´0ª°
    496 kÚ(×ìG5üŸàtß[É])ƍúý8œ“•62/„<ÓaM‰­.ÊÌ֌y,å‹ØYœk\nPC.ÓüvJ6¦2›ƒNÊfSŠœ€]82ýÑ5ó;ÓÎ\0•§        \"*&/êeS¶¢Tð(ê-NšaCL1t#\"ã#’4Æ¢‘1¹^ò”6DžŸ`øÄȑ”+ŸÁŠäYFhÉ0ÚFI„\$àð\\êƒP½Òu0nmY„4bÔ#·¯\"
    497 pÛ#Ì&R8´ì¤Þ2(U\0Çã%þSiúqe3“kB”“¤¦jîgIÒUƒíUŒÊ3ué
    498  NBbœa41Ðv‚@
    499 dhªaaˆLKx«Õ¼ŒŽ½)¹       ©P(«-uº
    500 ã³JGXà¸\nKÅ/„ÉÐã×Æ\\Ûiϙæ\0^À\$, |Zʀ(Rv*ïÄEbE{ZŠÕHäeþ\n™§€PšÉ €”ØuNXb`XTU06œaXP=Q*ΐ€dt*z+H@°
    501 °ÁIvéZ‡äÀgáqÂI^Rª\0€¸A\n *¼!À8|\$prãëê!WF„°˜ôOBÌ+ßViˆuŠ
    502 'èKYz(ž³)ùedš3\\±“Ր‘ è
    503 \nz&ƒ^bߋJ^V%t+‘Ti[Q4&”®ùtÏ\\ŠÐ6´iê\rÕs*¤¼Õ
    504 H¯ø
    505 &[W'
    506 ×ZŖ'¬øŠ+Bx[    ,¹«Ø²Å¦µÁqÞÈ8ä¬~3ŠÚ®Ã@'  ði†
    507 fþ’à.J
    508 ÊˆT¢ï˜ÜX1-¤Ø
    509 €Š&3‘ì6ª—éòÐf@|O`b®UeD\0»:
    510 †ÎÖpSjMDÖQt\n¬³‘ñg§ÑèŸaÀy\$s€È`\"Ì5¿ð²É56V¢| `&´Êöåˆ7ÍÂ:ªr5:àÞË/'màPiw   
    511 
    512 A\rP‹šG‚X#H˜ýÔY\n¡ÑÎÚ&RÃ
    513 t{‡f¤éém@8ôx‘
    514 c·mú›FD3¤\"–¸ç]u±
    515 )laêZ
    516 :#¶Y«
    517 KKhWë€^Lݵ‹Ým
    518 ¦
    519 ®Ûp¹6}·­
    520 i[ŽÑW¯ãmÌۋtZ„M°ú·e³(oeñrpÀ[PYÒíà‡“îŒ­
    521  _«ÜÃãoR—1©\"R)ºø’\$Hˆ;»\0“‚€íÁ%Y#‘¨-Ihx¹*ɔQRï¤^Z¨â.YÃWœè*çÑLZÇ
    522 ]
    523 jU³¬V›§\\;4z#ðvƒµ:R×ê)«
    524 *:·Áǟœõ±iXbs.hqZTºŸ\"„I¡h£å\0Á;§¤û@Zx°–„IŽê½èN'ðӍ~—”¡\r‹®¿BB‡
    525 ’‡Ã’h©†‰YG°£F4)Š¹i%PЀì–õxx\n+°
    526 Ã2°5ݬ
    527 ßhè‘Ö
    528 '
    529 ­Ý‚,¬Á^^9Ì -ðlúÛ·nòƒÔmQßi‚\0®ÓB‰8ðn¾:T
    530 1éö1RÄ¢ÑY€¸ÕÉ9à=¬p
    531 ¯s-“
    532 ^œf%©q't8Ÿ(ø£š½@ïo’¾Z1–håâP¿?À
    533 ©+g_U™q        ¥ó^~Ç@n³ª
    534 Î¾ †ÕP&–g­šC9|º9_ø–c¿U™¬Ð›5_Žþ
    535 î?ÝEÛ!Ú'ÞT]¥¯Ýí—Yëÿ\rE·pNJROӀ‹î\nS
    536 Üœ®Ÿl›e¹B8ˆ¼ \n}6¹Èà|÷‹ 9 N”ªÇøQ×½èǸI5yQîºDÝïœÊ‰ŒÁüuj*?m\\MÓÞ²`Ýëdˆ
    537 àU(\$€¦N~UY#}—nÃ@h:«Hý•\rZ'õ@jµªÄ4€2I€®ç÷
    538 Ö¡·é 0h@\\ÔµÉ\0À8P3†B.«0Òa´ìˆJLh\r?K\\¦NxQ0“Ñ#Õ
    539 HŸÃt½¾Œc?¼,«¶‚t0¢;upÀ0d7þ ËäÊ°<a¯
    540 iö2sŽ9‰bÂOx¡ýê\0PÜ2ážñ@,ÃUÏ\0·[VÆÁèh|BQ Xì5Ҙ_¡‚Ì1Ar8¹ÐìÈr î}‹šNâó—Db¦&Ìë‰Û\"a|?Å0?
    541 Óî£Oq[µ8‚^Kè‘ßáQ”6í[”v˜èѕ۾‡‡×Æ°™n¥       ¨4S-R8Íñ³eâªéy—1´ý¶Go¶\ràdñˆö¸ØèIP€6ÝmͳºØŽÍ†‹ÄÍÐí×)GÂAK*Œx˜ŒU–ª
    542 ‚Rma„%Æ£HsEÂ
    543 °öÈ9L}œs¶é`6@Qéæg#a•§¾ÂF@B'<rÒÏ
    544 Ë“[ðŠE\$i#÷\"Ś,¾7iâŽã„Ù㠃t±µR 9äêékÖP²s
    545 ­÷)÷ʺ£²³tœ®‡Ç*`gÊ®6—LŒwàœ¹LáË^i߈PY%Ó%v¡a¥Ô™ ª 2ê˜^»šðch»­,“!w^µØM3WE¹÷²¤Ä=Ü
    546 ´åúZb\$܂Ì~VàXk¡ÐÆí\0[`­ÁŸ
    547 IÂÙø€bc0MköéC¾°ÑF9¡†hóJœÓ—¸•µ´¼(K‚XèЎæÅ·©auQ
    548 ›qwæé=¹³YƒŸÉ8´sž›üÍ|\rÞˆ1›Ä¼\"NíuLŽs2£Ìͤ0xÆÅÀ
    549 —T`‚”Bî©v«¥2
    550 ™
    551 Ê9D¾‚€Þ1ó¼Uç`ɕ/×1:,&ÅǙ´ô     
    552 8ùž¥\$€ŒojUŒà9¬\n›ÑŸ•›`6æà#7A͐X-w|ûµFí!ضIŸÉuçø úf€çÿÐ7®¢‹\0?9 OÀø –Í¥Ñ*®J5¡¬ü ”–ð!Ø·
    553 k«’Á¡rN×z|~„3×vƒ~×¥þcÈníh<&m`
    554 P4M%ã'G’Ñöfôƒf0ŽÓ—HºÒ>€ª,-€¾ÓZ;ÃÉ\0úŦ.#]Äò€
    555 Ó志hðÇþ]¸BhPÉ *Í̵F\r
    556 ¡´
    557 šAHf›A¸ÌBû¢¸<¨eèG3Vƛ\"ŸàµË~7ëyšpòÎOS®fÿA9ÁÔ{u\nóMݎZŠËI5X‹P4Lzm¨#mœ`h\"“á\nÓÉà¬Ë4ǜÌJÖÙ\n9J=1ê‰
    558 zöM
    559 Èå-A’-`\"ÃXRrG´dMXcÇÚ(՘Bٜ+[‰؀)È\n„éŠ|‡p¤âwœŠ€¡Ckt®\n |~\0z姯>à†æX)      €v
    560 ÀßÕàš5‚Ö°û[Ê.󃙹)I?áÿ—r[¸ìº|òX3!>\r¯Pã5Ç      âðÄ\roüá¦òɽ„uªX))܋n^\nÚëÈW“ünïcðìWc€þMíÓµ yoÇÃ.ê
    561 ©’q5JsKVWV¹H#îλvœ‡+ P&¥rÀ~G»\r†px(
    562 ôÃ9<„ß<&A2Yµ9½¿Æs-ÿÀž&ôÔG´íT™ \"Îӑy
    563 d“YeÖpå5|=µ§\$ÚÏNeøÀ¦W0;ºïáMOHɍ&39ú\$†@µan.|
    564 +b
    565 fx‰Ò1C‹
    566 iõ§Â——ã¥H¯´¾À™ÚÂÐäR‚ëKm8P.¡Ç%”Z\0^  9¬ |­CXlHëÌЎ”z\\¥24n+¹Õظ°¤ôªÜ¹î÷F]Òè̇ŠFŽ°Õ¸Ù\0™wÇ5)ð¹fþîcy{À0ÀP4ÐÅÝ5¡·zaƼÔÉ)_ÊQY3É&‚Ãnݛê,åØÀK¦ù_öY‡W0YÃÓ.s•-i=²÷eÙ,u@|Uvt!#ã¤ôδÅÊ×^à¤ç«&ÝÑèdSր³0­8ݤ€g.
    567 ÞoG@\\(Ë
    568 c t\rÍXG¤Ö•Ìƒµ×TڍFàem© :‘DÚÊ֍9)`EYk™MkÖÁ\$ȊONӂJÁæe£7’8yáM•nâZ*|ê‡r†  DÀZB[Ò¡@T!Ç\0Â00L˜£û|,•Èöwß¾f\\&»‰eâmj®œ&/       Ù‹ŸÉóªÕBÂÕ¥|rI¦Öbx‚QD€ÆwJ«|·Œ”½÷M–`ߋ-5t™4æXüw¼WÛÏOÓŽññu’ü_>    xÆ+^2Ê5#³ô›-÷’„Žâ'Ž‚»å
    569 fùȩ奥-bŠKjQ;‡&>’3Åâ²»'jtY
    570 qÞ§²+Jv\"j–t~_◎ÍEåBORÔ¾¡0)Æp¹29IB¯Ûôe¿\"I;Û©X¬\$,p0ô
    571 _KáÅÌ\$ċÚv°›,?
    572 1‡½Õ‹<LD;rJ;¦lg.ËÇ~;ìUW¢°•vËÝό0P+g0Ôýr+IAA*º\0|àØS¨o €\\„S½5ÜuÛÚ'(›ŽÓÅ|¸Àæà„ÀWÐÀ5;\$5\0´ô{¹®;dóiÈtÄ‘ñ ò‘â:™)½Èº)†.‹;—£j%\rÁ—ÌF¶=ïœDä¤õ]Hޓƒ\0ˆ       N @°!à’+|²d!.úH|ÆM»ÆCOUŒwI
    573 Rü|”H°R‘TÆ@%<œÂnߟÏn7r‡Žõ
    574 
    575 c#;‰¯\"f½AÚ9Ê¾dñð',††'U•ËK‘r^ÕÁÞ_:Ry±O~m!Û¥˜j>²S°ñ\"[ùq²§Ü½ëœ‹Ë\\˜8Ms\0üÝ7›ç_¹U̎V´f6‡KÉDϗÆs4S¬­P_=\"A«ˆ,&G³=‰êþXÁ9IØ
    576 `o#IFÂëSAíÖËAà;4kYÂN@”à<@gu|It\rÏû.ÖR9Ê:¿¸ðyîK­ ù܏“¹Àyî*Eó`r’Y·÷¦        š\${ä6Ð\0®â½òïhLÑ3ÞûŠ·€\" _
    577 \$U×È_“(¢GÀC0ð(ՕˆÖ1F÷ÂMzÍÈüà{¥Q!\r
    578 ƒNöxCsaÚ5ШŠOz       M·ðªÙGª`Qé4õÚÀדIIâJa6盀àT`(½MáßJ\\WǂØñ÷Ejuû8§ó ¾B†ÜÑQ[Ë?Öü_%+“O”+|šÀ˜ê w(e¡Ž‡¼€
    579 \\Uöû»ÞƒU¼ZÙ4Í\n P @¨P<Ț4šC €æÌ.K!˜éÇM#oSY3«LùºÿBˆ\$€Ž0{§Ht¼Ñ)Jp\$\rJ˝y\"äò€;
    580 ¿¥ª@,ú_ŒZò€È
    581 \$åçÑ؇а`ÜT ÕçcƒS%¸C(+oOá²Ò@\0^kX•ª@|ž¡Í‡¯U@¡ùú(h®Bé>³œ
    582 VnÍ\$H€2‰(ßAúLŒma¾hÆÔI‡Ä
    583 Š™Kiü:ê
    584 '¢éE—ÈV“C¡EE5îaFû¤§b¦´H°dA| ²í‚\"‰ÇŠB
    585 º,öûXÎJv
    586 N¿ðyJ
    587 ”å×À@íÔâld ±WõëÆ+&wÄ]\0Ä¡odá ¾ïKÔy€.Ȉ
    588 H̉ÃûUCpLaÁ”/ñ\rK¡ãÖÀtøÓõÀÐ8cÝi”¨oÌÀSñτÈóæ`=ù˜
    589 E\0;Ê|'½ll
    590 cTHUé
    591 ?Psß=øÏÑÇbª™À«æß8      \rÖ¾fߝ
    592 Ãçïíù~²
    593 Kë¬ý[é>ß
    594 8MlF𝚏éá»ÕøæÑ
    595 ñ¿´€Ÿé<È×Ü
    596 ©^ðkí@׸Åõð/uÛä .ügÉ+±ò`ß%€lœ2\nÐ[v«üiS¿‡ù]}IñAØzü*üßÙ~%ê_c|ª€ÿ-Q7Û:Ò³«€Éª_;ñ©b®½g}´1?p>W܀íõºŽž
    597 `=úؔ5iùŸÛ~ß?{ïî~„‹¡[|ÌEþ_Õÿ÷UNÿ]?7pt?22?ØÿTržÎ€©©åTñ
    598 
    599 ´]?fúô¾õõõ,wû‰üßûѺ 2‰yý:P.Tµ1GÚÿ‹Ö*“½hb ¸€?âßQ ô·Ò ¨?ìW½rõ\0¯b‡`*”à:=v hv\0¸¿âõ’¢åý%L:V(½Pø8wD—1賐a\0Ðo­ª¾p4‚D&”¥è@€a¹5€ÀmÀP
    600 ÀZþڒEû½ü]wI^)Q¬
    601 Àw¸(#-»Æu#¼§Z
    602 È*0“L¿¨ødÛðGÀ5Tõ@p/ž§Ââbˆ:ú\"|01\0ÌÈ`
     431ä0<՚\r­€;!Ègº\r\nKÔ
     432\n•‡\0Á°*½\nb7(À_¸@,îe2\rÀ]–K
     433+\0Éÿp
     434C\\Ñ¢,0¬^îMЧšº©“@Š;X\r•ð?\$\r‡j’+ö/´¬BöæP ½‰ù¨J{\"aÍ6˜ä‰œ¹|å£\n\0»à\\5“Ð     
     435
     43615
     4376ÿ† .Ý[ÂU
     438د\0dè²8Yç:!Ѳ‘=ºÀX.²uCªŠŒö!Sº¸‡o
     439pÓBÝüÛ7¸­Å¯¡Rh­\\h‹E=úy:< :u³ó2µ80“si¦ŸTsBÛ@\$ Íé@Çu     ÈQº¦.ô‚T0M\\/ê€d+ƃ\n‘¡=Ô
     440°dŒÅëA¢¸
     441¢)
     442\r@@Âh3€–Ù8.eZa|.â7
     443YkÐcÀ˜ñ–'D#‡¨Yò@Xq–=M¡ï44šB
     444 
     445AM¤¯dU\"‹Hw4î
     446(>‚¬8¨²ÃC¸?e_`ÐÅX:ÄA9ø™ôp«GÐä‡Gy6½ÃF“Xr‰¡l÷1¡½Ø»B¢Ã
     4479Rz©õhB„{ž€
     448™\0ëå^‚Ã-â0©%Dœ5F\"\"àÚÜÊ™úiÄ`ËÙnAf¨ \"
     449tDZ\"_àV\$Ÿ
     450ª!/
     451D€áš†ð¿µ‹´ˆÙ¦¡Ì€F,25Éj›Tëá—y\0
     452N¼x\rçYl¦#‘ÆEq\nÍÈB2œ\nìà6·
     453Ä4Óה!/Â
     454\nóƒ
     455‰Q¸
     456½*®;)bR¸Z0
     457\0ÄCDoŒ
     458˞Ž48À•´µ‡Ðe‘\nã¦S%\\úPIk‡(0ÁŒu/
     459™
     460‹G²Æ
     461¹ŠŒ¼\\Ë} 4Fp‘žGû_÷G?)gÈotº[vžÖ\0°¸?bÀ
     462;ªË`(•ÛŒà¶NS)\nãx=èÐ+@êÜ7ƒjú0—,ð1Ã
     463z™“­>0ˆ‰GcðãL
     464VX
     465ôƒ±ÛðÊ%À
     466Á„Q+øŽéoÆFõÈéܶÐ>Q-ãc
     467‘ÚÇl‰¡³¤wàÌz5G‘ê‚@(h‘cÓHõÇr?ˆšNbþ@ɨöÇø°îlx3‹U`„rwª©ÔUÃÔôtØ8Ô=Àl#òõlÿ䨉8¥E\"Œƒ˜™O6\n˜Â1e£`\\hKf—V/зPaYKçOÌý éàx‘ ‰Oj„ór7¥F;´êB»‘ê£í̒‡¼>æЦ²V\rĖÄ|©'Jµz«¼š”#’PBä’Y5\0NC¤^\n~LrR’Ô[̟
     468RìñgÀeZ\0x›^»i<Qã/)Ó%@ʐ’™fB²HfÊ
     469{%Pà\"\"½ø@ªþ)ò’‘“DE(iM2‚S’*ƒyòSÁ\"âñÊe̒1Œ«×˜\n4`
     470Ê©>¦Q*¦Üy°n”’ž¥TäuÔ
     471âä”Ñ~%+W²XK‹Œ£Q¡[ʔžàlPYy#DÙ¬D<«FLú³Õ@Á6']Ƌ‡û\rFÄ`±!•%\n0cÐôÀË©%c8WrpGƒ.TœDo¾UL2Ø*é|\$¬:çXt5ÆXYâIˆp#ñ ²
     472^\nê„:‚#Dú@Ö1\r*ÈK7à@D\0Ž¸C’C£xBhÉEnKè
     473,1\"õ*y[
     474á#!óיâٙ©Ê°l_¢/€öxË\0àÉÚ5ÐZÇÿ4\0005JÆh\"2
     475ˆŒ‡%Y
     476¦a®a1SûO4ˆÊ%niøšPŒàß´qî_
     477ʽ6¤†Ä6ãñ\n@PjUú\0µƒ`r;¹H”€´‚¢‹›:÷âð¶¨4 _w*ø@F@%¸‰s[šd×eô
     478Óbh¿\0âɱP\r \\iÀJ§99P9Î^s.œâP29©\nNj#,À€Úð5ˆíM)‘ÿB¦™³\ni%~œƒ¸§:9ÏÎX\r“e
     479
     480Ðè8³‰îeÓ½+
     481ïÀç9Áµâx*œÙ€W2áNbaç’
     482SàE¼ð•2„è\r³¬Åæpê     îÌ\\(/  LfàÊðòY§äX#8ZJăHʄ+Pà-I1xɈ¢36àN¢w\rÓÁ€[x3ý>\rTO™bá>sɲ0ê
     483ŒjA†8;Ø#ј‹¤³àËÂjPd‰qRJÒ\"‡(x‡Œš¡h
     484µ*Äó    T¦éaVã
     485®YƌÆë\$€˜Àî7’Z9ĸ†1̚XJà€éaïAOk8fD‹Cð96@áÂéMê
     486(H
     487§ŽÍãÐ
     488Bºà
     489“?‚i¼TAPÜ­˜^0´PÀµaf/‘ύ”P0ÍMH)\"¡dU@¹r1\\Ñ\rÙoH| àÇÅÉh×8
     490@ˆ?P’‘Z,A>®ÊúE(&‡¿e˜™Íž]å
     491Q\$¸„‚„åЪZ¡}a¿¤ˆÌ™:P¹w:‘Ä(è¢Z˜Ê!8°´«
     492­àn@9\$Þ£(K\"þ”î–%Ŧ͘@2‰ç’\$P°ž<Ǻ\0õ—灦JtUXP\"-AðÔɦYkÖ2óÑö™4ÏC\n«\0¶½ 2‡ý~Äs_Éþ\0÷N5¼•ÒœèÑ/ ӀIÉ;
     493›‰Â
     494i¸¦Ä֗efkF<Çr„Eì,Î6%?¨I—j;'S)MƒÁ§
     4954)ÍN€.œ~è‰ùéï\0JŠÓ”‘õ3©ãQzz       ”?õ§m1¡ªº‘q’ cQH˜Ü¯yL\"OÏ
     4960|c\$PÊ\"•ÏðÅr0eLŒ˜m#dÂpx.uA¨^éB˜76¬ÂqnÛ׍‘Bøn‘æi
     497
     498ZvR@ï)*€
     499㌁qƒÿ)ôý7^šIµ¡jIÒS5—3ˆ¤éªêŠ†8Úº‘×Äx9     ˆ
     500Lq„ÐLÄ
     501OAÚ
     502A\0001‘¢ª%†!1-â·WÒŽ
     503%#!5+³¥®¡÷!œvue(¨Bp¸\nKÅ/„ÙÐã×Æ\\Ûiϙæ\0^À\$, |ZҀ(R†+kŽà\n+
     504+ÚØVÊG¤{/ðTÍ<„ÖM
     505¦ÃªšÃ¢©°\$ä{дềyì‰Vtä +¡SÑZ€¤(u† x
     506\"HC·Jä? v8
     507ŽJ÷P Q\0ùV1À
     508á#ƒ '_á\nº4%„Ç¥\nza_Š²ÃPDD{¬€
     509+\$SzÊÖ
     510? l¬Ê«¨2z´’!=ÁODÐëÞ[ñb\0éKÊÄ®Ítj—+ª(„Ò”5è.™âk£Z‚FÖ­=Aº®­Uך£ð0©CքËêÐÇ
     511×~Æv.­8Š+Rx[
     512¬ÂºËزŦ·AuÞáI8䬎3Šß®Ä '   ðiŽ
     513fÿà.J
     514ʈT¢ï˜ÜX11¤ø
     515€Š&3‘ì6ª—‘     òÐf@|O`b®g\0»>
     516†ÏÖxkkMDÖQ„\n¬µ‘ñh§ÑøŸaÀy\$tÀÈ`\"Ì5¿ð²É56€| `&´À:TÅAŒ’\n­Ë
     517¥ –©p
     518j
     519Rù‰ÒI*ƒçQ¦¨±•£aNå®Zæ_Z qâ´©˜™›‡G9\0
     520Œ¿±ìå(Ä°=Jú
     521 dG˜íí
     5229rÕê,QpØ+kZ¡\$ž×I+‘„„(™Ç5̀{2íÜ_mLj8Š¬e¯Àénõ¦
     523®\\6Ŋ¶Œ\${X–ÖK\$·£#k™UÚí+vævE¯m×nØê˜vOè    !Adt£—_/´(6õ1ڕ­ñm[㌦¼Üî\$øTαhÖdÜÍXøðÀˆÖ/7ê ¡B¢ ä—-\$À®UrÉ>b*)̶ZÞXnbÄ\nªæ
     524ESΝpoe—“¶Žp\\¸¢D† †¨EÍ#Á,‰¤T~ê.
     525Pèçm)aŽº=óR„ô·E¶’<Ÿrõ6ŒˆgHE-t»ë´ºRívð
     526ZtF+m[¸ÒîuÏ:à“7w’÷]îß,`Ýà-®w«Â9ÒðÑa¯ØãoÛËÅ[DM°ý
     527ÝÛï
     528oeñrq6³H‘ÒâȘ!*Ÿtehíø
     529^èʔ¹IÉM×đ\"DAåØ\$œ\0oHŠÌœApúEÙZL¢Š—}\"öö:ó
     530|àå¯6è—|=
     531n
     532¥ªœë‡f¶cðÎÐv§J]‘A5c
     533H–ø8óóž¶-«
     534¾âí‰OËVBV¥#д‘ò€`ÓÒ\rý‚ -¼    ØKBd‰G
     535^ô+ýÀ.·ðªElöË\$\$(qé0|9(Š˜h•›{\n4a7BÜP\0n@-hÉoWà€¢¼ `Á+^jÄàd΀9
     536cPòq1ÚàH\"ÊÌæ\\ÊÐÁ’±!µ†°\".Ú¤¿¾Ô
     537µ¢E<Õ/Ž•‡
     538z}Ž‚±(¶XD.6?Nxk*,)ËlÃW§9†    j\\IæÎ(JÂøæ­@;Ü1¯–àÀ\nšIx€Ôïàh\rI[:ú¬ËˆH€5/›vBuŸPfuðÁ6«!4³x
     539lâÌ2Ñە¼³^ ìÝg\0¤Ù˘‰_qø°~4IÑO\"í-xðœDºÓb\\\"Â-_£rȔ¤Ÿ§G\"Àb•a{OªßRÚvÕr„qK‚\0\$úmÓbÅÐðNAt@)U•ð£°®Ðp’jò£ývȼ,9•Ê„êÔ*
     540T~ÝL›§½dÑ»ðKƒgÀªPÉLœýª¼Fû2ßúP*,uWÑû*Z¶ÏúUpUˆi\0d“]Ïÿ\rGw\n@`Ð
     541€¸
     542©k’!€qÖgäâ§EòÈHEà£@©ü]y2sÿÇe¿ò%ŽŸÃ\"”ÁÃ\\ÿO?üz+¶‚Ô4¢;uzЁ0d7±þFËäÊÐ<d
     543Éö2uÎ9’âÂW\$y9ý¨\0P܀d
     544À,È-öÀ·[æÆÕñh|BQ §á5ҙ
     545ÉåøØ©“<—’r\0®t;2
     546„ˆûî„f”9TªŽ=@çs:äÖɘúñLávË÷©X@WoN
     547W’ú\$D„D7øïe
     548ÛÖåÖ:(ÙvðŒ·°˜/©—ŠÂr\rA”Æ \nÅz3|¹Ù˜ª†z^ev/Ûy¡Ø^5
     549‡ŒGµí0BŠ†¶ÿmž`À¼vlà–nçn¾R>\nYTcÄÔb¬·P\\rPcßcx7c¥
     550˜õD†={*dr™•8å©ï©wë΁܆=R6_›•ÆœŒNy¥¾`&·á\$ŠH°ÔGîkË4Y|»Ó/
     551ËÙ³Æ@éåÒ¤àsέùÂÖ¬îçR\"yÖ[îzGoŸ%GgÒýøŽ{€ÏŸ
     552º.™ïÀ9r™ï£™c¾\\U†‰‡Î5âîC€Èé‚\"„®)L׌ËIß߆k¿Ø\r¯üi›Œ(íϹ
     553-
     554´åú\\d„Ü&rö|åfæÃî—ÐPÞeMéŸI
     555ڀbc0MléC¾°ÑOZ9†&Žôz—¸•µ¼›HK‚XèЎé%·šAauRŤñwéI=ºKYƒŸò´—De¸ǜ\rÞˆ1¥D¼\"OmuLoÅC\\m!€sËT\0ètº¥„|¢uKµ)™ôÈè²
     556Z2¸XoM|C›å©Ðh/„è¸ô➁!‡FÔ¨(‘íJñœ\0‡HSz3ò´œÝ(füJ
     557Ø4Þ£Ý8„cbÙ\$¤åÛ©Rƒê`šš 
     558i€ÞºŠ.\0üä?àl‚[6ÇD¨ºHֆÃò‚R[À‡e<
     559q³®“
     560É;Œ©ê•ñú§ÔpKtf`/À»ÿÔ¤z\rÝ«-MièÍ¢L€J‰®,±ëJCÚÔÔ õ±f°ŽÓ§[š¯Öö¥Ú²,-Yڇ]!y nTÅ×ÊBl·Þ„\$
     561zUcu¡ƒ\$¦j>72Õ,4.†Ôæ!£íQ¶óD+ìFŠàóןç¡
     562Í[\n6ÁSo8ëM)®LeÙ´¯ª\r,ìe=»\rù¦ïÊÇ-h‹›#ºM´*=O€¶Õ\n¶„#DÁ«êQ„+aäO‚»-S
     563s1+[@(äÍá3|‘ì
     564r–¨Fæ‹„=iJ¹
     565£Ú2&Ñs‹\rOí\$!lЮDìÀ‰äBtÉþiÀ¸Rq;͉@‡P¡¶äWP
     566>?€=rÓןnCs,”„À;BàoêüMÄm¬}­æyÁˆM”¤Ÿðÿ˹-ÛðÝ>y,gŸ6 q’ã„ñ‚\"¸q3|dîå;˜ìbîF7Р    ëŠ«@éŽö?ŽÆv@  À¸ERUì û&I\\}-X º›§gG4°]g6—šÔ‚>èë·\0Í:º³\"jWPä{±g‚ÀO\\3“ÌÝø\nðÒ\rÒ ™ˆ,ßDߢ9Ç\0       àO}jCÚ·ÔL
     567ç|      H¼6¿›ý°íŒr›TFžÿö±œ
     568­!·€S+žrŒìÔôŒ˜Òc3ŸÁB@Xd
     569T6&÷ÁǎGÆg’
     570n”8±Æ‘z|)‡ÊVŠû^éÜ     ©-\0î8ôº¶-«8b»7Ê-€/@œÖ>VÁ¬¶+u\0B½zl%5׶ᾊOJîžîŽ!ÇáÖ²@øx¤hä7 ¼!18šSRŸ\0Q
     571*o÷
     5728¾n*‘?_è×Ø\nxÎìÄTÓ9¨þ–
     573¡å
     574œün®4,7oÞ^ÈN]´dºqá–1#e¡(vŸ¬‰²ìØ,½¸šms.8÷TÅWgB>`ÏLë@øÞÕ\\­yäÀn\nNqŠ´ð1
     575†E=h
     5764<Ó¾\$ÈsAñâ‡u3ÊBŒ±æ:§@áu†2šA=³Ñ\\B-uMÑÑDnWßdñV
     577ÖTlrRÀŠ²ëҞÜUgÈ\rš¤ž§õ‰Ó{Fë>AÇCžð'§ Õå
     5782‰€´„µŸ¥b€™
     579—¡„bÍ
     580ŒÐd§
     581Y/›|nr\r“›SäSk*øAO¦ÒR)
     582ŸÆ;™sÁԔ\$w\$)E„ïAi¾é° ”Q 1Ý”ªëÆD3%âï ƒ¦Ë*2r–ÛPLšs,Ž;Þug+œt”h°bñ¶LóÈø%ýÅrC™|›Z®ç
     583á‹ÇN‰*ÝÐ*5;Û¡ùU¯A²{І¤ô~yéiKX¢’Ú”DŽä#¢2CJYõ’‘²’Öù
     584>zS²CU£õc§ûõêORÔ¾¡0)Ø+Òú:-INŒ‡¯£|ˆeÏG‰;ÛbØÈ\$,p0ô‘
     585_L.ÅÌ\$ċòv±ÑSܖF1&U°Ë(      ˆ‡nxt§¢æ‘dï@0ù¨Êå±õä/wcñö_RÄ2·f•Ñ­eĪè\0=õãsî¡ÁbsCO4×t~§hœ(¢o}OUòí®‚_h€ÔìpÔÔÑòëx
     586í§×\$?!ÐBw³GÄ9ÊGˆì渦÷ÃíV?{Xîn×S~—¦_1Ø÷Å¢q’”U{#x\nN
     587 \$8€EÀ”qÝ~¥’7 !‹Ài!ñ¥nöqi\r\$„ék𨞣ôóºQ×ÃLd    ÒSÏÜtpA9öá/
     588[úsß\0œØ6Vv,ÿƒõÔ±¥¡'Ý`ê?C‚sŠhctH\"éK¾}n¦
     589åó¥'®üë’
     590»
     591^§3ª
     592¢Ä_M£%Õoø¤†éƒ„çVOÍÜÙ¿£«ÝEë\n£rpT¼”Lð‰|`eñѺÊõšA²
     593jä:d|[áێ⽌—‘Jòúò4”l N±u4]l´
     594M³H&µ¤\$ä\0YRÀ”qzWĘ@Üÿ±¢íe3¡'t
     595|·¿.ºÒÞ`(ñI<ğ2¤_5“)%›
     596„™¢GÐÃm\0P\nïmèo@„Í>ƒ½³xB\"ñÒEm|
     597ù2Š\$},3LYXgo¡\$߶ <Óþ›¿IE\"`×ú¨4ág©8^
     598£]\nˆ¡—ð:ø›qVTÔ£Òm°mƒù7&ғĤÃmÓÿ&À¨ÀQz›ÃÑ
     599˜½·³Å±íHŠÔëöyOçfý«\rÙ£.¢¸¶‡®@¾JW&ßq×
     60050     Ô5ÀîPËG
     601‹\n½³í¸ŸÆF­{\0\r²mš@ @ P  x‘4i4†+@\0,͚\\–C1ӎè\n•LêÅÓ>n‚\0ÿââ      #‹ÇÞéÄÒ#@]/4JRœ IR²ïpè¹< Ç¯òaj„
     602?)Mví 2
     603X|@v\0aºç\"­Ï„œkø¨é-Â
     604yA[|À7\rš’\$ìÀÚóZÇ­Ràtùž’>œªÏáCErL  öÆrÓOªe R/à
     605¢J·ä~“%Xoš4áµdU\"¦Qrº‡IêºQDåò€¤ÐèQQM}àQ¿{)Ø©­\",f€Ð_(,½6àQ+c¯®ˆ
     606„&”Sñ‘ùÝ~OípáC€º¯ÍÚ©Äù´VþœñšÍ
     607ñ@1è[Ù<H/Ê~Ô\0^C 
     608³TÒõ‚q_gPÁœpe
     609þ@BÁ×ÑÀéúÇ끠pÈ¿º
     610)Xßã\0§õߔ’ñ€{ü`Š\0v”ü§ŸÙ
     611³Q¨«Ò@~ ç¿¡ú¿íÅTƁWò–ûÿ¿Î
     612‡ôŸÛü
     613®‰›úßìÿO÷>â
     6148&€›ÞÿCLݑ¦ÿ(€¯ó(“ÿ§Ç2ûì\r%‚;àk抐4û¨_O;ø5³ö`@<ý²¼/Ü7Ì_  €6'AY«ÿ\"¶ýaS°
     615¿z£kp®4š+h@ZÿÃô 8>®ýâoߔLÿû¿¥˜ÀjÌsùÀÿ\rJŠØm±À\0
     616L\0cå?³ümª‡Nƒ(¯÷ ÚTp#€àƒ| >À”þ©A[?Œ[ûÅ¿·Hkïü¨Â„\n¡t¿”p:†G¬
     617Ïõ>¾€TÊ{*¨Ø-¡tÀÔÿÙPÀúXëj¥N4ŠÜ
     618¦0\n\$ø‘:H,¦H}°A¾„©cè¦*
     619ˆü”n?ã돢\nƒþÊ;éO™\0Zú°v©AB£é‚‡`
     620Œo¡ª8_ÒR--n™‰T#
     621DIs1ÎÝ\0VPM\0Vÿr¬‡¿0\$BiŠ`€Tˆd“X|e\08\\ð7),_º‚°K¿3(.cÁ•\\°d‚‚2ÛÎçR<òu¨\\‚£        4АNÀ(|
     622gïþ‚|¡N&,ƒ³ñðy¡ÜÍ(
    603623À
    604 °Ðڐbï:P„—¼ÿÉ'!ˆ€Ä„\r \0fxÊÊí4\0žß‘€†€àH[,p<öƒMU¦àT°/a\rLCÁbEš¸\\µAçBV€öÞ»MF/­Ä
    605 ™ñ‹vž\n<ÃMB&DOø»ƒfÔÍù,:M\rU4ÐãMxF}`҉ô#0š}€ð€¶ÓB²o0åƒ&« N፩p‚:Á~áǍ\rÀM¦| NˆR¢\n\"   #'@
    606 Áb‘ãû
    607 
    608 Pq€Ç½J\\‚<•:h!pG€ù‹dd\n˜
    609 @jm整øpˆ1ˆPXÁá`#/|ŸÌ
    610 ¤ïº¾‡Ò\"ÐncÓD]ÁÂû8r6ð{5ä~ð\r\0
    611 AЄ
    612 De
    613 q\\o‰B!™[òŸÎá0BD“¤“É3°TˆŽ/0B‰rŽèàÐI²P ©;¤òeàP“MÁ‹Ã¡ˆ€ã#ÀÂpÓZ?Èñ·
    614 `pW·žÐá\0`Ê\0");}elseif($_GET["file"]=="jush.js"){header("Content-Type: text/javascript; charset=utf-8");echo
     624²ß8bï:P„—½1Y'!ˆ€Ä„ \0fxÒËë•\0žä1€†€àH[,½>
     625‚çäé&æT°/a\rLCÁbEš¹„§ 7çô¸ÖbðèkșÒ|bíçƒ0¹T\"‰’þ.ÀàÅق5sËD¹Sgë•8¹R
     626h*˜4¢}ˆ»¦Ÿ€<-9B\$¬ÓÞd9B\$åi«H‚8cj\\`Ž†ð_»’“šæ       É#`ò¢€h‚ˆ‡‚HΨp \$0‡
     627`1W\n˜%N€Z\\#àœbÙ¦P›Œ%m7l
     628\"
     629¢€d¹ô\"P¼!
     630Ø#/şÌ
     631¤,ͪ¿­
     632J#0µ‡cå„]Âà-(ò¹†6ð 7l~ð\r\0
     633Bî„0À:CA
     634é\\pϑ
     635
     636[òŸÎåÐ(Ќ®JGå0‰B
     637\"8¼P˜B*%Ê<#ƒBF72ÊB‚¤ö“é—Â5Bp   t&ð‰6\0bøˆñž4<
     638\$퀶¥K‹¡V\0G  óŒmY
     639 ");}elseif($_GET["file"]=="jush.js"){header("Content-Type: text/javascript; charset=utf-8");echo
    615640lzw_decompress("v0œF£©ÌÐ==˜ÎFS ÐÊ_6MƳ˜èèr:™E‡CI´Êo:C„”Xc‚\ræ؄J(:=ŸE†¦a28¡xð¸?Ä'ƒi°SA
    616641NN‘ùðxs
     
    16251650\0;";break;case"down.gif":echo"GIF89a\0\0\0001îîî\0\0€™™™\0\0\0!ù\0\0\0,\0\0\0\0\0\0 „©ËíMñÌ*)¾[Wþ\\¢ÇL&ٜ
    16261651ƶ•\0Çò
    1627 \0;";break;case"arrow.gif":echo"GIF89a\0\n\0€\0\0€€€ÿÿÿ!ù\0\0\0,\0\0\0\0\0\n\0\0‚i–±‹ž”ªÓ²Þ»\0\0;";break;}}exit;}if($_GET["script"]=="version"){$kd=file_open_lock(get_temp_dir()."/adminer.version");if($kd)file_write_unlock($kd,serialize(array("signature"=>$_POST["signature"],"version"=>$_POST["version"])));exit;}global$b,$h,$m,$gc,$oc,$yc,$n,$md,$sd,$ba,$Td,$x,$ca,$pe,$tf,$eg,$Kh,$xd,$ri,$xi,$U,$Li,$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]";if($_SERVER["HTTP_X_FORWARDED_PREFIX"])$_SERVER["REQUEST_URI"]=$_SERVER["HTTP_X_FORWARDED_PREFIX"].$_SERVER["REQUEST_URI"];$ba=($_SERVER["HTTPS"]&&strcasecmp($_SERVER["HTTPS"],"off"))||ini_bool("session.cookie_secure");@ini_set("session.use_trans_sid",false);if(!defined("SID")){session_cache_limiter("");session_name("adminer_sid");$Rf=array(0,preg_replace('~\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$Rf[]=true;call_user_func_array('session_set_cookie_params',$Rf);session_start();}remove_slashes(array(&$_GET,&$_POST,&$_COOKIE),$Xc);if(get_magic_quotes_runtime())set_magic_quotes_runtime(false);@set_time_limit(0);@ini_set("zend.ze1_compatibility_mode",false);@ini_set("precision",15);$pe=array('en'=>'English','ar'=>'العربية','bg'=>'Български','bn'=>'বাংলা','bs'=>'Bosanski','ca'=>'Català','cs'=>'ČeÅ¡tina','da'=>'Dansk','de'=>'Deutsch','el'=>'Ελληνικά','es'=>'Español','et'=>'Eesti','fa'=>'فارسی','fi'=>'Suomi','fr'=>'Français','gl'=>'Galego','he'=>'עברית','hu'=>'Magyar','id'=>'Bahasa Indonesia','it'=>'Italiano','ja'=>'日本語','ka'=>'ქართული','ko'=>'한국어','lt'=>'Lietuvių','ms'=>'Bahasa Melayu','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'=>'Српски','sv'=>'Svenska','ta'=>'த‌மிழ்','th'=>'ภาษาไทย','tr'=>'Türkçe','uk'=>'Українська','vi'=>'Tiếng Việt','zh'=>'简体中文','zh-tw'=>'繁體中文',);function
     1652\0;";break;case"arrow.gif":echo"GIF89a\0\n\0€\0\0€€€ÿÿÿ!ù\0\0\0,\0\0\0\0\0\n\0\0‚i–±‹ž”ªÓ²Þ»\0\0;";break;}}exit;}if($_GET["script"]=="version"){$md=file_open_lock(get_temp_dir()."/adminer.version");if($md)file_write_unlock($md,serialize(array("signature"=>$_POST["signature"],"version"=>$_POST["version"])));exit;}global$b,$h,$m,$ic,$qc,$_c,$n,$od,$ud,$ba,$Vd,$x,$ca,$re,$vf,$gg,$Mh,$zd,$ti,$zi,$U,$Ni,$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]";if($_SERVER["HTTP_X_FORWARDED_PREFIX"])$_SERVER["REQUEST_URI"]=$_SERVER["HTTP_X_FORWARDED_PREFIX"].$_SERVER["REQUEST_URI"];$ba=($_SERVER["HTTPS"]&&strcasecmp($_SERVER["HTTPS"],"off"))||ini_bool("session.cookie_secure");@ini_set("session.use_trans_sid",false);if(!defined("SID")){session_cache_limiter("");session_name("adminer_sid");$Tf=array(0,preg_replace('~\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$Tf[]=true;call_user_func_array('session_set_cookie_params',$Tf);session_start();}remove_slashes(array(&$_GET,&$_POST,&$_COOKIE),$Zc);if(get_magic_quotes_runtime())set_magic_quotes_runtime(false);@set_time_limit(0);@ini_set("zend.ze1_compatibility_mode",false);@ini_set("precision",15);$re=array('en'=>'English','ar'=>'العربية','bg'=>'Български','bn'=>'বাংলা','bs'=>'Bosanski','ca'=>'Català','cs'=>'ČeÅ¡tina','da'=>'Dansk','de'=>'Deutsch','el'=>'Ελληνικά','es'=>'Español','et'=>'Eesti','fa'=>'فارسی','fi'=>'Suomi','fr'=>'Français','gl'=>'Galego','he'=>'עברית','hu'=>'Magyar','id'=>'Bahasa Indonesia','it'=>'Italiano','ja'=>'日本語','ka'=>'ქართული','ko'=>'한국어','lt'=>'Lietuvių','ms'=>'Bahasa Melayu','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'=>'Српски','sv'=>'Svenska','ta'=>'த‌மிழ்','th'=>'ภาษาไทย','tr'=>'Türkçe','uk'=>'Українська','vi'=>'Tiếng Việt','zh'=>'简体中文','zh-tw'=>'繁體中文',);function
    16281653get_lang(){global$ca;return$ca;}function
    1629 lang($u,$kf=null){if(is_string($u)){$hg=array_search($u,get_translations("en"));if($hg!==false)$u=$hg;}global$ca,$xi;$wi=($xi[$u]?$xi[$u]:$u);if(is_array($wi)){$hg=($kf==1?0:($ca=='cs'||$ca=='sk'?($kf&&$kf<5?1:2):($ca=='fr'?(!$kf?0:1):($ca=='pl'?($kf%10>1&&$kf%10<5&&$kf/10%10!=1?1:2):($ca=='sl'?($kf%100==1?0:($kf%100==2?1:($kf%100==3||$kf%100==4?2:3))):($ca=='lt'?($kf%10==1&&$kf%100!=11?0:($kf%10>1&&$kf/10%10!=1?1:2)):($ca=='bs'||$ca=='ru'||$ca=='sr'||$ca=='uk'?($kf%10==1&&$kf%100!=11?0:($kf%10>1&&$kf%10<5&&$kf/10%10!=1?1:2)):1)))))));$wi=$wi[$hg];}$Fa=func_get_args();array_shift($Fa);$hd=str_replace("%d","%s",$wi);if($hd!=$wi)$Fa[0]=format_number($kf);return
    1630 vsprintf($hd,$Fa);}function
    1631 switch_lang(){global$ca,$pe;echo"<form action='' method='post'>\n<div id='lang'>",lang(19).": ".html_select("lang",$pe,$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($pe[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($pe[$_SESSION["lang"]]))$ca=$_SESSION["lang"];else{$va=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$Ge,PREG_SET_ORDER);foreach($Ge
     1654lang($u,$mf=null){if(is_string($u)){$jg=array_search($u,get_translations("en"));if($jg!==false)$u=$jg;}global$ca,$zi;$yi=($zi[$u]?$zi[$u]:$u);if(is_array($yi)){$jg=($mf==1?0:($ca=='cs'||$ca=='sk'?($mf&&$mf<5?1:2):($ca=='fr'?(!$mf?0:1):($ca=='pl'?($mf%10>1&&$mf%10<5&&$mf/10%10!=1?1:2):($ca=='sl'?($mf%100==1?0:($mf%100==2?1:($mf%100==3||$mf%100==4?2:3))):($ca=='lt'?($mf%10==1&&$mf%100!=11?0:($mf%10>1&&$mf/10%10!=1?1:2)):($ca=='bs'||$ca=='ru'||$ca=='sr'||$ca=='uk'?($mf%10==1&&$mf%100!=11?0:($mf%10>1&&$mf%10<5&&$mf/10%10!=1?1:2)):1)))))));$yi=$yi[$jg];}$Fa=func_get_args();array_shift($Fa);$jd=str_replace("%d","%s",$yi);if($jd!=$yi)$Fa[0]=format_number($mf);return
     1655vsprintf($jd,$Fa);}function
     1656switch_lang(){global$ca,$re;echo"<form action='' method='post'>\n<div id='lang'>",lang(19).": ".html_select("lang",$re,$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($re[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($re[$_SESSION["lang"]]))$ca=$_SESSION["lang"];else{$va=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$Ie,PREG_SET_ORDER);foreach($Ie
    16321657as$A)$va[$A[1]]=(isset($A[3])?$A[3]:1);arsort($va);foreach($va
    1633 as$y=>$xg){if(isset($pe[$y])){$ca=$y;break;}$y=preg_replace('~-.*~','',$y);if(!isset($va[$y])&&isset($pe[$y])){$ca=$y;break;}}}$xi=$_SESSION["translations"];if($_SESSION["translations_version"]!=824099529){$xi=array();$_SESSION["translations_version"]=824099529;}function
    1634 get_translations($oe){switch($oe){case"en":$g="A9D“yÔ@s:ÀGà¡(¸ffƒ‚Š¦ã ˆÙ:ÄS°Þa2
     1658as$y=>$zg){if(isset($re[$y])){$ca=$y;break;}$y=preg_replace('~-.*~','',$y);if(!isset($va[$y])&&isset($re[$y])){$ca=$y;break;}}}$zi=$_SESSION["translations"];if($_SESSION["translations_version"]!=824099529){$zi=array();$_SESSION["translations_version"]=824099529;}function
     1659get_translations($qe){switch($qe){case"en":$g="A9D“yÔ@s:ÀGà¡(¸ffƒ‚Š¦ã ˆÙ:ÄS°Þa2
    16351660\"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œ
    16361661†¤`Ñ=Ë܌²‚ž0Ê\nÒãdFé   ŒÞn:Zΰ)­ãQ¦ÕÈmwÛø€ÝO¼êmfpQË΂‰†qœêaÊį±#q®–w7SŽX3” ‰œŠ˜o¢\n>Z—M„
     
    52575282
    52585283C4eîÁÐgYD#!\$×\\*á̉º î
    5259 /ŒÀ";break;}$xi=array();foreach(explode("\n",lzw_decompress($g))as$X)$xi[]=(strpos($X,"\t")?explode("\t",$X):$X);return$xi;}if(!$xi){$xi=get_translations($ca);$_SESSION["translations"]=$xi;}if(extension_loaded('pdo')){class
     5284/ŒÀ";break;}$zi=array();foreach(explode("\n",lzw_decompress($g))as$X)$zi[]=(strpos($X,"\t")?explode("\t",$X):$X);return$zi;}if(!$zi){$zi=get_translations($ca);$_SESSION["translations"]=$zi;}if(extension_loaded('pdo')){class
    52605285Min_PDO
    52615286extends
    52625287PDO{var$_result,$server_info,$affected_rows,$errno,$error;function
    5263 __construct(){global$b;$hg=array_search("SQL",$b->operators);if($hg!==false)unset($b->operators[$hg]);}function
    5264 dsn($lc,$V,$E,$Af=array()){try{parent::__construct($lc,$V,$E,$Af);}catch(Exception$Cc){auth_error(h($Cc->getMessage()));}$this->setAttribute(13,array('Min_PDOStatement'));$this->server_info=@$this->getAttribute(4);}function
    5265 query($F,$Fi=false){$G=parent::query($F);$this->error="";if(!$G){list(,$this->errno,$this->error)=$this->errorInfo();if(!$this->error)$this->error=lang(21);return
     5288__construct(){global$b;$jg=array_search("SQL",$b->operators);if($jg!==false)unset($b->operators[$jg]);}function
     5289dsn($nc,$V,$E,$Cf=array()){try{parent::__construct($nc,$V,$E,$Cf);}catch(Exception$Ec){auth_error(h($Ec->getMessage()));}$this->setAttribute(13,array('Min_PDOStatement'));$this->server_info=@$this->getAttribute(4);}function
     5290query($F,$Hi=false){$G=parent::query($F);$this->error="";if(!$G){list(,$this->errno,$this->error)=$this->errorInfo();if(!$this->error)$this->error=lang(21);return
    52665291false;}$this->store_result($G);return$G;}function
    52675292multi_query($F){return$this->_result=$this->query($F);}function
     
    52785303fetch_assoc(){return$this->fetch(2);}function
    52795304fetch_row(){return$this->fetch(3);}function
    5280 fetch_field(){$I=(object)$this->getColumnMeta($this->_offset++);$I->orgtable=$I->table;$I->orgname=$I->name;$I->charsetnr=(in_array("blob",(array)$I->flags)?63:0);return$I;}}}$gc=array();class
     5305fetch_field(){$I=(object)$this->getColumnMeta($this->_offset++);$I->orgtable=$I->table;$I->orgname=$I->name;$I->charsetnr=(in_array("blob",(array)$I->flags)?63:0);return$I;}}}$ic=array();class
    52815306Min_SQL{var$_conn;function
    52825307__construct($h){$this->_conn=$h;}function
    5283 select($Q,$K,$Z,$pd,$Cf=array(),$z=1,$D=0,$pg=false){global$b,$x;$ae=(count($pd)<count($K));$F=$b->selectQueryBuild($K,$Z,$pd,$Cf,$z,$D);if(!$F)$F="SELECT".limit(($_GET["page"]!="last"&&$z!=""&&$pd&&$ae&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$K)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($pd&&$ae?"\nGROUP BY ".implode(", ",$pd):"").($Cf?"\nORDER BY ".implode(", ",$Cf):""),($z!=""?+$z:null),($D?$z*$D:0),"\n");$Gh=microtime(true);$H=$this->_conn->query($F);if($pg)echo$b->selectQuery($F,$Gh,!$H);return$H;}function
    5284 delete($Q,$zg,$z=0){$F="FROM ".table($Q);return
    5285 queries("DELETE".($z?limit1($Q,$F,$zg):" $F$zg"));}function
    5286 update($Q,$N,$zg,$z=0,$L="\n"){$Yi=array();foreach($N
    5287 as$y=>$X)$Yi[]="$y = $X";$F=table($Q)." SET$L".implode(",$L",$Yi);return
    5288 queries("UPDATE".($z?limit1($Q,$F,$zg,$L):" $F$zg"));}function
     5308select($Q,$K,$Z,$rd,$Ef=array(),$z=1,$D=0,$rg=false){global$b,$x;$ce=(count($rd)<count($K));$F=$b->selectQueryBuild($K,$Z,$rd,$Ef,$z,$D);if(!$F)$F="SELECT".limit(($_GET["page"]!="last"&&$z!=""&&$rd&&$ce&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$K)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($rd&&$ce?"\nGROUP BY ".implode(", ",$rd):"").($Ef?"\nORDER BY ".implode(", ",$Ef):""),($z!=""?+$z:null),($D?$z*$D:0),"\n");$Ih=microtime(true);$H=$this->_conn->query($F);if($rg)echo$b->selectQuery($F,$Ih,!$H);return$H;}function
     5309delete($Q,$Ag,$z=0){$F="FROM ".table($Q);return
     5310queries("DELETE".($z?limit1($Q,$F,$Ag):" $F$Ag"));}function
     5311update($Q,$N,$Ag,$z=0,$L="\n"){$aj=array();foreach($N
     5312as$y=>$X)$aj[]="$y = $X";$F=table($Q)." SET$L".implode(",$L",$aj);return
     5313queries("UPDATE".($z?limit1($Q,$F,$Ag,$L):" $F$Ag"));}function
    52895314insert($Q,$N){return
    52905315queries("INSERT INTO ".table($Q).($N?" (".implode(", ",array_keys($N)).")\nVALUES (".implode(", ",$N).")":" DEFAULT VALUES"));}function
    5291 insertUpdate($Q,$J,$ng){return
     5316insertUpdate($Q,$J,$pg){return
    52925317false;}function
    52935318begin(){return
     
    52975322rollback(){return
    52985323queries("ROLLBACK");}function
    5299 slowQuery($F,$ii){}function
     5324slowQuery($F,$ki){}function
    53005325convertSearch($u,$X,$o){return$u;}function
    53015326value($X,$o){return(method_exists($this->_conn,'value')?$this->_conn->value($X,$o):(is_resource($X)?stream_get_contents($X):$X));}function
    5302 quoteBinary($bh){return
    5303 q($bh);}function
     5327quoteBinary($dh){return
     5328q($dh);}function
    53045329warnings(){return'';}function
    5305 tableHelp($B){}}$gc["sqlite"]="SQLite 3";$gc["sqlite2"]="SQLite 2";if(isset($_GET["sqlite"])||isset($_GET["sqlite2"])){$kg=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
     5330tableHelp($B){}}$ic["sqlite"]="SQLite 3";$ic["sqlite2"]="SQLite 2";if(isset($_GET["sqlite"])||isset($_GET["sqlite2"])){$mg=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
    53065331Min_SQLite{var$extension="SQLite3",$server_info,$affected_rows,$errno,$error,$_link;function
    5307 __construct($Wc){$this->_link=new
    5308 SQLite3($Wc);$bj=$this->_link->version();$this->server_info=$bj["versionString"];}function
     5332__construct($Yc){$this->_link=new
     5333SQLite3($Yc);$dj=$this->_link->version();$this->server_info=$dj["versionString"];}function
    53095334query($F){$G=@$this->_link->query($F);$this->error="";if(!$G){$this->errno=$this->_link->lastErrorCode();$this->error=$this->_link->lastErrorMsg();return
    53105335false;}elseif($G->numColumns())return
     
    53235348__desctruct(){return$this->_result->finalize();}}}else{class
    53245349Min_SQLite{var$extension="SQLite",$server_info,$affected_rows,$error,$_link;function
    5325 __construct($Wc){$this->server_info=sqlite_libversion();$this->_link=new
    5326 SQLiteDatabase($Wc);}function
    5327 query($F,$Fi=false){$Ue=($Fi?"unbufferedQuery":"query");$G=@$this->_link->$Ue($F,SQLITE_BOTH,$n);$this->error="";if(!$G){$this->error=$n;return
     5350__construct($Yc){$this->server_info=sqlite_libversion();$this->_link=new
     5351SQLiteDatabase($Yc);}function
     5352query($F,$Hi=false){$We=($Hi?"unbufferedQuery":"query");$G=@$this->_link->$We($F,SQLITE_BOTH,$n);$this->error="";if(!$G){$this->error=$n;return
    53285353false;}elseif($G===true){$this->affected_rows=$this->changes();return
    53295354true;}return
     
    53405365as$y=>$X)$H[($y[0]=='"'?idf_unescape($y):$y)]=$X;return$H;}function
    53415366fetch_row(){return$this->_result->fetch(SQLITE_NUM);}function
    5342 fetch_field(){$B=$this->_result->fieldName($this->_offset++);$dg='(\[.*]|"(?:[^"]|"")*"|(.+))';if(preg_match("~^($dg\\.)?$dg\$~",$B,$A)){$Q=($A[3]!=""?$A[3]:idf_unescape($A[2]));$B=($A[5]!=""?$A[5]:idf_unescape($A[4]));}return(object)array("name"=>$B,"orgname"=>$B,"orgtable"=>$Q,);}}}}elseif(extension_loaded("pdo_sqlite")){class
     5367fetch_field(){$B=$this->_result->fieldName($this->_offset++);$fg='(\[.*]|"(?:[^"]|"")*"|(.+))';if(preg_match("~^($fg\\.)?$fg\$~",$B,$A)){$Q=($A[3]!=""?$A[3]:idf_unescape($A[2]));$B=($A[5]!=""?$A[5]:idf_unescape($A[4]));}return(object)array("name"=>$B,"orgname"=>$B,"orgtable"=>$Q,);}}}}elseif(extension_loaded("pdo_sqlite")){class
    53435368Min_SQLite
    53445369extends
    53455370Min_PDO{var$extension="PDO_SQLite";function
    5346 __construct($Wc){$this->dsn(DRIVER.":$Wc","","");}}}if(class_exists("Min_SQLite")){class
     5371__construct($Yc){$this->dsn(DRIVER.":$Yc","","");}}}if(class_exists("Min_SQLite")){class
    53475372Min_DB
    53485373extends
    53495374Min_SQLite{function
    53505375__construct(){parent::__construct(":memory:");$this->query("PRAGMA foreign_keys = 1");}function
    5351 select_db($Wc){if(is_readable($Wc)&&$this->query("ATTACH ".$this->quote(preg_match("~(^[/\\\\]|:)~",$Wc)?$Wc:dirname($_SERVER["SCRIPT_FILENAME"])."/$Wc")." AS a")){parent::__construct($Wc);$this->query("PRAGMA foreign_keys = 1");return
     5376select_db($Yc){if(is_readable($Yc)&&$this->query("ATTACH ".$this->quote(preg_match("~(^[/\\\\]|:)~",$Yc)?$Yc:dirname($_SERVER["SCRIPT_FILENAME"])."/$Yc")." AS a")){parent::__construct($Yc);$this->query("PRAGMA foreign_keys = 1");return
    53525377true;}return
    53535378false;}function
     
    53585383extends
    53595384Min_SQL{function
    5360 insertUpdate($Q,$J,$ng){$Yi=array();foreach($J
    5361 as$N)$Yi[]="(".implode(", ",$N).")";return
    5362 queries("REPLACE INTO ".table($Q)." (".implode(", ",array_keys(reset($J))).") VALUES\n".implode(",\n",$Yi));}function
     5385insertUpdate($Q,$J,$pg){$aj=array();foreach($J
     5386as$N)$aj[]="(".implode(", ",$N).")";return
     5387queries("REPLACE INTO ".table($Q)." (".implode(", ",array_keys(reset($J))).") VALUES\n".implode(",\n",$aj));}function
    53635388tableHelp($B){if($B=="sqlite_sequence")return"fileformat2.html#seqtab";if($B=="sqlite_master")return"fileformat2.html#$B";}}function
    53645389idf_escape($u){return'"'.str_replace('"','""',$u).'"';}function
     
    53855410is_view($R){return$R["Engine"]=="view";}function
    53865411fk_support($R){global$h;return!$h->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");}function
    5387 fields($Q){global$h;$H=array();$ng="";foreach(get_rows("PRAGMA table_info(".table($Q).")")as$I){$B=$I["name"];$T=strtolower($I["type"]);$Vb=$I["dflt_value"];$H[$B]=array("field"=>$B,"type"=>(preg_match('~int~i',$T)?"integer":(preg_match('~char|clob|text~i',$T)?"text":(preg_match('~blob~i',$T)?"blob":(preg_match('~real|floa|doub~i',$T)?"real":"numeric")))),"full_type"=>$T,"default"=>(preg_match("~'(.*)'~",$Vb,$A)?str_replace("''","'",$A[1]):($Vb=="NULL"?null:$Vb)),"null"=>!$I["notnull"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$I["pk"],);if($I["pk"]){if($ng!="")$H[$ng]["auto_increment"]=false;elseif(preg_match('~^integer$~i',$T))$H[$B]["auto_increment"]=true;$ng=$B;}}$Bh=$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',$Bh,$Ge,PREG_SET_ORDER);foreach($Ge
     5412fields($Q){global$h;$H=array();$pg="";foreach(get_rows("PRAGMA table_info(".table($Q).")")as$I){$B=$I["name"];$T=strtolower($I["type"]);$Wb=$I["dflt_value"];$H[$B]=array("field"=>$B,"type"=>(preg_match('~int~i',$T)?"integer":(preg_match('~char|clob|text~i',$T)?"text":(preg_match('~blob~i',$T)?"blob":(preg_match('~real|floa|doub~i',$T)?"real":"numeric")))),"full_type"=>$T,"default"=>(preg_match("~'(.*)'~",$Wb,$A)?str_replace("''","'",$A[1]):($Wb=="NULL"?null:$Wb)),"null"=>!$I["notnull"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$I["pk"],);if($I["pk"]){if($pg!="")$H[$pg]["auto_increment"]=false;elseif(preg_match('~^integer$~i',$T))$H[$B]["auto_increment"]=true;$pg=$B;}}$Dh=$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',$Dh,$Ie,PREG_SET_ORDER);foreach($Ie
    53885413as$A){$B=str_replace('""','"',preg_replace('~^"|"$~','',$A[1]));if($H[$B])$H[$B]["collation"]=trim($A[3],"'");}return$H;}function
    5389 indexes($Q,$i=null){global$h;if(!is_object($i))$i=$h;$H=array();$Bh=$i->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ".q($Q));if(preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*"|`[^`]*`)++)~i',$Bh,$A)){$H[""]=array("type"=>"PRIMARY","columns"=>array(),"lengths"=>array(),"descs"=>array());preg_match_all('~((("[^"]*+")+|(?:`[^`]*+`)+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i',$A[1],$Ge,PREG_SET_ORDER);foreach($Ge
    5390 as$A){$H[""]["columns"][]=idf_unescape($A[2]).$A[4];$H[""]["descs"][]=(preg_match('~DESC~i',$A[5])?'1':null);}}if(!$H){foreach(fields($Q)as$B=>$o){if($o["primary"])$H[""]=array("type"=>"PRIMARY","columns"=>array($B),"lengths"=>array(),"descs"=>array(null));}}$Eh=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$I){$B=$I["name"];$v=array("type"=>($I["unique"]?"UNIQUE":"INDEX"));$v["lengths"]=array();$v["descs"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($B).")",$i)as$ah){$v["columns"][]=$ah["name"];$v["descs"][]=null;}if(preg_match('~^CREATE( UNIQUE)? INDEX '.preg_quote(idf_escape($B).' ON '.idf_escape($Q),'~').' \((.*)\)$~i',$Eh[$B],$Kg)){preg_match_all('/("[^"]*+")+( DESC)?/',$Kg[2],$Ge);foreach($Ge[2]as$y=>$X){if($X)$v["descs"][$y]='1';}}if(!$H[""]||$v["type"]!="UNIQUE"||$v["columns"]!=$H[""]["columns"]||$v["descs"]!=$H[""]["descs"]||!preg_match("~^sqlite_~",$B))$H[$B]=$v;}return$H;}function
     5414indexes($Q,$i=null){global$h;if(!is_object($i))$i=$h;$H=array();$Dh=$i->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ".q($Q));if(preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*"|`[^`]*`)++)~i',$Dh,$A)){$H[""]=array("type"=>"PRIMARY","columns"=>array(),"lengths"=>array(),"descs"=>array());preg_match_all('~((("[^"]*+")+|(?:`[^`]*+`)+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i',$A[1],$Ie,PREG_SET_ORDER);foreach($Ie
     5415as$A){$H[""]["columns"][]=idf_unescape($A[2]).$A[4];$H[""]["descs"][]=(preg_match('~DESC~i',$A[5])?'1':null);}}if(!$H){foreach(fields($Q)as$B=>$o){if($o["primary"])$H[""]=array("type"=>"PRIMARY","columns"=>array($B),"lengths"=>array(),"descs"=>array(null));}}$Gh=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$I){$B=$I["name"];$v=array("type"=>($I["unique"]?"UNIQUE":"INDEX"));$v["lengths"]=array();$v["descs"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($B).")",$i)as$ch){$v["columns"][]=$ch["name"];$v["descs"][]=null;}if(preg_match('~^CREATE( UNIQUE)? INDEX '.preg_quote(idf_escape($B).' ON '.idf_escape($Q),'~').' \((.*)\)$~i',$Gh[$B],$Mg)){preg_match_all('/("[^"]*+")+( DESC)?/',$Mg[2],$Ie);foreach($Ie[2]as$y=>$X){if($X)$v["descs"][$y]='1';}}if(!$H[""]||$v["type"]!="UNIQUE"||$v["columns"]!=$H[""]["columns"]||$v["descs"]!=$H[""]["descs"]||!preg_match("~^sqlite_~",$B))$H[$B]=$v;}return$H;}function
    53915416foreign_keys($Q){$H=array();foreach(get_rows("PRAGMA foreign_key_list(".table($Q).")")as$I){$q=&$H[$I["id"]];if(!$q)$q=$I;$q["source"][]=$I["from"];$q["target"][]=$I["to"];}return$H;}function
    53925417view($B){global$h;return
     
    53975422error(){global$h;return
    53985423h($h->error);}function
    5399 check_sqlite_name($B){global$h;$Mc="db|sdb|sqlite";if(!preg_match("~^[^\\0]*\\.($Mc)\$~",$B)){$h->error=lang(23,str_replace("|",", ",$Mc));return
     5424check_sqlite_name($B){global$h;$Oc="db|sdb|sqlite";if(!preg_match("~^[^\\0]*\\.($Oc)\$~",$B)){$h->error=lang(23,str_replace("|",", ",$Oc));return
    54005425false;}return
    54015426true;}function
     
    54035428false;}if(!check_sqlite_name($l))return
    54045429false;try{$_=new
    5405 Min_SQLite($l);}catch(Exception$Cc){$h->error=$Cc->getMessage();return
     5430Min_SQLite($l);}catch(Exception$Ec){$h->error=$Ec->getMessage();return
    54065431false;}$_->query('PRAGMA encoding = "UTF-8"');$_->query('CREATE TABLE adminer (i)');$_->query('DROP TABLE adminer');return
    54075432true;}function
     
    54135438false;$h->__construct(":memory:");$h->error=lang(24);return@rename(DB,$B);}function
    54145439auto_increment(){return" PRIMARY KEY".(DRIVER=="sqlite"?" AUTOINCREMENT":"");}function
    5415 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){global$h;$Ri=($Q==""||$ed);foreach($p
    5416 as$o){if($o[0]!=""||!$o[1]||$o[2]){$Ri=true;break;}}$c=array();$Lf=array();foreach($p
    5417 as$o){if($o[1]){$c[]=($Ri?$o[1]:"ADD ".implode($o[1]));if($o[0]!="")$Lf[$o[0]]=$o[1][0];}}if(!$Ri){foreach($c
     5440alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){global$h;$Ti=($Q==""||$gd);foreach($p
     5441as$o){if($o[0]!=""||!$o[1]||$o[2]){$Ti=true;break;}}$c=array();$Nf=array();foreach($p
     5442as$o){if($o[1]){$c[]=($Ti?$o[1]:"ADD ".implode($o[1]));if($o[0]!="")$Nf[$o[0]]=$o[1][0];}}if(!$Ti){foreach($c
    54185443as$X){if(!queries("ALTER TABLE ".table($Q)." $X"))return
    54195444false;}if($Q!=$B&&!queries("ALTER TABLE ".table($Q)." RENAME TO ".table($B)))return
    5420 false;}elseif(!recreate_table($Q,$B,$c,$Lf,$ed,$Na))return
     5445false;}elseif(!recreate_table($Q,$B,$c,$Nf,$gd,$Na))return
    54215446false;if($Na){queries("BEGIN");queries("UPDATE sqlite_sequence SET seq = $Na WHERE name = ".q($B));if(!$h->affected_rows)queries("INSERT INTO sqlite_sequence (name, seq) VALUES (".q($B).", $Na)");queries("COMMIT");}return
    54225447true;}function
    5423 recreate_table($Q,$B,$p,$Lf,$ed,$Na,$w=array()){global$h;if($Q!=""){if(!$p){foreach(fields($Q)as$y=>$o){if($w)$o["auto_increment"]=0;$p[]=process_field($o,$o);$Lf[$y]=idf_escape($y);}}$og=false;foreach($p
    5424 as$o){if($o[6])$og=true;}$jc=array();foreach($w
    5425 as$y=>$X){if($X[2]=="DROP"){$jc[$X[1]]=true;unset($w[$y]);}}foreach(indexes($Q)as$ie=>$v){$f=array();foreach($v["columns"]as$y=>$e){if(!$Lf[$e])continue
    5426 2;$f[]=$Lf[$e].($v["descs"][$y]?" DESC":"");}if(!$jc[$ie]){if($v["type"]!="PRIMARY"||!$og)$w[]=array($v["type"],$ie,$f);}}foreach($w
    5427 as$y=>$X){if($X[0]=="PRIMARY"){unset($w[$y]);$ed[]="  PRIMARY KEY (".implode(", ",$X[2]).")";}}foreach(foreign_keys($Q)as$ie=>$q){foreach($q["source"]as$y=>$e){if(!$Lf[$e])continue
    5428 2;$q["source"][$y]=idf_unescape($Lf[$e]);}if(!isset($ed[" $ie"]))$ed[]=" ".format_foreign_key($q);}queries("BEGIN");}foreach($p
    5429 as$y=>$o)$p[$y]="  ".implode($o);$p=array_merge($p,array_filter($ed));$ci=($Q==$B?"adminer_$B":$B);if(!queries("CREATE TABLE ".table($ci)." (\n".implode(",\n",$p)."\n)"))return
    5430 false;if($Q!=""){if($Lf&&!queries("INSERT INTO ".table($ci)." (".implode(", ",$Lf).") SELECT ".implode(", ",array_map('idf_escape',array_keys($Lf)))." FROM ".table($Q)))return
    5431 false;$Ci=array();foreach(triggers($Q)as$Ai=>$ji){$_i=trigger($Ai);$Ci[]="CREATE TRIGGER ".idf_escape($Ai)." ".implode(" ",$ji)." ON ".table($B)."\n$_i[Statement]";}$Na=$Na?0:$h->result("SELECT seq FROM sqlite_sequence WHERE name = ".q($Q));if(!queries("DROP TABLE ".table($Q))||($Q==$B&&!queries("ALTER TABLE ".table($ci)." RENAME TO ".table($B)))||!alter_indexes($B,$w))return
    5432 false;if($Na)queries("UPDATE sqlite_sequence SET seq = $Na WHERE name = ".q($B));foreach($Ci
    5433 as$_i){if(!queries($_i))return
     5448recreate_table($Q,$B,$p,$Nf,$gd,$Na,$w=array()){global$h;if($Q!=""){if(!$p){foreach(fields($Q)as$y=>$o){if($w)$o["auto_increment"]=0;$p[]=process_field($o,$o);$Nf[$y]=idf_escape($y);}}$qg=false;foreach($p
     5449as$o){if($o[6])$qg=true;}$lc=array();foreach($w
     5450as$y=>$X){if($X[2]=="DROP"){$lc[$X[1]]=true;unset($w[$y]);}}foreach(indexes($Q)as$ke=>$v){$f=array();foreach($v["columns"]as$y=>$e){if(!$Nf[$e])continue
     54512;$f[]=$Nf[$e].($v["descs"][$y]?" DESC":"");}if(!$lc[$ke]){if($v["type"]!="PRIMARY"||!$qg)$w[]=array($v["type"],$ke,$f);}}foreach($w
     5452as$y=>$X){if($X[0]=="PRIMARY"){unset($w[$y]);$gd[]="  PRIMARY KEY (".implode(", ",$X[2]).")";}}foreach(foreign_keys($Q)as$ke=>$q){foreach($q["source"]as$y=>$e){if(!$Nf[$e])continue
     54532;$q["source"][$y]=idf_unescape($Nf[$e]);}if(!isset($gd[" $ke"]))$gd[]=" ".format_foreign_key($q);}queries("BEGIN");}foreach($p
     5454as$y=>$o)$p[$y]="  ".implode($o);$p=array_merge($p,array_filter($gd));$ei=($Q==$B?"adminer_$B":$B);if(!queries("CREATE TABLE ".table($ei)." (\n".implode(",\n",$p)."\n)"))return
     5455false;if($Q!=""){if($Nf&&!queries("INSERT INTO ".table($ei)." (".implode(", ",$Nf).") SELECT ".implode(", ",array_map('idf_escape',array_keys($Nf)))." FROM ".table($Q)))return
     5456false;$Ei=array();foreach(triggers($Q)as$Ci=>$li){$Bi=trigger($Ci);$Ei[]="CREATE TRIGGER ".idf_escape($Ci)." ".implode(" ",$li)." ON ".table($B)."\n$Bi[Statement]";}$Na=$Na?0:$h->result("SELECT seq FROM sqlite_sequence WHERE name = ".q($Q));if(!queries("DROP TABLE ".table($Q))||($Q==$B&&!queries("ALTER TABLE ".table($ei)." RENAME TO ".table($B)))||!alter_indexes($B,$w))return
     5457false;if($Na)queries("UPDATE sqlite_sequence SET seq = $Na WHERE name = ".q($B));foreach($Ei
     5458as$Bi){if(!queries($Bi))return
    54345459false;}queries("COMMIT");}return
    54355460true;}function
    54365461index_sql($Q,$T,$B,$f){return"CREATE $T ".($T!="INDEX"?"INDEX ":"").idf_escape($B!=""?$B:uniqid($Q."_"))." ON ".table($Q)." $f";}function
    54375462alter_indexes($Q,$c){foreach($c
    5438 as$ng){if($ng[0]=="PRIMARY")return
     5463as$pg){if($pg[0]=="PRIMARY")return
    54395464recreate_table($Q,$Q,array(),array(),array(),0,$c);}foreach(array_reverse($c)as$X){if(!queries($X[2]=="DROP"?"DROP INDEX ".idf_escape($X[1]):index_sql($Q,$X[0],$X[1],"(".implode(", ",$X[2]).")")))return
    54405465false;}return
     
    54425467truncate_tables($S){return
    54435468apply_queries("DELETE FROM",$S);}function
    5444 drop_views($dj){return
    5445 apply_queries("DROP VIEW",$dj);}function
     5469drop_views($fj){return
     5470apply_queries("DROP VIEW",$fj);}function
    54465471drop_tables($S){return
    54475472apply_queries("DROP TABLE",$S);}function
    5448 move_tables($S,$dj,$ai){return
     5473move_tables($S,$fj,$ci){return
    54495474false;}function
    54505475trigger($B){global$h;if($B=="")return
    5451 array("Statement"=>"BEGIN\n\t;\nEND");$u='(?:[^`"\s]+|`[^`]*`|"[^"]*")+';$Bi=trigger_options();preg_match("~^CREATE\\s+TRIGGER\\s*$u\\s*(".implode("|",$Bi["Timing"]).")\\s+([a-z]+)(?:\\s+OF\\s+($u))?\\s+ON\\s*$u\\s*(?:FOR\\s+EACH\\s+ROW\\s)?(.*)~is",$h->result("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = ".q($B)),$A);$mf=$A[3];return
    5452 array("Timing"=>strtoupper($A[1]),"Event"=>strtoupper($A[2]).($mf?" OF":""),"Of"=>($mf[0]=='`'||$mf[0]=='"'?idf_unescape($mf):$mf),"Trigger"=>$B,"Statement"=>$A[4],);}function
    5453 triggers($Q){$H=array();$Bi=trigger_options();foreach(get_rows("SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = ".q($Q))as$I){preg_match('~^CREATE\s+TRIGGER\s*(?:[^`"\s]+|`[^`]*`|"[^"]*")+\s*('.implode("|",$Bi["Timing"]).')\s*(.*?)\s+ON\b~i',$I["sql"],$A);$H[$I["name"]]=array($A[1],$A[2]);}return$H;}function
     5476array("Statement"=>"BEGIN\n\t;\nEND");$u='(?:[^`"\s]+|`[^`]*`|"[^"]*")+';$Di=trigger_options();preg_match("~^CREATE\\s+TRIGGER\\s*$u\\s*(".implode("|",$Di["Timing"]).")\\s+([a-z]+)(?:\\s+OF\\s+($u))?\\s+ON\\s*$u\\s*(?:FOR\\s+EACH\\s+ROW\\s)?(.*)~is",$h->result("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = ".q($B)),$A);$of=$A[3];return
     5477array("Timing"=>strtoupper($A[1]),"Event"=>strtoupper($A[2]).($of?" OF":""),"Of"=>($of[0]=='`'||$of[0]=='"'?idf_unescape($of):$of),"Trigger"=>$B,"Statement"=>$A[4],);}function
     5478triggers($Q){$H=array();$Di=trigger_options();foreach(get_rows("SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = ".q($Q))as$I){preg_match('~^CREATE\s+TRIGGER\s*(?:[^`"\s]+|`[^`]*`|"[^"]*")+\s*('.implode("|",$Di["Timing"]).')\s*(.*?)\s+ON\b~i',$I["sql"],$A);$H[$I["name"]]=array($A[1],$A[2]);}return$H;}function
    54545479trigger_options(){return
    54555480array("Timing"=>array("BEFORE","AFTER","INSTEAD OF"),"Event"=>array("INSERT","UPDATE","UPDATE OF","DELETE"),"Type"=>array("FOR EACH ROW"),);}function
     
    54645489array();}function
    54655490get_schema(){return"";}function
    5466 set_schema($eh){return
     5491set_schema($gh){return
    54675492true;}function
    5468 create_sql($Q,$Na,$Lh){global$h;$H=$h->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = ".q($Q));foreach(indexes($Q)as$B=>$v){if($B=='')continue;$H.=";\n\n".index_sql($Q,$v['type'],$B,"(".implode(", ",array_map('idf_escape',$v['columns'])).")");}return$H;}function
     5493create_sql($Q,$Na,$Nh){global$h;$H=$h->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = ".q($Q));foreach(indexes($Q)as$B=>$v){if($B=='')continue;$H.=";\n\n".index_sql($Q,$v['type'],$B,"(".implode(", ",array_map('idf_escape',$v['columns'])).")");}return$H;}function
    54695494truncate_sql($Q){return"DELETE FROM ".table($Q);}function
    54705495use_sql($j){}function
     
    54725497implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = ".q($Q)));}function
    54735498show_variables(){global$h;$H=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$y)$H[$y]=$h->result("PRAGMA $y");return$H;}function
    5474 show_status(){$H=array();foreach(get_vals("PRAGMA compile_options")as$_f){list($y,$X)=explode("=",$_f,2);$H[$y]=$X;}return$H;}function
     5499show_status(){$H=array();foreach(get_vals("PRAGMA compile_options")as$Bf){list($y,$X)=explode("=",$Bf,2);$H[$y]=$X;}return$H;}function
    54755500convert_field($o){}function
    54765501unconvert_field($o,$H){return$H;}function
    5477 support($Rc){return
    5478 preg_match('~^(columns|database|drop_col|dump|indexes|descidx|move_col|sql|status|table|trigger|variables|view|view_trigger)$~',$Rc);}$x="sqlite";$U=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$Kh=array_keys($U);$Li=array();$yf=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$md=array("hex","length","lower","round","unixepoch","upper");$sd=array("avg","count","count distinct","group_concat","max","min","sum");$oc=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$gc["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$kg=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
     5502support($Tc){return
     5503preg_match('~^(columns|database|drop_col|dump|indexes|descidx|move_col|sql|status|table|trigger|variables|view|view_trigger)$~',$Tc);}$x="sqlite";$U=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$Mh=array_keys($U);$Ni=array();$_f=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$od=array("hex","length","lower","round","unixepoch","upper");$ud=array("avg","count","count distinct","group_concat","max","min","sum");$qc=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$ic["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$mg=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
    54795504Min_DB{var$extension="PgSQL",$_link,$_result,$_string,$_database=true,$server_info,$affected_rows,$error,$timeout;function
    5480 _error($zc,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
    5481 connect($M,$V,$E){global$b;$l=$b->database();set_error_handler(array($this,'_error'));$this->_string="host='".str_replace(":","' port='",addcslashes($M,"'\\"))."' user='".addcslashes($V,"'\\")."' password='".addcslashes($E,"'\\")."'";$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){$bj=pg_version($this->_link);$this->server_info=$bj["server"];pg_set_client_encoding($this->_link,"UTF8");}return(bool)$this->_link;}function
     5505_error($Ac,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
     5506connect($M,$V,$E){global$b;$l=$b->database();set_error_handler(array($this,'_error'));$this->_string="host='".str_replace(":","' port='",addcslashes($M,"'\\"))."' user='".addcslashes($V,"'\\")."' password='".addcslashes($E,"'\\")."'";$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){$dj=pg_version($this->_link);$this->server_info=$dj["server"];pg_set_client_encoding($this->_link,"UTF8");}return(bool)$this->_link;}function
    54825507quote($P){return"'".pg_escape_string($this->_link,$P)."'";}function
    54835508value($X,$o){return($o["type"]=="bytea"?pg_unescape_bytea($X):$X);}function
     
    54855510select_db($j){global$b;if($j==$b->database())return$this->_database;$H=@pg_connect("$this->_string dbname='".addcslashes($j,"'\\")."'",PGSQL_CONNECT_FORCE_NEW);if($H)$this->_link=$H;return$H;}function
    54865511close(){$this->_link=@pg_connect("$this->_string dbname='postgres'");}function
    5487 query($F,$Fi=false){$G=@pg_query($this->_link,$F);$this->error="";if(!$G){$this->error=pg_last_error($this->_link);$H=false;}elseif(!pg_num_fields($G)){$this->affected_rows=pg_affected_rows($G);$H=true;}else$H=new
     5512query($F,$Hi=false){$G=@pg_query($this->_link,$F);$this->error="";if(!$G){$this->error=pg_last_error($this->_link);$H=false;}elseif(!pg_num_fields($G)){$this->affected_rows=pg_affected_rows($G);$H=true;}else$H=new
    54885513Min_Result($G);if($this->timeout){$this->timeout=0;$this->query("RESET statement_timeout");}return$H;}function
    54895514multi_query($F){return$this->_result=$this->query($F);}function
     
    55115536true;}function
    55125537select_db($j){global$b;return($b->database()==$j);}function
    5513 quoteBinary($bh){return
    5514 q($bh);}function
    5515 query($F,$Fi=false){$H=parent::query($F,$Fi);if($this->timeout){$this->timeout=0;parent::query("RESET statement_timeout");}return$H;}function
     5538quoteBinary($dh){return
     5539q($dh);}function
     5540query($F,$Hi=false){$H=parent::query($F,$Hi);if($this->timeout){$this->timeout=0;parent::query("RESET statement_timeout");}return$H;}function
    55165541warnings(){return'';}function
    55175542close(){}}}class
     
    55195544extends
    55205545Min_SQL{function
    5521 insertUpdate($Q,$J,$ng){global$h;foreach($J
    5522 as$N){$Mi=array();$Z=array();foreach($N
    5523 as$y=>$X){$Mi[]="$y = $X";if(isset($ng[idf_unescape($y)]))$Z[]="$y = $X";}if(!(($Z&&queries("UPDATE ".table($Q)." SET ".implode(", ",$Mi)." WHERE ".implode(" AND ",$Z))&&$h->affected_rows)||queries("INSERT INTO ".table($Q)." (".implode(", ",array_keys($N)).") VALUES (".implode(", ",$N).")")))return
     5546insertUpdate($Q,$J,$pg){global$h;foreach($J
     5547as$N){$Oi=array();$Z=array();foreach($N
     5548as$y=>$X){$Oi[]="$y = $X";if(isset($pg[idf_unescape($y)]))$Z[]="$y = $X";}if(!(($Z&&queries("UPDATE ".table($Q)." SET ".implode(", ",$Oi)." WHERE ".implode(" AND ",$Z))&&$h->affected_rows)||queries("INSERT INTO ".table($Q)." (".implode(", ",array_keys($N)).") VALUES (".implode(", ",$N).")")))return
    55245549false;}return
    55255550true;}function
    5526 slowQuery($F,$ii){$this->_conn->query("SET statement_timeout = ".(1000*$ii));$this->_conn->timeout=1000*$ii;return$F;}function
     5551slowQuery($F,$ki){$this->_conn->query("SET statement_timeout = ".(1000*$ki));$this->_conn->timeout=1000*$ki;return$F;}function
    55275552convertSearch($u,$X,$o){return(preg_match('~char|text'.(!preg_match('~LIKE~',$X["op"])?'|date|time(stamp)?|boolean|uuid|'.number_type():'').'~',$o["type"])?$u:"CAST($u AS text)");}function
    5528 quoteBinary($bh){return$this->_conn->quoteBinary($bh);}function
     5553quoteBinary($dh){return$this->_conn->quoteBinary($dh);}function
    55295554warnings(){return$this->_conn->warnings();}function
    5530 tableHelp($B){$ze=array("information_schema"=>"infoschema","pg_catalog"=>"catalog",);$_=$ze[$_GET["ns"]];if($_)return"$_-".str_replace("_","-",$B).".html";}}function
     5555tableHelp($B){$Ae=array("information_schema"=>"infoschema","pg_catalog"=>"catalog",);$_=$Ae[$_GET["ns"]];if($_)return"$_-".str_replace("_","-",$B).".html";}}function
    55315556idf_escape($u){return'"'.str_replace('"','""',$u).'"';}function
    55325557table($u){return
    55335558idf_escape($u);}function
    5534 connect(){global$b,$U,$Kh;$h=new
    5535 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2])){if(min_version(9,0,$h)){$h->query("SET application_name = 'Adminer'");if(min_version(9.2,0,$h)){$Kh[lang(25)][]="json";$U["json"]=4294967295;if(min_version(9.4,0,$h)){$Kh[lang(25)][]="jsonb";$U["jsonb"]=4294967295;}}}return$h;}return$h->error;}function
     5559connect(){global$b,$U,$Mh;$h=new
     5560Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2])){if(min_version(9,0,$h)){$h->query("SET application_name = 'Adminer'");if(min_version(9.2,0,$h)){$Mh[lang(25)][]="json";$U["json"]=4294967295;if(min_version(9.4,0,$h)){$Mh[lang(25)][]="jsonb";$U["jsonb"]=4294967295;}}}return$h;}return$h->error;}function
    55365561get_databases(){return
    55375562get_vals("SELECT datname FROM pg_database WHERE has_database_privilege(datname, 'CONNECT') ORDER BY datname");}function
     
    55605585fk_support($R){return
    55615586true;}function
    5562 fields($Q){$H=array();$Da=array('timestamp without time zone'=>'timestamp','timestamp with time zone'=>'timestamptz',);$Fd=min_version(10)?"(a.attidentity = 'd')::int":'0';foreach(get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, pg_get_expr(d.adbin, d.adrelid) AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment, $Fd AS identity
     5587fields($Q){$H=array();$Da=array('timestamp without time zone'=>'timestamp','timestamp with time zone'=>'timestamptz',);$Hd=min_version(10)?"(a.attidentity = 'd')::int":'0';foreach(get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, pg_get_expr(d.adbin, d.adrelid) AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment, $Hd AS identity
    55635588FROM pg_class c
    55645589JOIN pg_namespace n ON c.relnamespace = n.oid
     
    55695594AND NOT a.attisdropped
    55705595AND a.attnum > 0
    5571 ORDER BY a.attnum")as$I){preg_match('~([^([]+)(\((.*)\))?([a-z ]+)?((\[[0-9]*])*)$~',$I["full_type"],$A);list(,$T,$we,$I["length"],$xa,$Ga)=$A;$I["length"].=$Ga;$fb=$T.$xa;if(isset($Da[$fb])){$I["type"]=$Da[$fb];$I["full_type"]=$I["type"].$we.$Ga;}else{$I["type"]=$T;$I["full_type"]=$I["type"].$we.$xa.$Ga;}if($I['identity'])$I['default']='GENERATED BY DEFAULT AS IDENTITY';$I["null"]=!$I["attnotnull"];$I["auto_increment"]=$I['identity']||preg_match('~^nextval\(~i',$I["default"]);$I["privileges"]=array("insert"=>1,"select"=>1,"update"=>1);if(preg_match('~(.+)::[^)]+(.*)~',$I["default"],$A))$I["default"]=($A[1]=="NULL"?null:(($A[1][0]=="'"?idf_unescape($A[1]):$A[1]).$A[2]));$H[$I["field"]]=$I;}return$H;}function
    5572 indexes($Q,$i=null){global$h;if(!is_object($i))$i=$h;$H=array();$Th=$i->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = ".q($Q));$f=get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $Th AND attnum > 0",$i);foreach(get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption , (indpred IS NOT NULL)::int as indispartial FROM pg_index i, pg_class ci WHERE i.indrelid = $Th AND ci.oid = i.indexrelid",$i)as$I){$Lg=$I["relname"];$H[$Lg]["type"]=($I["indispartial"]?"INDEX":($I["indisprimary"]?"PRIMARY":($I["indisunique"]?"UNIQUE":"INDEX")));$H[$Lg]["columns"]=array();foreach(explode(" ",$I["indkey"])as$Pd)$H[$Lg]["columns"][]=$f[$Pd];$H[$Lg]["descs"]=array();foreach(explode(" ",$I["indoption"])as$Qd)$H[$Lg]["descs"][]=($Qd&1?'1':null);$H[$Lg]["lengths"]=array();}return$H;}function
    5573 foreign_keys($Q){global$tf;$H=array();foreach(get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
     5596ORDER BY a.attnum")as$I){preg_match('~([^([]+)(\((.*)\))?([a-z ]+)?((\[[0-9]*])*)$~',$I["full_type"],$A);list(,$T,$ye,$I["length"],$xa,$Ga)=$A;$I["length"].=$Ga;$fb=$T.$xa;if(isset($Da[$fb])){$I["type"]=$Da[$fb];$I["full_type"]=$I["type"].$ye.$Ga;}else{$I["type"]=$T;$I["full_type"]=$I["type"].$ye.$xa.$Ga;}if($I['identity'])$I['default']='GENERATED BY DEFAULT AS IDENTITY';$I["null"]=!$I["attnotnull"];$I["auto_increment"]=$I['identity']||preg_match('~^nextval\(~i',$I["default"]);$I["privileges"]=array("insert"=>1,"select"=>1,"update"=>1);if(preg_match('~(.+)::[^)]+(.*)~',$I["default"],$A))$I["default"]=($A[1]=="NULL"?null:(($A[1][0]=="'"?idf_unescape($A[1]):$A[1]).$A[2]));$H[$I["field"]]=$I;}return$H;}function
     5597indexes($Q,$i=null){global$h;if(!is_object($i))$i=$h;$H=array();$Vh=$i->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = ".q($Q));$f=get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $Vh AND attnum > 0",$i);foreach(get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption , (indpred IS NOT NULL)::int as indispartial FROM pg_index i, pg_class ci WHERE i.indrelid = $Vh AND ci.oid = i.indexrelid",$i)as$I){$Ng=$I["relname"];$H[$Ng]["type"]=($I["indispartial"]?"INDEX":($I["indisprimary"]?"PRIMARY":($I["indisunique"]?"UNIQUE":"INDEX")));$H[$Ng]["columns"]=array();foreach(explode(" ",$I["indkey"])as$Rd)$H[$Ng]["columns"][]=$f[$Rd];$H[$Ng]["descs"]=array();foreach(explode(" ",$I["indoption"])as$Sd)$H[$Ng]["descs"][]=($Sd&1?'1':null);$H[$Ng]["lengths"]=array();}return$H;}function
     5598foreign_keys($Q){global$vf;$H=array();foreach(get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
    55745599FROM pg_constraint
    55755600WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = ".q($Q)." AND pn.nspname = current_schema())
    55765601AND contype = 'f'::char
    5577 ORDER BY conkey, conname")as$I){if(preg_match('~FOREIGN KEY\s*\((.+)\)\s*REFERENCES (.+)\((.+)\)(.*)$~iA',$I['definition'],$A)){$I['source']=array_map('trim',explode(',',$A[1]));if(preg_match('~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~',$A[2],$Fe)){$I['ns']=str_replace('""','"',preg_replace('~^"(.+)"$~','\1',$Fe[2]));$I['table']=str_replace('""','"',preg_replace('~^"(.+)"$~','\1',$Fe[4]));}$I['target']=array_map('trim',explode(',',$A[3]));$I['on_delete']=(preg_match("~ON DELETE ($tf)~",$A[4],$Fe)?$Fe[1]:'NO ACTION');$I['on_update']=(preg_match("~ON UPDATE ($tf)~",$A[4],$Fe)?$Fe[1]:'NO ACTION');$H[$I['conname']]=$I;}}return$H;}function
     5602ORDER BY conkey, conname")as$I){if(preg_match('~FOREIGN KEY\s*\((.+)\)\s*REFERENCES (.+)\((.+)\)(.*)$~iA',$I['definition'],$A)){$I['source']=array_map('trim',explode(',',$A[1]));if(preg_match('~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~',$A[2],$He)){$I['ns']=str_replace('""','"',preg_replace('~^"(.+)"$~','\1',$He[2]));$I['table']=str_replace('""','"',preg_replace('~^"(.+)"$~','\1',$He[4]));}$I['target']=array_map('trim',explode(',',$A[3]));$I['on_delete']=(preg_match("~ON DELETE ($vf)~",$A[4],$He)?$He[1]:'NO ACTION');$I['on_update']=(preg_match("~ON UPDATE ($vf)~",$A[4],$He)?$He[1]:'NO ACTION');$H[$I['conname']]=$I;}}return$H;}function
    55785603view($B){global$h;return
    55795604array("select"=>trim($h->result("SELECT pg_get_viewdef(".$h->result("SELECT oid FROM pg_class WHERE relname = ".q($B)).")")));}function
     
    55905615queries("ALTER DATABASE ".idf_escape(DB)." RENAME TO ".idf_escape($B));}function
    55915616auto_increment(){return"";}function
    5592 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){$c=array();$yg=array();if($Q!=""&&$Q!=$B)$yg[]="ALTER TABLE ".table($Q)." RENAME TO ".table($B);foreach($p
    5593 as$o){$e=idf_escape($o[0]);$X=$o[1];if(!$X)$c[]="DROP $e";else{$Xi=$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])$yg[]="ALTER TABLE ".table($B)." 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]!=""||$Xi!="")$yg[]="COMMENT ON COLUMN ".table($B).".$X[0] IS ".($Xi!=""?substr($Xi,9):"''");}}$c=array_merge($c,$ed);if($Q=="")array_unshift($yg,"CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)");elseif($c)array_unshift($yg,"ALTER TABLE ".table($Q)."\n".implode(",\n",$c));if($Q!=""||$vb!="")$yg[]="COMMENT ON TABLE ".table($B)." IS ".q($vb);if($Na!=""){}foreach($yg
     5617alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){$c=array();$_g=array();if($Q!=""&&$Q!=$B)$_g[]="ALTER TABLE ".table($Q)." RENAME TO ".table($B);foreach($p
     5618as$o){$e=idf_escape($o[0]);$X=$o[1];if(!$X)$c[]="DROP $e";else{$Zi=$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])$_g[]="ALTER TABLE ".table($B)." 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]!=""||$Zi!="")$_g[]="COMMENT ON COLUMN ".table($B).".$X[0] IS ".($Zi!=""?substr($Zi,9):"''");}}$c=array_merge($c,$gd);if($Q=="")array_unshift($_g,"CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)");elseif($c)array_unshift($_g,"ALTER TABLE ".table($Q)."\n".implode(",\n",$c));if($Q!=""||$vb!="")$_g[]="COMMENT ON TABLE ".table($B)." IS ".q($vb);if($Na!=""){}foreach($_g
    55945619as$F){if(!queries($F))return
    55955620false;}return
    55965621true;}function
    5597 alter_indexes($Q,$c){$Gb=array();$hc=array();$yg=array();foreach($c
    5598 as$X){if($X[0]!="INDEX")$Gb[]=($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")$hc[]=idf_escape($X[1]);else$yg[]="CREATE INDEX ".idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q)." (".implode(", ",$X[2]).")";}if($Gb)array_unshift($yg,"ALTER TABLE ".table($Q).implode(",",$Gb));if($hc)array_unshift($yg,"DROP INDEX ".implode(", ",$hc));foreach($yg
     5622alter_indexes($Q,$c){$Hb=array();$jc=array();$_g=array();foreach($c
     5623as$X){if($X[0]!="INDEX")$Hb[]=($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")$jc[]=idf_escape($X[1]);else$_g[]="CREATE INDEX ".idf_escape($X[1]!=""?$X[1]:uniqid($Q."_"))." ON ".table($Q)." (".implode(", ",$X[2]).")";}if($Hb)array_unshift($_g,"ALTER TABLE ".table($Q).implode(",",$Hb));if($jc)array_unshift($_g,"DROP INDEX ".implode(", ",$jc));foreach($_g
    55995624as$F){if(!queries($F))return
    56005625false;}return
     
    56035628queries("TRUNCATE ".implode(", ",array_map('table',$S)));return
    56045629true;}function
    5605 drop_views($dj){return
    5606 drop_tables($dj);}function
     5630drop_views($fj){return
     5631drop_tables($fj);}function
    56075632drop_tables($S){foreach($S
    56085633as$Q){$O=table_status($Q);if(!queries("DROP ".strtoupper($O["Engine"])." ".table($Q)))return
    56095634false;}return
    56105635true;}function
    5611 move_tables($S,$dj,$ai){foreach(array_merge($S,$dj)as$Q){$O=table_status($Q);if(!queries("ALTER ".strtoupper($O["Engine"])." ".table($Q)." SET SCHEMA ".idf_escape($ai)))return
     5636move_tables($S,$fj,$ci){foreach(array_merge($S,$fj)as$Q){$O=table_status($Q);if(!queries("ALTER ".strtoupper($O["Engine"])." ".table($Q)." SET SCHEMA ".idf_escape($ci)))return
    56125637false;}return
    56135638true;}function
     
    563656610;}function
    56375662explain($h,$F){return$h->query("EXPLAIN $F");}function
    5638 found_rows($R,$Z){global$h;if(preg_match("~ rows=([0-9]+)~",$h->result("EXPLAIN SELECT * FROM ".idf_escape($R["Name"]).($Z?" WHERE ".implode(" AND ",$Z):"")),$Kg))return$Kg[1];return
     5663found_rows($R,$Z){global$h;if(preg_match("~ rows=([0-9]+)~",$h->result("EXPLAIN SELECT * FROM ".idf_escape($R["Name"]).($Z?" WHERE ".implode(" AND ",$Z):"")),$Mg))return$Mg[1];return
    56395664false;}function
    56405665types(){return
     
    56475672get_vals("SELECT nspname FROM pg_namespace ORDER BY nspname");}function
    56485673get_schema(){global$h;return$h->result("SELECT current_schema()");}function
    5649 set_schema($dh,$i=null){global$h,$U,$Kh;if(!$i)$i=$h;$H=$i->query("SET search_path TO ".idf_escape($dh));foreach(types()as$T){if(!isset($U[$T])){$U[$T]=0;$Kh[lang(26)][]=$T;}}return$H;}function
    5650 create_sql($Q,$Na,$Lh){global$h;$H='';$Tg=array();$nh=array();$O=table_status($Q);$p=fields($Q);$w=indexes($Q);ksort($w);$bd=foreign_keys($Q);ksort($bd);if(!$O||empty($p))return
     5674set_schema($fh,$i=null){global$h,$U,$Mh;if(!$i)$i=$h;$H=$i->query("SET search_path TO ".idf_escape($fh));foreach(types()as$T){if(!isset($U[$T])){$U[$T]=0;$Mh[lang(26)][]=$T;}}return$H;}function
     5675create_sql($Q,$Na,$Nh){global$h;$H='';$Vg=array();$ph=array();$O=table_status($Q);if(is_view($O)){$ej=view($Q);return
     5676rtrim("CREATE VIEW ".idf_escape($Q)." AS $ej[select]",";");}$p=fields($Q);$w=indexes($Q);ksort($w);$dd=foreign_keys($Q);ksort($dd);if(!$O||empty($p))return
    56515677false;$H="CREATE TABLE ".idf_escape($O['nspname']).".".idf_escape($O['Name'])." (\n    ";foreach($p
    5652 as$Tc=>$o){$Uf=idf_escape($o['field']).' '.$o['full_type'].default_value($o).($o['attnotnull']?" NOT NULL":"");$Tg[]=$Uf;if(preg_match('~nextval\(\'([^\']+)\'\)~',$o['default'],$Ge)){$mh=$Ge[1];$Ah=reset(get_rows(min_version(10)?"SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = ".q($mh):"SELECT * FROM $mh"));$nh[]=($Lh=="DROP+CREATE"?"DROP SEQUENCE IF EXISTS $mh;\n":"")."CREATE SEQUENCE $mh INCREMENT $Ah[increment_by] MINVALUE $Ah[min_value] MAXVALUE $Ah[max_value] START ".($Na?$Ah['last_value']:1)." CACHE $Ah[cache_value];";}}if(!empty($nh))$H=implode("\n\n",$nh)."\n\n$H";foreach($w
    5653 as$Kd=>$v){switch($v['type']){case'UNIQUE':$Tg[]="CONSTRAINT ".idf_escape($Kd)." UNIQUE (".implode(', ',array_map('idf_escape',$v['columns'])).")";break;case'PRIMARY':$Tg[]="CONSTRAINT ".idf_escape($Kd)." PRIMARY KEY (".implode(', ',array_map('idf_escape',$v['columns'])).")";break;}}foreach($bd
    5654 as$ad=>$Zc)$Tg[]="CONSTRAINT ".idf_escape($ad)." $Zc[definition] ".($Zc['deferrable']?'DEFERRABLE':'NOT DEFERRABLE');$H.=implode(",\n    ",$Tg)."\n) WITH (oids = ".($O['Oid']?'true':'false').");";foreach($w
    5655 as$Kd=>$v){if($v['type']=='INDEX'){$f=array();foreach($v['columns']as$y=>$X)$f[]=idf_escape($X).($v['descs'][$y]?" DESC":"");$H.="\n\nCREATE INDEX ".idf_escape($Kd)." ON ".idf_escape($O['nspname']).".".idf_escape($O['Name'])." USING btree (".implode(', ',$f).");";}}if($O['Comment'])$H.="\n\nCOMMENT ON TABLE ".idf_escape($O['nspname']).".".idf_escape($O['Name'])." IS ".q($O['Comment']).";";foreach($p
    5656 as$Tc=>$o){if($o['comment'])$H.="\n\nCOMMENT ON COLUMN ".idf_escape($O['nspname']).".".idf_escape($O['Name']).".".idf_escape($Tc)." IS ".q($o['comment']).";";}return
     5678as$Vc=>$o){$Wf=idf_escape($o['field']).' '.$o['full_type'].default_value($o).($o['attnotnull']?" NOT NULL":"");$Vg[]=$Wf;if(preg_match('~nextval\(\'([^\']+)\'\)~',$o['default'],$Ie)){$oh=$Ie[1];$Ch=reset(get_rows(min_version(10)?"SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = ".q($oh):"SELECT * FROM $oh"));$ph[]=($Nh=="DROP+CREATE"?"DROP SEQUENCE IF EXISTS $oh;\n":"")."CREATE SEQUENCE $oh INCREMENT $Ch[increment_by] MINVALUE $Ch[min_value] MAXVALUE $Ch[max_value] START ".($Na?$Ch['last_value']:1)." CACHE $Ch[cache_value];";}}if(!empty($ph))$H=implode("\n\n",$ph)."\n\n$H";foreach($w
     5679as$Md=>$v){switch($v['type']){case'UNIQUE':$Vg[]="CONSTRAINT ".idf_escape($Md)." UNIQUE (".implode(', ',array_map('idf_escape',$v['columns'])).")";break;case'PRIMARY':$Vg[]="CONSTRAINT ".idf_escape($Md)." PRIMARY KEY (".implode(', ',array_map('idf_escape',$v['columns'])).")";break;}}foreach($dd
     5680as$cd=>$bd)$Vg[]="CONSTRAINT ".idf_escape($cd)." $bd[definition] ".($bd['deferrable']?'DEFERRABLE':'NOT DEFERRABLE');$H.=implode(",\n    ",$Vg)."\n) WITH (oids = ".($O['Oid']?'true':'false').");";foreach($w
     5681as$Md=>$v){if($v['type']=='INDEX'){$f=array();foreach($v['columns']as$y=>$X)$f[]=idf_escape($X).($v['descs'][$y]?" DESC":"");$H.="\n\nCREATE INDEX ".idf_escape($Md)." ON ".idf_escape($O['nspname']).".".idf_escape($O['Name'])." USING btree (".implode(', ',$f).");";}}if($O['Comment'])$H.="\n\nCOMMENT ON TABLE ".idf_escape($O['nspname']).".".idf_escape($O['Name'])." IS ".q($O['Comment']).";";foreach($p
     5682as$Vc=>$o){if($o['comment'])$H.="\n\nCOMMENT ON COLUMN ".idf_escape($O['nspname']).".".idf_escape($O['Name']).".".idf_escape($Vc)." IS ".q($o['comment']).";";}return
    56575683rtrim($H,';');}function
    56585684truncate_sql($Q){return"TRUNCATE ".table($Q);}function
    5659 trigger_sql($Q){$O=table_status($Q);$H="";foreach(triggers($Q)as$zi=>$yi){$_i=trigger($zi,$O['Name']);$H.="\nCREATE TRIGGER ".idf_escape($_i['Trigger'])." $_i[Timing] $_i[Events] ON ".idf_escape($O["nspname"]).".".idf_escape($O['Name'])." $_i[Type] $_i[Statement];;\n";}return$H;}function
     5685trigger_sql($Q){$O=table_status($Q);$H="";foreach(triggers($Q)as$Ai=>$_i){$Bi=trigger($Ai,$O['Name']);$H.="\nCREATE TRIGGER ".idf_escape($Bi['Trigger'])." $Bi[Timing] $Bi[Events] ON ".idf_escape($O["nspname"]).".".idf_escape($O['Name'])." $Bi[Type] $Bi[Statement];;\n";}return$H;}function
    56605686use_sql($j){return"\connect ".idf_escape($j);}function
    56615687show_variables(){return
     
    56665692convert_field($o){}function
    56675693unconvert_field($o,$H){return$H;}function
    5668 support($Rc){return
    5669 preg_match('~^(database|table|columns|sql|indexes|descidx|comment|view|'.(min_version(9.3)?'materializedview|':'').'scheme|routine|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~',$Rc);}function
     5694support($Tc){return
     5695preg_match('~^(database|table|columns|sql|indexes|descidx|comment|view|'.(min_version(9.3)?'materializedview|':'').'scheme|routine|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~',$Tc);}function
    56705696kill_process($X){return
    56715697queries("SELECT pg_terminate_backend(".number($X).")");}function
    56725698connection_id(){return"SELECT pg_backend_pid()";}function
    5673 max_connections(){global$h;return$h->result("SHOW max_connections");}$x="pgsql";$U=array();$Kh=array();foreach(array(lang(27)=>array("smallint"=>5,"integer"=>10,"bigint"=>19,"boolean"=>1,"numeric"=>0,"real"=>7,"double precision"=>16,"money"=>20),lang(28)=>array("date"=>13,"time"=>17,"timestamp"=>20,"timestamptz"=>21,"interval"=>0),lang(25)=>array("character"=>0,"character varying"=>0,"text"=>0,"tsquery"=>0,"tsvector"=>0,"uuid"=>0,"xml"=>0),lang(29)=>array("bit"=>0,"bit varying"=>0,"bytea"=>0),lang(30)=>array("cidr"=>43,"inet"=>43,"macaddr"=>17,"txid_snapshot"=>0),lang(31)=>array("box"=>0,"circle"=>0,"line"=>0,"lseg"=>0,"path"=>0,"point"=>0,"polygon"=>0),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}$Li=array();$yf=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","ILIKE","ILIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$md=array("char_length","lower","round","to_hex","to_timestamp","upper");$sd=array("avg","count","count distinct","max","min","sum");$oc=array(array("char"=>"md5","date|time"=>"now",),array(number_type()=>"+/-","date|time"=>"+ interval/- interval","char|text"=>"||",));}$gc["oracle"]="Oracle (beta)";if(isset($_GET["oracle"])){$kg=array("OCI8","PDO_OCI");define("DRIVER","oracle");if(extension_loaded("oci8")){class
     5699max_connections(){global$h;return$h->result("SHOW max_connections");}$x="pgsql";$U=array();$Mh=array();foreach(array(lang(27)=>array("smallint"=>5,"integer"=>10,"bigint"=>19,"boolean"=>1,"numeric"=>0,"real"=>7,"double precision"=>16,"money"=>20),lang(28)=>array("date"=>13,"time"=>17,"timestamp"=>20,"timestamptz"=>21,"interval"=>0),lang(25)=>array("character"=>0,"character varying"=>0,"text"=>0,"tsquery"=>0,"tsvector"=>0,"uuid"=>0,"xml"=>0),lang(29)=>array("bit"=>0,"bit varying"=>0,"bytea"=>0),lang(30)=>array("cidr"=>43,"inet"=>43,"macaddr"=>17,"txid_snapshot"=>0),lang(31)=>array("box"=>0,"circle"=>0,"line"=>0,"lseg"=>0,"path"=>0,"point"=>0,"polygon"=>0),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}$Ni=array();$_f=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","ILIKE","ILIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$od=array("char_length","lower","round","to_hex","to_timestamp","upper");$ud=array("avg","count","count distinct","max","min","sum");$qc=array(array("char"=>"md5","date|time"=>"now",),array(number_type()=>"+/-","date|time"=>"+ interval/- interval","char|text"=>"||",));}$ic["oracle"]="Oracle (beta)";if(isset($_GET["oracle"])){$mg=array("OCI8","PDO_OCI");define("DRIVER","oracle");if(extension_loaded("oci8")){class
    56745700Min_DB{var$extension="oci8",$_link,$_result,$server_info,$affected_rows,$errno,$error;function
    5675 _error($zc,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
     5701_error($Ac,$n){if(ini_bool("html_errors"))$n=html_entity_decode(strip_tags($n));$n=preg_replace('~^[^:]*: ~','',$n);$this->error=$n;}function
    56765702connect($M,$V,$E){$this->_link=@oci_new_connect($V,$E,$M,"AL32UTF8");if($this->_link){$this->server_info=oci_server_version($this->_link);return
    56775703true;}$n=oci_error();$this->error=$n["message"];return
     
    56805706select_db($j){return
    56815707true;}function
    5682 query($F,$Fi=false){$G=oci_parse($this->_link,$F);$this->error="";if(!$G){$n=oci_error($this->_link);$this->errno=$n["code"];$this->error=$n["message"];return
     5708query($F,$Hi=false){$G=oci_parse($this->_link,$F);$this->error="";if(!$G){$n=oci_error($this->_link);$this->errno=$n["code"];$this->error=$n["message"];return
    56835709false;}set_error_handler(array($this,'_error'));$H=@oci_execute($G);restore_error_handler();if($H){if(oci_num_fields($G))return
    56845710new
     
    57165742idf_escape($u);}function
    57175743connect(){global$b;$h=new
    5718 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2]))return$h;return$h->error;}function
     5744Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2]))return$h;return$h->error;}function
    57195745get_databases(){return
    57205746get_vals("SELECT tablespace_name FROM user_tablespaces");}function
     
    57315757count_tables($k){return
    57325758array();}function
    5733 table_status($B=""){$H=array();$fh=q($B);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).($B!=""?" AND table_name = $fh":"")."
    5734 UNION SELECT view_name, 'view', 0, 0 FROM user_views".($B!=""?" WHERE view_name = $fh":"")."
     5759table_status($B=""){$H=array();$hh=q($B);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).($B!=""?" AND table_name = $hh":"")."
     5760UNION SELECT view_name, 'view', 0, 0 FROM user_views".($B!=""?" WHERE view_name = $hh":"")."
    57355761ORDER BY 1")as$I){if($B!="")return$I;$H[$I["Name"]]=$I;}return$H;}function
    57365762is_view($R){return$R["Engine"]=="view";}function
    57375763fk_support($R){return
    57385764true;}function
    5739 fields($Q){$H=array();foreach(get_rows("SELECT * FROM all_tab_columns WHERE table_name = ".q($Q)." ORDER BY column_id")as$I){$T=$I["DATA_TYPE"];$we="$I[DATA_PRECISION],$I[DATA_SCALE]";if($we==",")$we=$I["DATA_LENGTH"];$H[$I["COLUMN_NAME"]]=array("field"=>$I["COLUMN_NAME"],"full_type"=>$T.($we?"($we)":""),"type"=>strtolower($T),"length"=>$we,"default"=>$I["DATA_DEFAULT"],"null"=>($I["NULLABLE"]=="Y"),"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),);}return$H;}function
     5765fields($Q){$H=array();foreach(get_rows("SELECT * FROM all_tab_columns WHERE table_name = ".q($Q)." ORDER BY column_id")as$I){$T=$I["DATA_TYPE"];$ye="$I[DATA_PRECISION],$I[DATA_SCALE]";if($ye==",")$ye=$I["DATA_LENGTH"];$H[$I["COLUMN_NAME"]]=array("field"=>$I["COLUMN_NAME"],"full_type"=>$T.($ye?"($ye)":""),"type"=>strtolower($T),"length"=>$ye,"default"=>$I["DATA_DEFAULT"],"null"=>($I["NULLABLE"]=="Y"),"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),);}return$H;}function
    57405766indexes($Q,$i=null){$H=array();foreach(get_rows("SELECT uic.*, uc.constraint_type
    57415767FROM user_ind_columns uic
    57425768LEFT JOIN user_constraints uc ON uic.index_name = uc.constraint_name AND uic.table_name = uc.table_name
    57435769WHERE uic.table_name = ".q($Q)."
    5744 ORDER BY uc.constraint_type, uic.column_position",$i)as$I){$Kd=$I["INDEX_NAME"];$H[$Kd]["type"]=($I["CONSTRAINT_TYPE"]=="P"?"PRIMARY":($I["CONSTRAINT_TYPE"]=="U"?"UNIQUE":"INDEX"));$H[$Kd]["columns"][]=$I["COLUMN_NAME"];$H[$Kd]["lengths"][]=($I["CHAR_LENGTH"]&&$I["CHAR_LENGTH"]!=$I["COLUMN_LENGTH"]?$I["CHAR_LENGTH"]:null);$H[$Kd]["descs"][]=($I["DESCEND"]?'1':null);}return$H;}function
     5770ORDER BY uc.constraint_type, uic.column_position",$i)as$I){$Md=$I["INDEX_NAME"];$H[$Md]["type"]=($I["CONSTRAINT_TYPE"]=="P"?"PRIMARY":($I["CONSTRAINT_TYPE"]=="U"?"UNIQUE":"INDEX"));$H[$Md]["columns"][]=$I["COLUMN_NAME"];$H[$Md]["lengths"][]=($I["CHAR_LENGTH"]&&$I["CHAR_LENGTH"]!=$I["COLUMN_LENGTH"]?$I["CHAR_LENGTH"]:null);$H[$Md]["descs"][]=($I["DESCEND"]?'1':null);}return$H;}function
    57455771view($B){$J=get_rows('SELECT text "select" FROM user_views WHERE view_name = '.q($B));return
    57465772reset($J);}function
     
    57535779explain($h,$F){$h->query("EXPLAIN PLAN FOR $F");return$h->query("SELECT * FROM plan_table");}function
    57545780found_rows($R,$Z){}function
    5755 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){$c=$hc=array();foreach($p
    5756 as$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$hc[]=idf_escape($o[0]);}if($Q=="")return
    5757 queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)");return(!$c||queries("ALTER TABLE ".table($Q)."\n".implode("\n",$c)))&&(!$hc||queries("ALTER TABLE ".table($Q)." DROP (".implode(", ",$hc).")"))&&($Q==$B||queries("ALTER TABLE ".table($Q)." RENAME TO ".table($B)));}function
     5781alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){$c=$jc=array();foreach($p
     5782as$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$jc[]=idf_escape($o[0]);}if($Q=="")return
     5783queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)");return(!$c||queries("ALTER TABLE ".table($Q)."\n".implode("\n",$c)))&&(!$jc||queries("ALTER TABLE ".table($Q)." DROP (".implode(", ",$jc).")"))&&($Q==$B||queries("ALTER TABLE ".table($Q)." RENAME TO ".table($B)));}function
    57585784foreign_keys($Q){$H=array();$F="SELECT c_list.CONSTRAINT_NAME as NAME,
    57595785c_src.COLUMN_NAME as SRC_COLUMN,
     
    57695795truncate_tables($S){return
    57705796apply_queries("TRUNCATE TABLE",$S);}function
    5771 drop_views($dj){return
    5772 apply_queries("DROP VIEW",$dj);}function
     5797drop_views($fj){return
     5798apply_queries("DROP VIEW",$fj);}function
    57735799drop_tables($S){return
    57745800apply_queries("DROP TABLE",$S);}function
     
    57785804get_vals("SELECT DISTINCT owner FROM dba_segments WHERE owner IN (SELECT username FROM dba_users WHERE default_tablespace NOT IN ('SYSTEM','SYSAUX'))");}function
    57795805get_schema(){global$h;return$h->result("SELECT sys_context('USERENV', 'SESSION_USER') FROM dual");}function
    5780 set_schema($eh,$i=null){global$h;if(!$i)$i=$h;return$i->query("ALTER SESSION SET CURRENT_SCHEMA = ".idf_escape($eh));}function
     5806set_schema($gh,$i=null){global$h;if(!$i)$i=$h;return$i->query("ALTER SESSION SET CURRENT_SCHEMA = ".idf_escape($gh));}function
    57815807show_variables(){return
    57825808get_key_vals('SELECT name, display_value FROM v$parameter');}function
     
    57925818convert_field($o){}function
    57935819unconvert_field($o,$H){return$H;}function
    5794 support($Rc){return
    5795 preg_match('~^(columns|database|drop_col|indexes|descidx|processlist|scheme|sql|status|table|variables|view|view_trigger)$~',$Rc);}$x="oracle";$U=array();$Kh=array();foreach(array(lang(27)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(28)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(25)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(29)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}$Li=array();$yf=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$md=array("length","lower","round","upper");$sd=array("avg","count","count distinct","max","min","sum");$oc=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$gc["mssql"]="MS SQL (beta)";if(isset($_GET["mssql"])){$kg=array("SQLSRV","MSSQL","PDO_DBLIB");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
     5820support($Tc){return
     5821preg_match('~^(columns|database|drop_col|indexes|descidx|processlist|scheme|sql|status|table|variables|view|view_trigger)$~',$Tc);}$x="oracle";$U=array();$Mh=array();foreach(array(lang(27)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(28)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(25)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(29)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}$Ni=array();$_f=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$od=array("length","lower","round","upper");$ud=array("avg","count","count distinct","max","min","sum");$qc=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$ic["mssql"]="MS SQL (beta)";if(isset($_GET["mssql"])){$mg=array("SQLSRV","MSSQL","PDO_DBLIB");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
    57965822Min_DB{var$extension="sqlsrv",$_link,$_result,$server_info,$affected_rows,$errno,$error;function
    57975823_get_error(){$this->error="";foreach(sqlsrv_errors()as$n){$this->errno=$n["code"];$this->error.="$n[message]\n";}$this->error=rtrim($this->error);}function
    5798 connect($M,$V,$E){global$b;$l=$b->database();$zb=array("UID"=>$V,"PWD"=>$E,"CharacterSet"=>"UTF-8");if($l!="")$zb["Database"]=$l;$this->_link=@sqlsrv_connect(preg_replace('~:~',',',$M),$zb);if($this->_link){$Rd=sqlsrv_server_info($this->_link);$this->server_info=$Rd['SQLServerVersion'];}else$this->_get_error();return(bool)$this->_link;}function
     5824connect($M,$V,$E){global$b;$l=$b->database();$_b=array("UID"=>$V,"PWD"=>$E,"CharacterSet"=>"UTF-8");if($l!="")$_b["Database"]=$l;$this->_link=@sqlsrv_connect(preg_replace('~:~',',',$M),$_b);if($this->_link){$Td=sqlsrv_server_info($this->_link);$this->server_info=$Td['SQLServerVersion'];}else$this->_get_error();return(bool)$this->_link;}function
    57995825quote($P){return"'".str_replace("'","''",$P)."'";}function
    58005826select_db($j){return$this->query("USE ".idf_escape($j));}function
    5801 query($F,$Fi=false){$G=sqlsrv_query($this->_link,$F);$this->error="";if(!$G){$this->_get_error();return
     5827query($F,$Hi=false){$G=sqlsrv_query($this->_link,$F);$this->error="";if(!$G){$this->_get_error();return
    58025828false;}return$this->store_result($G);}function
    58035829multi_query($F){$this->_result=sqlsrv_query($this->_link,$F);$this->error="";if(!$this->_result){$this->_get_error();return
     
    58275853select_db($j){return
    58285854mssql_select_db($j);}function
    5829 query($F,$Fi=false){$G=@mssql_query($F,$this->_link);$this->error="";if(!$G){$this->error=mssql_get_last_message();return
     5855query($F,$Hi=false){$G=@mssql_query($F,$this->_link);$this->error="";if(!$G){$this->error=mssql_get_last_message();return
    58305856false;}if($G===true){$this->affected_rows=mssql_rows_affected($this->_link);return
    58315857true;}return
     
    58595885extends
    58605886Min_SQL{function
    5861 insertUpdate($Q,$J,$ng){foreach($J
    5862 as$N){$Mi=array();$Z=array();foreach($N
    5863 as$y=>$X){$Mi[]="$y = $X";if(isset($ng[idf_unescape($y)]))$Z[]="$y = $X";}if(!queries("MERGE ".table($Q)." USING (VALUES(".implode(", ",$N).")) AS source (c".implode(", c",range(1,count($N))).") ON ".implode(" AND ",$Z)." WHEN MATCHED THEN UPDATE SET ".implode(", ",$Mi)." WHEN NOT MATCHED THEN INSERT (".implode(", ",array_keys($N)).") VALUES (".implode(", ",$N).");"))return
     5887insertUpdate($Q,$J,$pg){foreach($J
     5888as$N){$Oi=array();$Z=array();foreach($N
     5889as$y=>$X){$Oi[]="$y = $X";if(isset($pg[idf_unescape($y)]))$Z[]="$y = $X";}if(!queries("MERGE ".table($Q)." USING (VALUES(".implode(", ",$N).")) AS source (c".implode(", c",range(1,count($N))).") ON ".implode(" AND ",$Z)." WHEN MATCHED THEN UPDATE SET ".implode(", ",$Oi)." WHEN NOT MATCHED THEN INSERT (".implode(", ",array_keys($N)).") VALUES (".implode(", ",$N).");"))return
    58645890false;}return
    58655891true;}function
     
    58695895table($u){return($_GET["ns"]!=""?idf_escape($_GET["ns"]).".":"").idf_escape($u);}function
    58705896connect(){global$b;$h=new
    5871 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2]))return$h;return$h->error;}function
     5897Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2]))return$h;return$h->error;}function
    58725898get_databases(){return
    58735899get_vals("SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')");}function
     
    58875913fk_support($R){return
    58885914true;}function
    5889 fields($Q){$wb=get_key_vals("SELECT objname, cast(value as varchar) FROM fn_listextendedproperty('MS_DESCRIPTION', 'schema', ".q(get_schema()).", 'table', ".q($Q).", 'column', NULL)");$H=array();foreach(get_rows("SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, CAST(d.definition as text) [default]
     5915fields($Q){$xb=get_key_vals("SELECT objname, cast(value as varchar) FROM fn_listextendedproperty('MS_DESCRIPTION', 'schema', ".q(get_schema()).", 'table', ".q($Q).", 'column', NULL)");$H=array();foreach(get_rows("SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, CAST(d.definition as text) [default]
    58905916FROM sys.all_columns c
    58915917JOIN sys.all_objects o ON c.object_id = o.object_id
    58925918JOIN sys.types t ON c.user_type_id = t.user_type_id
    58935919LEFT JOIN sys.default_constraints d ON c.default_object_id = d.parent_column_id
    5894 WHERE o.schema_id = SCHEMA_ID(".q(get_schema()).") AND o.type IN ('S', 'U', 'V') AND o.name = ".q($Q))as$I){$T=$I["type"];$we=(preg_match("~char|binary~",$T)?$I["max_length"]:($T=="decimal"?"$I[precision],$I[scale]":""));$H[$I["name"]]=array("field"=>$I["name"],"full_type"=>$T.($we?"($we)":""),"type"=>$T,"length"=>$we,"default"=>$I["default"],"null"=>$I["is_nullable"],"auto_increment"=>$I["is_identity"],"collation"=>$I["collation_name"],"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),"primary"=>$I["is_identity"],"comment"=>$wb[$I["name"]],);}return$H;}function
     5920WHERE o.schema_id = SCHEMA_ID(".q(get_schema()).") AND o.type IN ('S', 'U', 'V') AND o.name = ".q($Q))as$I){$T=$I["type"];$ye=(preg_match("~char|binary~",$T)?$I["max_length"]:($T=="decimal"?"$I[precision],$I[scale]":""));$H[$I["name"]]=array("field"=>$I["name"],"full_type"=>$T.($ye?"($ye)":""),"type"=>$T,"length"=>$ye,"default"=>$I["default"],"null"=>$I["is_nullable"],"auto_increment"=>$I["is_identity"],"collation"=>$I["collation_name"],"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),"primary"=>$I["is_identity"],"comment"=>$xb[$I["name"]],);}return$H;}function
    58955921indexes($Q,$i=null){$H=array();foreach(get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
    58965922FROM sys.indexes i
     
    59125938true;}function
    59135939auto_increment(){return" IDENTITY".($_POST["Auto_increment"]!=""?"(".number($_POST["Auto_increment"]).",1)":"")." PRIMARY KEY";}function
    5914 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){$c=array();$wb=array();foreach($p
    5915 as$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]);$wb[$o[0]]=$X[5];unset($X[5]);if($o[0]=="")$c["ADD"][]="\n  ".implode("",$X).($Q==""?substr($ed[$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
    5916 queries("CREATE TABLE ".table($B)." (".implode(",",(array)$c["ADD"])."\n)");if($Q!=$B)queries("EXEC sp_rename ".q(table($Q)).", ".q($B));if($ed)$c[""]=$ed;foreach($c
     5940alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){$c=array();$xb=array();foreach($p
     5941as$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]);$xb[$o[0]]=$X[5];unset($X[5]);if($o[0]=="")$c["ADD"][]="\n  ".implode("",$X).($Q==""?substr($gd[$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
     5942queries("CREATE TABLE ".table($B)." (".implode(",",(array)$c["ADD"])."\n)");if($Q!=$B)queries("EXEC sp_rename ".q(table($Q)).", ".q($B));if($gd)$c[""]=$gd;foreach($c
    59175943as$y=>$X){if(!queries("ALTER TABLE ".idf_escape($B)." $y".implode(",",$X)))return
    5918 false;}foreach($wb
     5944false;}foreach($xb
    59195945as$y=>$X){$vb=substr($X,9);queries("EXEC sp_dropextendedproperty @name = N'MS_Description', @level0type = N'Schema', @level0name = ".q(get_schema()).", @level1type = N'Table',  @level1name = ".q($B).", @level2type = N'Column', @level2name = ".q($y));queries("EXEC sp_addextendedproperty @name = N'MS_Description', @value = ".$vb.", @level0type = N'Schema', @level0name = ".q(get_schema()).", @level1type = N'Table',  @level1name = ".q($B).", @level2type = N'Column', @level2name = ".q($y));}return
    59205946true;}function
    5921 alter_indexes($Q,$c){$v=array();$hc=array();foreach($c
    5922 as$X){if($X[2]=="DROP"){if($X[0]=="PRIMARY")$hc[]=idf_escape($X[1]);else$v[]=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
    5923 false;}return(!$v||queries("DROP INDEX ".implode(", ",$v)))&&(!$hc||queries("ALTER TABLE ".table($Q)." DROP ".implode(", ",$hc)));}function
     5947alter_indexes($Q,$c){$v=array();$jc=array();foreach($c
     5948as$X){if($X[2]=="DROP"){if($X[0]=="PRIMARY")$jc[]=idf_escape($X[1]);else$v[]=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
     5949false;}return(!$v||queries("DROP INDEX ".implode(", ",$v)))&&(!$jc||queries("ALTER TABLE ".table($Q)." DROP ".implode(", ",$jc)));}function
    59245950last_id(){global$h;return$h->result("SELECT SCOPE_IDENTITY()");}function
    59255951explain($h,$F){$h->query("SET SHOWPLAN_ALL ON");$H=$h->query($F);$h->query("SET SHOWPLAN_ALL OFF");return$H;}function
     
    59285954truncate_tables($S){return
    59295955apply_queries("TRUNCATE TABLE",$S);}function
    5930 drop_views($dj){return
    5931 queries("DROP VIEW ".implode(", ",array_map('table',$dj)));}function
     5956drop_views($fj){return
     5957queries("DROP VIEW ".implode(", ",array_map('table',$fj)));}function
    59325958drop_tables($S){return
    59335959queries("DROP TABLE ".implode(", ",array_map('table',$S)));}function
    5934 move_tables($S,$dj,$ai){return
    5935 apply_queries("ALTER SCHEMA ".idf_escape($ai)." TRANSFER",array_merge($S,$dj));}function
     5960move_tables($S,$fj,$ci){return
     5961apply_queries("ALTER SCHEMA ".idf_escape($ci)." TRANSFER",array_merge($S,$fj));}function
    59365962trigger($B){if($B=="")return
    59375963array();$J=get_rows("SELECT s.name [Trigger],
     
    59535979get_vals("SELECT name FROM sys.schemas");}function
    59545980get_schema(){global$h;if($_GET["ns"]!="")return$_GET["ns"];return$h->result("SELECT SCHEMA_NAME()");}function
    5955 set_schema($dh){return
     5981set_schema($fh){return
    59565982true;}function
    59575983use_sql($j){return"USE ".idf_escape($j);}function
     
    59625988convert_field($o){}function
    59635989unconvert_field($o,$H){return$H;}function
    5964 support($Rc){return
    5965 preg_match('~^(comment|columns|database|drop_col|indexes|descidx|scheme|sql|table|trigger|view|view_trigger)$~',$Rc);}$x="mssql";$U=array();$Kh=array();foreach(array(lang(27)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(28)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(25)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(29)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}$Li=array();$yf=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$md=array("len","lower","round","upper");$sd=array("avg","count","count distinct","max","min","sum");$oc=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$gc['firebird']='Firebird (alpha)';if(isset($_GET["firebird"])){$kg=array("interbase");define("DRIVER","firebird");if(extension_loaded("interbase")){class
     5990support($Tc){return
     5991preg_match('~^(comment|columns|database|drop_col|indexes|descidx|scheme|sql|table|trigger|view|view_trigger)$~',$Tc);}$x="mssql";$U=array();$Mh=array();foreach(array(lang(27)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(28)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(25)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(29)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}$Ni=array();$_f=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$od=array("len","lower","round","upper");$ud=array("avg","count","count distinct","max","min","sum");$qc=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$ic['firebird']='Firebird (alpha)';if(isset($_GET["firebird"])){$mg=array("interbase");define("DRIVER","firebird");if(extension_loaded("interbase")){class
    59665992Min_DB{var$extension="Firebird",$server_info,$affected_rows,$errno,$error,$_link,$_result;function
    5967 connect($M,$V,$E){$this->_link=ibase_connect($M,$V,$E);if($this->_link){$Pi=explode(':',$M);$this->service_link=ibase_service_attach($Pi[0],$V,$E);$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
     5993connect($M,$V,$E){$this->_link=ibase_connect($M,$V,$E);if($this->_link){$Ri=explode(':',$M);$this->service_link=ibase_service_attach($Ri[0],$V,$E);$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
    59685994quote($P){return"'".str_replace("'","''",$P)."'";}function
    59695995select_db($j){return($j=="domain");}function
    5970 query($F,$Fi=false){$G=ibase_query($F,$this->_link);if(!$G){$this->errno=ibase_errcode();$this->error=ibase_errmsg();return
     5996query($F,$Hi=false){$G=ibase_query($F,$this->_link);if(!$G){$this->errno=ibase_errcode();$this->error=ibase_errmsg();return
    59715997false;}$this->error="";if($G===true){$this->affected_rows=ibase_affected_rows($this->_link);return
    59725998true;}return
     
    59946020idf_escape($u);}function
    59956021connect(){global$b;$h=new
    5996 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2]))return$h;return$h->error;}function
    5997 get_databases($cd){return
     6022Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2]))return$h;return$h->error;}function
     6023get_databases($ed){return
    59986024array("domain");}function
    59996025limit($F,$Z,$z,$C=0,$L=" "){$H='';$H.=($z!==null?$L."FIRST $z".($C?" SKIP $C":""):"");$H.=" $F$Z";return$H;}function
     
    60036029engines(){return
    60046030array();}function
    6005 logged_user(){global$b;$Jb=$b->credentials();return$Jb[1];}function
     6031logged_user(){global$b;$Kb=$b->credentials();return$Kb[1];}function
    60066032tables_list(){global$h;$F='SELECT RDB$RELATION_NAME FROM rdb$relations WHERE rdb$system_flag = 0';$G=ibase_query($h->_link,$F);$H=array();while($I=ibase_fetch_assoc($G))$H[$I['RDB$RELATION_NAME']]='table';ksort($H);return$H;}function
    60076033count_tables($k){return
    60086034array();}function
    6009 table_status($B="",$Qc=false){global$h;$H=array();$Ob=tables_list();foreach($Ob
     6035table_status($B="",$Sc=false){global$h;$H=array();$Pb=tables_list();foreach($Pb
    60106036as$v=>$X){$v=trim($v);$H[$v]=array('Name'=>$v,'Engine'=>'standard',);if($B==$v)return$H[$v];}return$H;}function
    60116037is_view($R){return
     
    60606086array();}function
    60616087get_schema(){return"";}function
    6062 set_schema($dh){return
     6088set_schema($fh){return
    60636089true;}function
    6064 support($Rc){return
    6065 preg_match("~^(columns|sql|status|table)$~",$Rc);}$x="firebird";$yf=array("=");$md=array();$sd=array();$oc=array();}$gc["simpledb"]="SimpleDB";if(isset($_GET["simpledb"])){$kg=array("SimpleXML + allow_url_fopen");define("DRIVER","simpledb");if(class_exists('SimpleXMLElement')&&ini_bool('allow_url_fopen')){class
     6090support($Tc){return
     6091preg_match("~^(columns|sql|status|table)$~",$Tc);}$x="firebird";$_f=array("=");$od=array();$ud=array();$qc=array();}$ic["simpledb"]="SimpleDB";if(isset($_GET["simpledb"])){$mg=array("SimpleXML + allow_url_fopen");define("DRIVER","simpledb");if(class_exists('SimpleXMLElement')&&ini_bool('allow_url_fopen')){class
    60666092Min_DB{var$extension="SimpleXML",$server_info='2009-04-15',$error,$timeout,$next,$affected_rows,$_result;function
    60676093select_db($j){return($j=="domain");}function
    6068 query($F,$Fi=false){$Rf=array('SelectExpression'=>$F,'ConsistentRead'=>'true');if($this->next)$Rf['NextToken']=$this->next;$G=sdb_request_all('Select','Item',$Rf,$this->timeout);$this->timeout=0;if($G===false)return$G;if(preg_match('~^\s*SELECT\s+COUNT\(~i',$F)){$Oh=0;foreach($G
    6069 as$de)$Oh+=$de->Attribute->Value;$G=array((object)array('Attribute'=>array((object)array('Name'=>'Count','Value'=>$Oh,))));}return
     6094query($F,$Hi=false){$Tf=array('SelectExpression'=>$F,'ConsistentRead'=>'true');if($this->next)$Tf['NextToken']=$this->next;$G=sdb_request_all('Select','Item',$Tf,$this->timeout);$this->timeout=0;if($G===false)return$G;if(preg_match('~^\s*SELECT\s+COUNT\(~i',$F)){$Qh=0;foreach($G
     6095as$fe)$Qh+=$fe->Attribute->Value;$G=array((object)array('Attribute'=>array((object)array('Name'=>'Count','Value'=>$Qh,))));}return
    60706096new
    60716097Min_Result($G);}function
     
    60776103Min_Result{var$num_rows,$_rows=array(),$_offset=0;function
    60786104__construct($G){foreach($G
    6079 as$de){$I=array();if($de->Name!='')$I['itemName()']=(string)$de->Name;foreach($de->Attribute
     6105as$fe){$I=array();if($fe->Name!='')$I['itemName()']=(string)$fe->Name;foreach($fe->Attribute
    60806106as$Ja){$B=$this->_processValue($Ja->Name);$Y=$this->_processValue($Ja->Value);if(isset($I[$B])){$I[$B]=(array)$I[$B];$I[$B][]=$Y;}else$I[$B]=$Y;}$this->_rows[]=$I;foreach($I
    60816107as$y=>$X){if(!isset($this->_rows[0][$y]))$this->_rows[0][$y]=null;}}$this->num_rows=count($this->_rows);}function
    6082 _processValue($rc){return(is_object($rc)&&$rc['encoding']=='base64'?base64_decode($rc):(string)$rc);}function
     6108_processValue($tc){return(is_object($tc)&&$tc['encoding']=='base64'?base64_decode($tc):(string)$tc);}function
    60836109fetch_assoc(){$I=current($this->_rows);if(!$I)return$I;$H=array();foreach($this->_rows[0]as$y=>$X)$H[$y]=$I[$y];next($this->_rows);return$H;}function
    60846110fetch_row(){$H=$this->fetch_assoc();if(!$H)return$H;return
    60856111array_values($H);}function
    6086 fetch_field(){$je=array_keys($this->_rows[0]);return(object)array('name'=>$je[$this->_offset++]);}}}class
     6112fetch_field(){$le=array_keys($this->_rows[0]);return(object)array('name'=>$le[$this->_offset++]);}}}class
    60876113Min_Driver
    60886114extends
    6089 Min_SQL{public$ng="itemName()";function
    6090 _chunkRequest($Gd,$wa,$Rf,$Gc=array()){global$h;foreach(array_chunk($Gd,25)as$jb){$Sf=$Rf;foreach($jb
    6091 as$s=>$t){$Sf["Item.$s.ItemName"]=$t;foreach($Gc
    6092 as$y=>$X)$Sf["Item.$s.$y"]=$X;}if(!sdb_request($wa,$Sf))return
    6093 false;}$h->affected_rows=count($Gd);return
     6115Min_SQL{public$pg="itemName()";function
     6116_chunkRequest($Id,$wa,$Tf,$Ic=array()){global$h;foreach(array_chunk($Id,25)as$jb){$Uf=$Tf;foreach($jb
     6117as$s=>$t){$Uf["Item.$s.ItemName"]=$t;foreach($Ic
     6118as$y=>$X)$Uf["Item.$s.$y"]=$X;}if(!sdb_request($wa,$Uf))return
     6119false;}$h->affected_rows=count($Id);return
    60946120true;}function
    6095 _extractIds($Q,$zg,$z){$H=array();if(preg_match_all("~itemName\(\) = (('[^']*+')+)~",$zg,$Ge))$H=array_map('idf_unescape',$Ge[1]);else{foreach(sdb_request_all('Select','Item',array('SelectExpression'=>'SELECT itemName() FROM '.table($Q).$zg.($z?" LIMIT 1":"")))as$de)$H[]=$de->Name;}return$H;}function
    6096 select($Q,$K,$Z,$pd,$Cf=array(),$z=1,$D=0,$pg=false){global$h;$h->next=$_GET["next"];$H=parent::select($Q,$K,$Z,$pd,$Cf,$z,$D,$pg);$h->next=0;return$H;}function
    6097 delete($Q,$zg,$z=0){return$this->_chunkRequest($this->_extractIds($Q,$zg,$z),'BatchDeleteAttributes',array('DomainName'=>$Q));}function
    6098 update($Q,$N,$zg,$z=0,$L="\n"){$Xb=array();$Vd=array();$s=0;$Gd=$this->_extractIds($Q,$zg,$z);$t=idf_unescape($N["`itemName()`"]);unset($N["`itemName()`"]);foreach($N
    6099 as$y=>$X){$y=idf_unescape($y);if($X=="NULL"||($t!=""&&array($t)!=$Gd))$Xb["Attribute.".count($Xb).".Name"]=$y;if($X!="NULL"){foreach((array)$X
    6100 as$fe=>$W){$Vd["Attribute.$s.Name"]=$y;$Vd["Attribute.$s.Value"]=(is_array($X)?$W:idf_unescape($W));if(!$fe)$Vd["Attribute.$s.Replace"]="true";$s++;}}}$Rf=array('DomainName'=>$Q);return(!$Vd||$this->_chunkRequest(($t!=""?array($t):$Gd),'BatchPutAttributes',$Rf,$Vd))&&(!$Xb||$this->_chunkRequest($Gd,'BatchDeleteAttributes',$Rf,$Xb));}function
    6101 insert($Q,$N){$Rf=array("DomainName"=>$Q);$s=0;foreach($N
    6102 as$B=>$Y){if($Y!="NULL"){$B=idf_unescape($B);if($B=="itemName()")$Rf["ItemName"]=idf_unescape($Y);else{foreach((array)$Y
    6103 as$X){$Rf["Attribute.$s.Name"]=$B;$Rf["Attribute.$s.Value"]=(is_array($Y)?$X:idf_unescape($Y));$s++;}}}}return
    6104 sdb_request('PutAttributes',$Rf);}function
    6105 insertUpdate($Q,$J,$ng){foreach($J
     6121_extractIds($Q,$Ag,$z){$H=array();if(preg_match_all("~itemName\(\) = (('[^']*+')+)~",$Ag,$Ie))$H=array_map('idf_unescape',$Ie[1]);else{foreach(sdb_request_all('Select','Item',array('SelectExpression'=>'SELECT itemName() FROM '.table($Q).$Ag.($z?" LIMIT 1":"")))as$fe)$H[]=$fe->Name;}return$H;}function
     6122select($Q,$K,$Z,$rd,$Ef=array(),$z=1,$D=0,$rg=false){global$h;$h->next=$_GET["next"];$H=parent::select($Q,$K,$Z,$rd,$Ef,$z,$D,$rg);$h->next=0;return$H;}function
     6123delete($Q,$Ag,$z=0){return$this->_chunkRequest($this->_extractIds($Q,$Ag,$z),'BatchDeleteAttributes',array('DomainName'=>$Q));}function
     6124update($Q,$N,$Ag,$z=0,$L="\n"){$Zb=array();$Xd=array();$s=0;$Id=$this->_extractIds($Q,$Ag,$z);$t=idf_unescape($N["`itemName()`"]);unset($N["`itemName()`"]);foreach($N
     6125as$y=>$X){$y=idf_unescape($y);if($X=="NULL"||($t!=""&&array($t)!=$Id))$Zb["Attribute.".count($Zb).".Name"]=$y;if($X!="NULL"){foreach((array)$X
     6126as$he=>$W){$Xd["Attribute.$s.Name"]=$y;$Xd["Attribute.$s.Value"]=(is_array($X)?$W:idf_unescape($W));if(!$he)$Xd["Attribute.$s.Replace"]="true";$s++;}}}$Tf=array('DomainName'=>$Q);return(!$Xd||$this->_chunkRequest(($t!=""?array($t):$Id),'BatchPutAttributes',$Tf,$Xd))&&(!$Zb||$this->_chunkRequest($Id,'BatchDeleteAttributes',$Tf,$Zb));}function
     6127insert($Q,$N){$Tf=array("DomainName"=>$Q);$s=0;foreach($N
     6128as$B=>$Y){if($Y!="NULL"){$B=idf_unescape($B);if($B=="itemName()")$Tf["ItemName"]=idf_unescape($Y);else{foreach((array)$Y
     6129as$X){$Tf["Attribute.$s.Name"]=$B;$Tf["Attribute.$s.Value"]=(is_array($Y)?$X:idf_unescape($Y));$s++;}}}}return
     6130sdb_request('PutAttributes',$Tf);}function
     6131insertUpdate($Q,$J,$pg){foreach($J
    61066132as$N){if(!$this->update($Q,$N,"WHERE `itemName()` = ".q($N["`itemName()`"])))return
    61076133false;}return
     
    61136139rollback(){return
    61146140false;}function
    6115 slowQuery($F,$ii){$this->_conn->timeout=$ii;return$F;}}function
     6141slowQuery($F,$ki){$this->_conn->timeout=$ki;return$F;}}function
    61166142connect(){global$b;list(,,$E)=$b->credentials();if($E!="")return
    61176143lang(22);return
    61186144new
    61196145Min_DB;}function
    6120 support($Rc){return
    6121 preg_match('~sql~',$Rc);}function
    6122 logged_user(){global$b;$Jb=$b->credentials();return$Jb[1];}function
     6146support($Tc){return
     6147preg_match('~sql~',$Tc);}function
     6148logged_user(){global$b;$Kb=$b->credentials();return$Kb[1];}function
    61236149get_databases(){return
    61246150array("domain");}function
     
    61276153db_collation($l,$qb){}function
    61286154tables_list(){global$h;$H=array();foreach(sdb_request_all('ListDomains','DomainName')as$Q)$H[(string)$Q]='table';if($h->error&&defined("PAGE_HEADER"))echo"<p class='error'>".error()."\n";return$H;}function
    6129 table_status($B="",$Qc=false){$H=array();foreach(($B!=""?array($B=>true):tables_list())as$Q=>$T){$I=array("Name"=>$Q,"Auto_increment"=>"");if(!$Qc){$Te=sdb_request('DomainMetadata',array('DomainName'=>$Q));if($Te){foreach(array("Rows"=>"ItemCount","Data_length"=>"ItemNamesSizeBytes","Index_length"=>"AttributeValuesSizeBytes","Data_free"=>"AttributeNamesSizeBytes",)as$y=>$X)$I[$y]=(string)$Te->$X;}}if($B!="")return$I;$H[$Q]=$I;}return$H;}function
     6155table_status($B="",$Sc=false){$H=array();foreach(($B!=""?array($B=>true):tables_list())as$Q=>$T){$I=array("Name"=>$Q,"Auto_increment"=>"");if(!$Sc){$Ve=sdb_request('DomainMetadata',array('DomainName'=>$Q));if($Ve){foreach(array("Rows"=>"ItemCount","Data_length"=>"ItemNamesSizeBytes","Index_length"=>"AttributeValuesSizeBytes","Data_free"=>"AttributeNamesSizeBytes",)as$y=>$X)$I[$y]=(string)$Ve->$X;}}if($B!="")return$I;$H[$Q]=$I;}return$H;}function
    61306156explain($h,$F){}function
    61316157error(){global$h;return
     
    61476173engines(){return
    61486174array();}function
    6149 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){return($Q==""&&sdb_request('CreateDomain',array('DomainName'=>$B)));}function
     6175alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){return($Q==""&&sdb_request('CreateDomain',array('DomainName'=>$B)));}function
    61506176drop_tables($S){foreach($S
    61516177as$Q){if(!sdb_request('DeleteDomain',array('DomainName'=>$Q)))return
     
    61576183found_rows($R,$Z){return($Z?null:$R["Rows"]);}function
    61586184last_id(){}function
    6159 hmac($Ca,$Ob,$y,$Cg=false){$Wa=64;if(strlen($y)>$Wa)$y=pack("H*",$Ca($y));$y=str_pad($y,$Wa,"\0");$ge=$y^str_repeat("\x36",$Wa);$he=$y^str_repeat("\x5C",$Wa);$H=$Ca($he.pack("H*",$Ca($ge.$Ob)));if($Cg)$H=pack("H*",$H);return$H;}function
    6160 sdb_request($wa,$Rf=array()){global$b,$h;list($Cd,$Rf['AWSAccessKeyId'],$gh)=$b->credentials();$Rf['Action']=$wa;$Rf['Timestamp']=gmdate('Y-m-d\TH:i:s+00:00');$Rf['Version']='2009-04-15';$Rf['SignatureVersion']=2;$Rf['SignatureMethod']='HmacSHA1';ksort($Rf);$F='';foreach($Rf
    6161 as$y=>$X)$F.='&'.rawurlencode($y).'='.rawurlencode($X);$F=str_replace('%7E','~',substr($F,1));$F.="&Signature=".urlencode(base64_encode(hmac('sha1',"POST\n".preg_replace('~^https?://~','',$Cd)."\n/\n$F",$gh,true)));@ini_set('track_errors',1);$Vc=@file_get_contents((preg_match('~^https?://~',$Cd)?$Cd:"http://$Cd"),false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$F,'ignore_errors'=>1,))));if(!$Vc){$h->error=$php_errormsg;return
    6162 false;}libxml_use_internal_errors(true);$qj=simplexml_load_string($Vc);if(!$qj){$n=libxml_get_last_error();$h->error=$n->message;return
    6163 false;}if($qj->Errors){$n=$qj->Errors->Error;$h->error="$n->Message ($n->Code)";return
    6164 false;}$h->error='';$Zh=$wa."Result";return($qj->$Zh?$qj->$Zh:true);}function
    6165 sdb_request_all($wa,$Zh,$Rf=array(),$ii=0){$H=array();$Gh=($ii?microtime(true):0);$z=(preg_match('~LIMIT\s+(\d+)\s*$~i',$Rf['SelectExpression'],$A)?$A[1]:0);do{$qj=sdb_request($wa,$Rf);if(!$qj)break;foreach($qj->$Zh
    6166 as$rc)$H[]=$rc;if($z&&count($H)>=$z){$_GET["next"]=$qj->NextToken;break;}if($ii&&microtime(true)-$Gh>$ii)return
    6167 false;$Rf['NextToken']=$qj->NextToken;if($z)$Rf['SelectExpression']=preg_replace('~\d+\s*$~',$z-count($H),$Rf['SelectExpression']);}while($qj->NextToken);return$H;}$x="simpledb";$yf=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","IS NOT NULL");$md=array();$sd=array("count");$oc=array(array("json"));}$gc["mongo"]="MongoDB";if(isset($_GET["mongo"])){$kg=array("mongo","mongodb");define("DRIVER","mongo");if(class_exists('MongoDB')){class
     6185hmac($Ca,$Pb,$y,$Eg=false){$Wa=64;if(strlen($y)>$Wa)$y=pack("H*",$Ca($y));$y=str_pad($y,$Wa,"\0");$ie=$y^str_repeat("\x36",$Wa);$je=$y^str_repeat("\x5C",$Wa);$H=$Ca($je.pack("H*",$Ca($ie.$Pb)));if($Eg)$H=pack("H*",$H);return$H;}function
     6186sdb_request($wa,$Tf=array()){global$b,$h;list($Ed,$Tf['AWSAccessKeyId'],$ih)=$b->credentials();$Tf['Action']=$wa;$Tf['Timestamp']=gmdate('Y-m-d\TH:i:s+00:00');$Tf['Version']='2009-04-15';$Tf['SignatureVersion']=2;$Tf['SignatureMethod']='HmacSHA1';ksort($Tf);$F='';foreach($Tf
     6187as$y=>$X)$F.='&'.rawurlencode($y).'='.rawurlencode($X);$F=str_replace('%7E','~',substr($F,1));$F.="&Signature=".urlencode(base64_encode(hmac('sha1',"POST\n".preg_replace('~^https?://~','',$Ed)."\n/\n$F",$ih,true)));@ini_set('track_errors',1);$Xc=@file_get_contents((preg_match('~^https?://~',$Ed)?$Ed:"http://$Ed"),false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$F,'ignore_errors'=>1,))));if(!$Xc){$h->error=$php_errormsg;return
     6188false;}libxml_use_internal_errors(true);$sj=simplexml_load_string($Xc);if(!$sj){$n=libxml_get_last_error();$h->error=$n->message;return
     6189false;}if($sj->Errors){$n=$sj->Errors->Error;$h->error="$n->Message ($n->Code)";return
     6190false;}$h->error='';$bi=$wa."Result";return($sj->$bi?$sj->$bi:true);}function
     6191sdb_request_all($wa,$bi,$Tf=array(),$ki=0){$H=array();$Ih=($ki?microtime(true):0);$z=(preg_match('~LIMIT\s+(\d+)\s*$~i',$Tf['SelectExpression'],$A)?$A[1]:0);do{$sj=sdb_request($wa,$Tf);if(!$sj)break;foreach($sj->$bi
     6192as$tc)$H[]=$tc;if($z&&count($H)>=$z){$_GET["next"]=$sj->NextToken;break;}if($ki&&microtime(true)-$Ih>$ki)return
     6193false;$Tf['NextToken']=$sj->NextToken;if($z)$Tf['SelectExpression']=preg_replace('~\d+\s*$~',$z-count($H),$Tf['SelectExpression']);}while($sj->NextToken);return$H;}$x="simpledb";$_f=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","IS NOT NULL");$od=array();$ud=array("count");$qc=array(array("json"));}$ic["mongo"]="MongoDB";if(isset($_GET["mongo"])){$mg=array("mongo","mongodb");define("DRIVER","mongo");if(class_exists('MongoDB')){class
    61686194Min_DB{var$extension="Mongo",$server_info=MongoClient::VERSION,$error,$last_id,$_link,$_db;function
    6169 connect($Ni,$Af){return@new
    6170 MongoClient($Ni,$Af);}function
     6195connect($Pi,$Cf){return@new
     6196MongoClient($Pi,$Cf);}function
    61716197query($F){return
    61726198false;}function
    61736199select_db($j){try{$this->_db=$this->_link->selectDB($j);return
    6174 true;}catch(Exception$Cc){$this->error=$Cc->getMessage();return
     6200true;}catch(Exception$Ec){$this->error=$Ec->getMessage();return
    61756201false;}}function
    61766202quote($P){return$P;}}class
    61776203Min_Result{var$num_rows,$_rows=array(),$_offset=0,$_charset=array();function
    61786204__construct($G){foreach($G
    6179 as$de){$I=array();foreach($de
     6205as$fe){$I=array();foreach($fe
    61806206as$y=>$X){if(is_a($X,'MongoBinData'))$this->_charset[$y]=63;$I[$y]=(is_a($X,'MongoId')?'ObjectId("'.strval($X).'")':(is_a($X,'MongoDate')?gmdate("Y-m-d H:i:s",$X->sec)." GMT":(is_a($X,'MongoBinData')?$X->bin:(is_a($X,'MongoRegex')?strval($X):(is_object($X)?get_class($X):$X)))));}$this->_rows[]=$I;foreach($I
    61816207as$y=>$X){if(!isset($this->_rows[0][$y]))$this->_rows[0][$y]=null;}}$this->num_rows=count($this->_rows);}function
     
    61836209fetch_row(){$H=$this->fetch_assoc();if(!$H)return$H;return
    61846210array_values($H);}function
    6185 fetch_field(){$je=array_keys($this->_rows[0]);$B=$je[$this->_offset++];return(object)array('name'=>$B,'charsetnr'=>$this->_charset[$B],);}}class
     6211fetch_field(){$le=array_keys($this->_rows[0]);$B=$le[$this->_offset++];return(object)array('name'=>$B,'charsetnr'=>$this->_charset[$B],);}}class
    61866212Min_Driver
    61876213extends
    6188 Min_SQL{public$ng="_id";function
    6189 select($Q,$K,$Z,$pd,$Cf=array(),$z=1,$D=0,$pg=false){$K=($K==array("*")?array():array_fill_keys($K,true));$yh=array();foreach($Cf
    6190 as$X){$X=preg_replace('~ DESC$~','',$X,1,$Fb);$yh[$X]=($Fb?-1:1);}return
     6214Min_SQL{public$pg="_id";function
     6215select($Q,$K,$Z,$rd,$Ef=array(),$z=1,$D=0,$rg=false){$K=($K==array("*")?array():array_fill_keys($K,true));$_h=array();foreach($Ef
     6216as$X){$X=preg_replace('~ DESC$~','',$X,1,$Gb);$_h[$X]=($Gb?-1:1);}return
    61916217new
    6192 Min_Result($this->_conn->_db->selectCollection($Q)->find(array(),$K)->sort($yh)->limit($z!=""?+$z:0)->skip($D*$z));}function
    6193 insert($Q,$N){try{$H=$this->_conn->_db->selectCollection($Q)->insert($N);$this->_conn->errno=$H['code'];$this->_conn->error=$H['err'];$this->_conn->last_id=$N['_id'];return!$H['err'];}catch(Exception$Cc){$this->_conn->error=$Cc->getMessage();return
     6218Min_Result($this->_conn->_db->selectCollection($Q)->find(array(),$K)->sort($_h)->limit($z!=""?+$z:0)->skip($D*$z));}function
     6219insert($Q,$N){try{$H=$this->_conn->_db->selectCollection($Q)->insert($N);$this->_conn->errno=$H['code'];$this->_conn->error=$H['err'];$this->_conn->last_id=$N['_id'];return!$H['err'];}catch(Exception$Ec){$this->_conn->error=$Ec->getMessage();return
    61946220false;}}}function
    6195 get_databases($cd){global$h;$H=array();$Tb=$h->_link->listDBs();foreach($Tb['databases']as$l)$H[]=$l['name'];return$H;}function
     6221get_databases($ed){global$h;$H=array();$Ub=$h->_link->listDBs();foreach($Ub['databases']as$l)$H[]=$l['name'];return$H;}function
    61966222count_tables($k){global$h;$H=array();foreach($k
    61976223as$l)$H[$l]=count($h->_link->selectDB($l)->getCollectionNames(true));return$H;}function
     
    61996225array_fill_keys($h->_db->getCollectionNames(true),'table');}function
    62006226drop_databases($k){global$h;foreach($k
    6201 as$l){$Pg=$h->_link->selectDB($l)->drop();if(!$Pg['ok'])return
     6227as$l){$Rg=$h->_link->selectDB($l)->drop();if(!$Rg['ok'])return
    62026228false;}return
    62036229true;}function
    6204 indexes($Q,$i=null){global$h;$H=array();foreach($h->_db->selectCollection($Q)->getIndexInfo()as$v){$ac=array();foreach($v["key"]as$e=>$T)$ac[]=($T==-1?'1':null);$H[$v["name"]]=array("type"=>($v["name"]=="_id_"?"PRIMARY":($v["unique"]?"UNIQUE":"INDEX")),"columns"=>array_keys($v["key"]),"lengths"=>array(),"descs"=>$ac,);}return$H;}function
     6230indexes($Q,$i=null){global$h;$H=array();foreach($h->_db->selectCollection($Q)->getIndexInfo()as$v){$cc=array();foreach($v["key"]as$e=>$T)$cc[]=($T==-1?'1':null);$H[$v["name"]]=array("type"=>($v["name"]=="_id_"?"PRIMARY":($v["unique"]?"UNIQUE":"INDEX")),"columns"=>array_keys($v["key"]),"lengths"=>array(),"descs"=>$cc,);}return$H;}function
    62056231fields($Q){return
    62066232fields_from_edit();}function
    6207 found_rows($R,$Z){global$h;return$h->_db->selectCollection($_GET["select"])->count($Z);}$yf=array("=");}elseif(class_exists('MongoDB\Driver\Manager')){class
     6233found_rows($R,$Z){global$h;return$h->_db->selectCollection($_GET["select"])->count($Z);}$_f=array("=");}elseif(class_exists('MongoDB\Driver\Manager')){class
    62086234Min_DB{var$extension="MongoDB",$server_info=MONGODB_VERSION,$error,$last_id;var$_link;var$_db,$_db_name;function
    6209 connect($Ni,$Af){$lb='MongoDB\Driver\Manager';return
    6210 new$lb($Ni,$Af);}function
     6235connect($Pi,$Cf){$lb='MongoDB\Driver\Manager';return
     6236new$lb($Pi,$Cf);}function
    62116237query($F){return
    62126238false;}function
     
    62166242Min_Result{var$num_rows,$_rows=array(),$_offset=0,$_charset=array();function
    62176243__construct($G){foreach($G
    6218 as$de){$I=array();foreach($de
     6244as$fe){$I=array();foreach($fe
    62196245as$y=>$X){if(is_a($X,'MongoDB\BSON\Binary'))$this->_charset[$y]=63;$I[$y]=(is_a($X,'MongoDB\BSON\ObjectID')?'MongoDB\BSON\ObjectID("'.strval($X).'")':(is_a($X,'MongoDB\BSON\UTCDatetime')?$X->toDateTime()->format('Y-m-d H:i:s'):(is_a($X,'MongoDB\BSON\Binary')?$X->bin:(is_a($X,'MongoDB\BSON\Regex')?strval($X):(is_object($X)?json_encode($X,256):$X)))));}$this->_rows[]=$I;foreach($I
    62206246as$y=>$X){if(!isset($this->_rows[0][$y]))$this->_rows[0][$y]=null;}}$this->num_rows=$G->count;}function
     
    62226248fetch_row(){$H=$this->fetch_assoc();if(!$H)return$H;return
    62236249array_values($H);}function
    6224 fetch_field(){$je=array_keys($this->_rows[0]);$B=$je[$this->_offset++];return(object)array('name'=>$B,'charsetnr'=>$this->_charset[$B],);}}class
     6250fetch_field(){$le=array_keys($this->_rows[0]);$B=$le[$this->_offset++];return(object)array('name'=>$B,'charsetnr'=>$this->_charset[$B],);}}class
    62256251Min_Driver
    62266252extends
    6227 Min_SQL{public$ng="_id";function
    6228 select($Q,$K,$Z,$pd,$Cf=array(),$z=1,$D=0,$pg=false){global$h;$K=($K==array("*")?array():array_fill_keys($K,1));if(count($K)&&!isset($K['_id']))$K['_id']=0;$Z=where_to_query($Z);$yh=array();foreach($Cf
    6229 as$X){$X=preg_replace('~ DESC$~','',$X,1,$Fb);$yh[$X]=($Fb?-1:1);}if(isset($_GET['limit'])&&is_numeric($_GET['limit'])&&$_GET['limit']>0)$z=$_GET['limit'];$z=min(200,max(1,(int)$z));$vh=$D*$z;$lb='MongoDB\Driver\Query';$F=new$lb($Z,array('projection'=>$K,'limit'=>$z,'skip'=>$vh,'sort'=>$yh));$Sg=$h->_link->executeQuery("$h->_db_name.$Q",$F);return
     6253Min_SQL{public$pg="_id";function
     6254select($Q,$K,$Z,$rd,$Ef=array(),$z=1,$D=0,$rg=false){global$h;$K=($K==array("*")?array():array_fill_keys($K,1));if(count($K)&&!isset($K['_id']))$K['_id']=0;$Z=where_to_query($Z);$_h=array();foreach($Ef
     6255as$X){$X=preg_replace('~ DESC$~','',$X,1,$Gb);$_h[$X]=($Gb?-1:1);}if(isset($_GET['limit'])&&is_numeric($_GET['limit'])&&$_GET['limit']>0)$z=$_GET['limit'];$z=min(200,max(1,(int)$z));$xh=$D*$z;$lb='MongoDB\Driver\Query';$F=new$lb($Z,array('projection'=>$K,'limit'=>$z,'skip'=>$xh,'sort'=>$_h));$Ug=$h->_link->executeQuery("$h->_db_name.$Q",$F);return
    62306256new
    6231 Min_Result($Sg);}function
    6232 update($Q,$N,$zg,$z=0,$L="\n"){global$h;$l=$h->_db_name;$Z=sql_query_where_parser($zg);$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());if(isset($N['_id']))unset($N['_id']);$Mg=array();foreach($N
    6233 as$y=>$Y){if($Y=='NULL'){$Mg[$y]=1;unset($N[$y]);}}$Mi=array('$set'=>$N);if(count($Mg))$Mi['$unset']=$Mg;$ab->update($Z,$Mi,array('upsert'=>false));$Sg=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Sg->getModifiedCount();return
     6257Min_Result($Ug);}function
     6258update($Q,$N,$Ag,$z=0,$L="\n"){global$h;$l=$h->_db_name;$Z=sql_query_where_parser($Ag);$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());if(isset($N['_id']))unset($N['_id']);$Og=array();foreach($N
     6259as$y=>$Y){if($Y=='NULL'){$Og[$y]=1;unset($N[$y]);}}$Oi=array('$set'=>$N);if(count($Og))$Oi['$unset']=$Og;$ab->update($Z,$Oi,array('upsert'=>false));$Ug=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Ug->getModifiedCount();return
    62346260true;}function
    6235 delete($Q,$zg,$z=0){global$h;$l=$h->_db_name;$Z=sql_query_where_parser($zg);$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());$ab->delete($Z,array('limit'=>$z));$Sg=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Sg->getDeletedCount();return
     6261delete($Q,$Ag,$z=0){global$h;$l=$h->_db_name;$Z=sql_query_where_parser($Ag);$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());$ab->delete($Z,array('limit'=>$z));$Ug=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Ug->getDeletedCount();return
    62366262true;}function
    6237 insert($Q,$N){global$h;$l=$h->_db_name;$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());if(isset($N['_id'])&&empty($N['_id']))unset($N['_id']);$ab->insert($N);$Sg=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Sg->getInsertedCount();return
     6263insert($Q,$N){global$h;$l=$h->_db_name;$lb='MongoDB\Driver\BulkWrite';$ab=new$lb(array());if(isset($N['_id'])&&empty($N['_id']))unset($N['_id']);$ab->insert($N);$Ug=$h->_link->executeBulkWrite("$l.$Q",$ab);$h->affected_rows=$Ug->getInsertedCount();return
    62386264true;}}function
    6239 get_databases($cd){global$h;$H=array();$lb='MongoDB\Driver\Command';$tb=new$lb(array('listDatabases'=>1));$Sg=$h->_link->executeCommand('admin',$tb);foreach($Sg
    6240 as$Tb){foreach($Tb->databases
     6265get_databases($ed){global$h;$H=array();$lb='MongoDB\Driver\Command';$tb=new$lb(array('listDatabases'=>1));$Ug=$h->_link->executeCommand('admin',$tb);foreach($Ug
     6266as$Ub){foreach($Ub->databases
    62416267as$l)$H[]=$l->name;}return$H;}function
    62426268count_tables($k){$H=array();return$H;}function
    6243 tables_list(){global$h;$lb='MongoDB\Driver\Command';$tb=new$lb(array('listCollections'=>1));$Sg=$h->_link->executeCommand($h->_db_name,$tb);$rb=array();foreach($Sg
     6269tables_list(){global$h;$lb='MongoDB\Driver\Command';$tb=new$lb(array('listCollections'=>1));$Ug=$h->_link->executeCommand($h->_db_name,$tb);$rb=array();foreach($Ug
    62446270as$G)$rb[$G->name]='table';return$rb;}function
    62456271drop_databases($k){return
    62466272false;}function
    6247 indexes($Q,$i=null){global$h;$H=array();$lb='MongoDB\Driver\Command';$tb=new$lb(array('listIndexes'=>$Q));$Sg=$h->_link->executeCommand($h->_db_name,$tb);foreach($Sg
    6248 as$v){$ac=array();$f=array();foreach(get_object_vars($v->key)as$e=>$T){$ac[]=($T==-1?'1':null);$f[]=$e;}$H[$v->name]=array("type"=>($v->name=="_id_"?"PRIMARY":(isset($v->unique)?"UNIQUE":"INDEX")),"columns"=>$f,"lengths"=>array(),"descs"=>$ac,);}return$H;}function
     6273indexes($Q,$i=null){global$h;$H=array();$lb='MongoDB\Driver\Command';$tb=new$lb(array('listIndexes'=>$Q));$Ug=$h->_link->executeCommand($h->_db_name,$tb);foreach($Ug
     6274as$v){$cc=array();$f=array();foreach(get_object_vars($v->key)as$e=>$T){$cc[]=($T==-1?'1':null);$f[]=$e;}$H[$v->name]=array("type"=>($v->name=="_id_"?"PRIMARY":(isset($v->unique)?"UNIQUE":"INDEX")),"columns"=>$f,"lengths"=>array(),"descs"=>$cc,);}return$H;}function
    62496275fields($Q){$p=fields_from_edit();if(!count($p)){global$m;$G=$m->select($Q,array("*"),null,null,array(),10);while($I=$G->fetch_assoc()){foreach($I
    62506276as$y=>$X){$I[$y]=null;$p[$y]=array("field"=>$y,"type"=>"string","null"=>($y!=$m->primary),"auto_increment"=>($y==$m->primary),"privileges"=>array("insert"=>1,"select"=>1,"update"=>1,),);}}}return$p;}function
    6251 found_rows($R,$Z){global$h;$Z=where_to_query($Z);$lb='MongoDB\Driver\Command';$tb=new$lb(array('count'=>$R['Name'],'query'=>$Z));$Sg=$h->_link->executeCommand($h->_db_name,$tb);$qi=$Sg->toArray();return$qi[0]->n;}function
    6252 sql_query_where_parser($zg){$zg=trim(preg_replace('/WHERE[\s]?[(]?\(?/','',$zg));$zg=preg_replace('/\)\)\)$/',')',$zg);$nj=explode(' AND ',$zg);$oj=explode(') OR (',$zg);$Z=array();foreach($nj
    6253 as$lj)$Z[]=trim($lj);if(count($oj)==1)$oj=array();elseif(count($oj)>1)$Z=array();return
    6254 where_to_query($Z,$oj);}function
    6255 where_to_query($jj=array(),$kj=array()){global$b;$Ob=array();foreach(array('and'=>$jj,'or'=>$kj)as$T=>$Z){if(is_array($Z)){foreach($Z
    6256 as$Jc){list($ob,$wf,$X)=explode(" ",$Jc,3);if($ob=="_id"){$X=str_replace('MongoDB\BSON\ObjectID("',"",$X);$X=str_replace('")',"",$X);$lb='MongoDB\BSON\ObjectID';$X=new$lb($X);}if(!in_array($wf,$b->operators))continue;if(preg_match('~^\(f\)(.+)~',$wf,$A)){$X=(float)$X;$wf=$A[1];}elseif(preg_match('~^\(date\)(.+)~',$wf,$A)){$Qb=new
    6257 DateTime($X);$lb='MongoDB\BSON\UTCDatetime';$X=new$lb($Qb->getTimestamp()*1000);$wf=$A[1];}switch($wf){case'=':$wf='$eq';break;case'!=':$wf='$ne';break;case'>':$wf='$gt';break;case'<':$wf='$lt';break;case'>=':$wf='$gte';break;case'<=':$wf='$lte';break;case'regex':$wf='$regex';break;default:continue
    6258 2;}if($T=='and')$Ob['$and'][]=array($ob=>array($wf=>$X));elseif($T=='or')$Ob['$or'][]=array($ob=>array($wf=>$X));}}}return$Ob;}$yf=array("=","!=",">","<",">=","<=","regex","(f)=","(f)!=","(f)>","(f)<","(f)>=","(f)<=","(date)=","(date)!=","(date)>","(date)<","(date)>=","(date)<=",);}function
     6277found_rows($R,$Z){global$h;$Z=where_to_query($Z);$lb='MongoDB\Driver\Command';$tb=new$lb(array('count'=>$R['Name'],'query'=>$Z));$Ug=$h->_link->executeCommand($h->_db_name,$tb);$si=$Ug->toArray();return$si[0]->n;}function
     6278sql_query_where_parser($Ag){$Ag=trim(preg_replace('/WHERE[\s]?[(]?\(?/','',$Ag));$Ag=preg_replace('/\)\)\)$/',')',$Ag);$pj=explode(' AND ',$Ag);$qj=explode(') OR (',$Ag);$Z=array();foreach($pj
     6279as$nj)$Z[]=trim($nj);if(count($qj)==1)$qj=array();elseif(count($qj)>1)$Z=array();return
     6280where_to_query($Z,$qj);}function
     6281where_to_query($lj=array(),$mj=array()){global$b;$Pb=array();foreach(array('and'=>$lj,'or'=>$mj)as$T=>$Z){if(is_array($Z)){foreach($Z
     6282as$Lc){list($ob,$yf,$X)=explode(" ",$Lc,3);if($ob=="_id"){$X=str_replace('MongoDB\BSON\ObjectID("',"",$X);$X=str_replace('")',"",$X);$lb='MongoDB\BSON\ObjectID';$X=new$lb($X);}if(!in_array($yf,$b->operators))continue;if(preg_match('~^\(f\)(.+)~',$yf,$A)){$X=(float)$X;$yf=$A[1];}elseif(preg_match('~^\(date\)(.+)~',$yf,$A)){$Rb=new
     6283DateTime($X);$lb='MongoDB\BSON\UTCDatetime';$X=new$lb($Rb->getTimestamp()*1000);$yf=$A[1];}switch($yf){case'=':$yf='$eq';break;case'!=':$yf='$ne';break;case'>':$yf='$gt';break;case'<':$yf='$lt';break;case'>=':$yf='$gte';break;case'<=':$yf='$lte';break;case'regex':$yf='$regex';break;default:continue
     62842;}if($T=='and')$Pb['$and'][]=array($ob=>array($yf=>$X));elseif($T=='or')$Pb['$or'][]=array($ob=>array($yf=>$X));}}}return$Pb;}$_f=array("=","!=",">","<",">=","<=","regex","(f)=","(f)!=","(f)>","(f)<","(f)>=","(f)<=","(date)=","(date)!=","(date)>","(date)<","(date)>=","(date)<=",);}function
    62596285table($u){return$u;}function
    62606286idf_escape($u){return$u;}function
    6261 table_status($B="",$Qc=false){$H=array();foreach(tables_list()as$Q=>$T){$H[$Q]=array("Name"=>$Q);if($B==$Q)return$H[$Q];}return$H;}function
     6287table_status($B="",$Sc=false){$H=array();foreach(tables_list()as$Q=>$T){$H[$Q]=array("Name"=>$Q);if($B==$Q)return$H[$Q];}return$H;}function
    62626288create_database($l,$d){return
    62636289true;}function
     
    62676293collations(){return
    62686294array();}function
    6269 logged_user(){global$b;$Jb=$b->credentials();return$Jb[1];}function
     6295logged_user(){global$b;$Kb=$b->credentials();return$Kb[1];}function
    62706296connect(){global$b;$h=new
    6271 Min_DB;list($M,$V,$E)=$b->credentials();$Af=array();if($V.$E!=""){$Af["username"]=$V;$Af["password"]=$E;}$l=$b->database();if($l!="")$Af["db"]=$l;if(($Ma=getenv("MONGO_AUTH_SOURCE")))$Af["authSource"]=$Ma;try{$h->_link=$h->connect("mongodb://$M",$Af);if($E!=""){$Af["password"]="";try{$h->connect("mongodb://$M",$Af);return
    6272 lang(22);}catch(Exception$Cc){}}return$h;}catch(Exception$Cc){return$Cc->getMessage();}}function
     6297Min_DB;list($M,$V,$E)=$b->credentials();$Cf=array();if($V.$E!=""){$Cf["username"]=$V;$Cf["password"]=$E;}$l=$b->database();if($l!="")$Cf["db"]=$l;if(($Ma=getenv("MONGO_AUTH_SOURCE")))$Cf["authSource"]=$Ma;try{$h->_link=$h->connect("mongodb://$M",$Cf);if($E!=""){$Cf["password"]="";try{$h->connect("mongodb://$M",$Cf);return
     6298lang(22);}catch(Exception$Ec){}}return$h;}catch(Exception$Ec){return$Ec->getMessage();}}function
    62736299alter_indexes($Q,$c){global$h;foreach($c
    62746300as$X){list($T,$B,$N)=$X;if($N=="DROP")$H=$h->_db->command(array("deleteIndexes"=>$Q,"index"=>$B));else{$f=array();foreach($N
    6275 as$e){$e=preg_replace('~ DESC$~','',$e,1,$Fb);$f[$e]=($Fb?-1:1);}$H=$h->_db->selectCollection($Q)->ensureIndex($f,array("unique"=>($T=="UNIQUE"),"name"=>$B,));}if($H['errmsg']){$h->error=$H['errmsg'];return
     6301as$e){$e=preg_replace('~ DESC$~','',$e,1,$Gb);$f[$e]=($Gb?-1:1);}$H=$h->_db->selectCollection($Q)->ensureIndex($f,array("unique"=>($T=="UNIQUE"),"name"=>$B,));}if($H['errmsg']){$h->error=$H['errmsg'];return
    62766302false;}}return
    62776303true;}function
    6278 support($Rc){return
    6279 preg_match("~database|indexes|descidx~",$Rc);}function
     6304support($Tc){return
     6305preg_match("~database|indexes|descidx~",$Tc);}function
    62806306db_collation($l,$qb){}function
    62816307information_schema(){}function
     
    62886314engines(){return
    62896315array();}function
    6290 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){global$h;if($Q==""){$h->_db->createCollection($B);return
     6316alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){global$h;if($Q==""){$h->_db->createCollection($B);return
    62916317true;}}function
    62926318drop_tables($S){global$h;foreach($S
    6293 as$Q){$Pg=$h->_db->selectCollection($Q)->drop();if(!$Pg['ok'])return
     6319as$Q){$Rg=$h->_db->selectCollection($Q)->drop();if(!$Rg['ok'])return
    62946320false;}return
    62956321true;}function
    62966322truncate_tables($S){global$h;foreach($S
    6297 as$Q){$Pg=$h->_db->selectCollection($Q)->remove();if(!$Pg['ok'])return
     6323as$Q){$Rg=$h->_db->selectCollection($Q)->remove();if(!$Rg['ok'])return
    62986324false;}return
    6299 true;}$x="mongo";$md=array();$sd=array();$oc=array(array("json"));}$gc["elastic"]="Elasticsearch (beta)";if(isset($_GET["elastic"])){$kg=array("json + allow_url_fopen");define("DRIVER","elastic");if(function_exists('json_decode')&&ini_bool('allow_url_fopen')){class
     6325true;}$x="mongo";$od=array();$ud=array();$qc=array(array("json"));}$ic["elastic"]="Elasticsearch (beta)";if(isset($_GET["elastic"])){$mg=array("json + allow_url_fopen");define("DRIVER","elastic");if(function_exists('json_decode')&&ini_bool('allow_url_fopen')){class
    63006326Min_DB{var$extension="JSON",$server_info,$errno,$error,$_url;function
    6301 rootQuery($bg,$Ab=array(),$Ue='GET'){@ini_set('track_errors',1);$Vc=@file_get_contents("$this->_url/".ltrim($bg,'/'),false,stream_context_create(array('http'=>array('method'=>$Ue,'content'=>$Ab===null?$Ab:json_encode($Ab),'header'=>'Content-Type: application/json','ignore_errors'=>1,))));if(!$Vc){$this->error=$php_errormsg;return$Vc;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Vc;return
    6302 false;}$H=json_decode($Vc,true);if($H===null){$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$_b=get_defined_constants(true);foreach($_b['json']as$B=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$B)){$this->error=$B;break;}}}}return$H;}function
    6303 query($bg,$Ab=array(),$Ue='GET'){return$this->rootQuery(($this->_db!=""?"$this->_db/":"/").ltrim($bg,'/'),$Ab,$Ue);}function
     6327rootQuery($dg,$Bb=array(),$We='GET'){@ini_set('track_errors',1);$Xc=@file_get_contents("$this->_url/".ltrim($dg,'/'),false,stream_context_create(array('http'=>array('method'=>$We,'content'=>$Bb===null?$Bb:json_encode($Bb),'header'=>'Content-Type: application/json','ignore_errors'=>1,))));if(!$Xc){$this->error=$php_errormsg;return$Xc;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Xc;return
     6328false;}$H=json_decode($Xc,true);if($H===null){$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$Ab=get_defined_constants(true);foreach($Ab['json']as$B=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$B)){$this->error=$B;break;}}}}return$H;}function
     6329query($dg,$Bb=array(),$We='GET'){return$this->rootQuery(($this->_db!=""?"$this->_db/":"/").ltrim($dg,'/'),$Bb,$We);}function
    63046330connect($M,$V,$E){preg_match('~^(https?://)?(.*)~',$M,$A);$this->_url=($A[1]?$A[1]:"http://")."$V:$E@$A[2]";$H=$this->query('');if($H)$this->server_info=$H['version']['number'];return(bool)$H;}function
    63056331select_db($j){$this->_db=$j;return
     
    63146340extends
    63156341Min_SQL{function
    6316 select($Q,$K,$Z,$pd,$Cf=array(),$z=1,$D=0,$pg=false){global$b;$Ob=array();$F="$Q/_search";if($K!=array("*"))$Ob["fields"]=$K;if($Cf){$yh=array();foreach($Cf
    6317 as$ob){$ob=preg_replace('~ DESC$~','',$ob,1,$Fb);$yh[]=($Fb?array($ob=>"desc"):$ob);}$Ob["sort"]=$yh;}if($z){$Ob["size"]=+$z;if($D)$Ob["from"]=($D*$z);}foreach($Z
    6318 as$X){list($ob,$wf,$X)=explode(" ",$X,3);if($ob=="_id")$Ob["query"]["ids"]["values"][]=$X;elseif($ob.$X!=""){$di=array("term"=>array(($ob!=""?$ob:"_all")=>$X));if($wf=="=")$Ob["query"]["filtered"]["filter"]["and"][]=$di;else$Ob["query"]["filtered"]["query"]["bool"]["must"][]=$di;}}if($Ob["query"]&&!$Ob["query"]["filtered"]["query"]&&!$Ob["query"]["ids"])$Ob["query"]["filtered"]["query"]=array("match_all"=>array());$Gh=microtime(true);$fh=$this->_conn->query($F,$Ob);if($pg)echo$b->selectQuery("$F: ".json_encode($Ob),$Gh,!$fh);if(!$fh)return
    6319 false;$H=array();foreach($fh['hits']['hits']as$Bd){$I=array();if($K==array("*"))$I["_id"]=$Bd["_id"];$p=$Bd['_source'];if($K!=array("*")){$p=array();foreach($K
    6320 as$y)$p[$y]=$Bd['fields'][$y];}foreach($p
    6321 as$y=>$X){if($Ob["fields"])$X=$X[0];$I[$y]=(is_array($X)?json_encode($X):$X);}$H[]=$I;}return
     6342select($Q,$K,$Z,$rd,$Ef=array(),$z=1,$D=0,$rg=false){global$b;$Pb=array();$F="$Q/_search";if($K!=array("*"))$Pb["fields"]=$K;if($Ef){$_h=array();foreach($Ef
     6343as$ob){$ob=preg_replace('~ DESC$~','',$ob,1,$Gb);$_h[]=($Gb?array($ob=>"desc"):$ob);}$Pb["sort"]=$_h;}if($z){$Pb["size"]=+$z;if($D)$Pb["from"]=($D*$z);}foreach($Z
     6344as$X){list($ob,$yf,$X)=explode(" ",$X,3);if($ob=="_id")$Pb["query"]["ids"]["values"][]=$X;elseif($ob.$X!=""){$fi=array("term"=>array(($ob!=""?$ob:"_all")=>$X));if($yf=="=")$Pb["query"]["filtered"]["filter"]["and"][]=$fi;else$Pb["query"]["filtered"]["query"]["bool"]["must"][]=$fi;}}if($Pb["query"]&&!$Pb["query"]["filtered"]["query"]&&!$Pb["query"]["ids"])$Pb["query"]["filtered"]["query"]=array("match_all"=>array());$Ih=microtime(true);$hh=$this->_conn->query($F,$Pb);if($rg)echo$b->selectQuery("$F: ".json_encode($Pb),$Ih,!$hh);if(!$hh)return
     6345false;$H=array();foreach($hh['hits']['hits']as$Dd){$I=array();if($K==array("*"))$I["_id"]=$Dd["_id"];$p=$Dd['_source'];if($K!=array("*")){$p=array();foreach($K
     6346as$y)$p[$y]=$Dd['fields'][$y];}foreach($p
     6347as$y=>$X){if($Pb["fields"])$X=$X[0];$I[$y]=(is_array($X)?json_encode($X):$X);}$H[]=$I;}return
    63226348new
    63236349Min_Result($H);}function
    6324 update($T,$Dg,$zg,$z=0,$L="\n"){$Zf=preg_split('~ *= *~',$zg);if(count($Zf)==2){$t=trim($Zf[1]);$F="$T/$t";return$this->_conn->query($F,$Dg,'POST');}return
     6350update($T,$Fg,$Ag,$z=0,$L="\n"){$bg=preg_split('~ *= *~',$Ag);if(count($bg)==2){$t=trim($bg[1]);$F="$T/$t";return$this->_conn->query($F,$Fg,'POST');}return
    63256351false;}function
    6326 insert($T,$Dg){$t="";$F="$T/$t";$Pg=$this->_conn->query($F,$Dg,'POST');$this->_conn->last_id=$Pg['_id'];return$Pg['created'];}function
    6327 delete($T,$zg,$z=0){$Gd=array();if(is_array($_GET["where"])&&$_GET["where"]["_id"])$Gd[]=$_GET["where"]["_id"];if(is_array($_POST['check'])){foreach($_POST['check']as$eb){$Zf=preg_split('~ *= *~',$eb);if(count($Zf)==2)$Gd[]=trim($Zf[1]);}}$this->_conn->affected_rows=0;foreach($Gd
    6328 as$t){$F="{$T}/{$t}";$Pg=$this->_conn->query($F,'{}','DELETE');if(is_array($Pg)&&$Pg['found']==true)$this->_conn->affected_rows++;}return$this->_conn->affected_rows;}}function
     6352insert($T,$Fg){$t="";$F="$T/$t";$Rg=$this->_conn->query($F,$Fg,'POST');$this->_conn->last_id=$Rg['_id'];return$Rg['created'];}function
     6353delete($T,$Ag,$z=0){$Id=array();if(is_array($_GET["where"])&&$_GET["where"]["_id"])$Id[]=$_GET["where"]["_id"];if(is_array($_POST['check'])){foreach($_POST['check']as$eb){$bg=preg_split('~ *= *~',$eb);if(count($bg)==2)$Id[]=trim($bg[1]);}}$this->_conn->affected_rows=0;foreach($Id
     6354as$t){$F="{$T}/{$t}";$Rg=$this->_conn->query($F,'{}','DELETE');if(is_array($Rg)&&$Rg['found']==true)$this->_conn->affected_rows++;}return$this->_conn->affected_rows;}}function
    63296355connect(){global$b;$h=new
    63306356Min_DB;list($M,$V,$E)=$b->credentials();if($E!=""&&$h->connect($M,$V,""))return
    63316357lang(22);if($h->connect($M,$V,$E))return$h;return$h->error;}function
    6332 support($Rc){return
    6333 preg_match("~database|table|columns~",$Rc);}function
    6334 logged_user(){global$b;$Jb=$b->credentials();return$Jb[1];}function
     6358support($Tc){return
     6359preg_match("~database|table|columns~",$Tc);}function
     6360logged_user(){global$b;$Kb=$b->credentials();return$Kb[1];}function
    63356361get_databases(){global$h;$H=$h->rootQuery('_aliases');if($H){$H=array_keys($H);sort($H,SORT_STRING);}return$H;}function
    63366362collations(){return
     
    63396365engines(){return
    63406366array();}function
    6341 count_tables($k){global$h;$H=array();$G=$h->query('_stats');if($G&&$G['indices']){$Od=$G['indices'];foreach($Od
    6342 as$Nd=>$Hh){$Md=$Hh['total']['indexing'];$H[$Nd]=$Md['index_total'];}}return$H;}function
     6367count_tables($k){global$h;$H=array();$G=$h->query('_stats');if($G&&$G['indices']){$Qd=$G['indices'];foreach($Qd
     6368as$Pd=>$Jh){$Od=$Jh['total']['indexing'];$H[$Pd]=$Od['index_total'];}}return$H;}function
    63436369tables_list(){global$h;$H=$h->query('_mapping');if($H)$H=array_fill_keys(array_keys($H[$h->_db]["mappings"]),'table');return$H;}function
    6344 table_status($B="",$Qc=false){global$h;$fh=$h->query("_search",array("size"=>0,"aggregations"=>array("count_by_type"=>array("terms"=>array("field"=>"_type")))),"POST");$H=array();if($fh){$S=$fh["aggregations"]["count_by_type"]["buckets"];foreach($S
     6370table_status($B="",$Sc=false){global$h;$hh=$h->query("_search",array("size"=>0,"aggregations"=>array("count_by_type"=>array("terms"=>array("field"=>"_type")))),"POST");$H=array();if($hh){$S=$hh["aggregations"]["count_by_type"]["buckets"];foreach($S
    63456371as$Q){$H[$Q["key"]]=array("Name"=>$Q["key"],"Engine"=>"table","Rows"=>$Q["doc_count"],);if($B!=""&&$B==$Q["key"])return$H[$B];}}return$H;}function
    63466372error(){global$h;return
     
    63506376indexes($Q,$i=null){return
    63516377array(array("type"=>"PRIMARY","columns"=>array("_id")),);}function
    6352 fields($Q){global$h;$G=$h->query("$Q/_mapping");$H=array();if($G){$Ce=$G[$Q]['properties'];if(!$Ce)$Ce=$G[$h->_db]['mappings'][$Q]['properties'];if($Ce){foreach($Ce
     6378fields($Q){global$h;$G=$h->query("$Q/_mapping");$H=array();if($G){$Ee=$G[$Q]['properties'];if(!$Ee)$Ee=$G[$h->_db]['mappings'][$Q]['properties'];if($Ee){foreach($Ee
    63536379as$B=>$o){$H[$B]=array("field"=>$B,"full_type"=>$o["type"],"type"=>$o["type"],"privileges"=>array("insert"=>1,"select"=>1,"update"=>1),);if($o["properties"]){unset($H[$B]["privileges"]["insert"]);unset($H[$B]["privileges"]["update"]);}}}}return$H;}function
    63546380foreign_keys($Q){return
     
    63636389create_database($l){global$h;return$h->rootQuery(urlencode($l),null,'PUT');}function
    63646390drop_databases($k){global$h;return$h->rootQuery(urlencode(implode(',',$k)),array(),'DELETE');}function
    6365 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){global$h;$vg=array();foreach($p
    6366 as$Oc){$Tc=trim($Oc[1][0]);$Uc=trim($Oc[1][1]?$Oc[1][1]:"text");$vg[$Tc]=array('type'=>$Uc);}if(!empty($vg))$vg=array('properties'=>$vg);return$h->query("_mapping/{$B}",$vg,'PUT');}function
     6391alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){global$h;$xg=array();foreach($p
     6392as$Qc){$Vc=trim($Qc[1][0]);$Wc=trim($Qc[1][1]?$Qc[1][1]:"text");$xg[$Vc]=array('type'=>$Wc);}if(!empty($xg))$xg=array('properties'=>$xg);return$h->query("_mapping/{$B}",$xg,'PUT');}function
    63676393drop_tables($S){global$h;$H=true;foreach($S
    63686394as$Q)$H=$H&&$h->query(urlencode($Q),array(),'DELETE');return$H;}function
    6369 last_id(){global$h;return$h->last_id;}$x="elastic";$yf=array("=","query");$md=array();$sd=array();$oc=array(array("json"));$U=array();$Kh=array();foreach(array(lang(27)=>array("long"=>3,"integer"=>5,"short"=>8,"byte"=>10,"double"=>20,"float"=>66,"half_float"=>12,"scaled_float"=>21),lang(28)=>array("date"=>10),lang(25)=>array("string"=>65535,"text"=>65535),lang(29)=>array("binary"=>255),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}}$gc["clickhouse"]="ClickHouse (alpha)";if(isset($_GET["clickhouse"])){define("DRIVER","clickhouse");class
     6395last_id(){global$h;return$h->last_id;}$x="elastic";$_f=array("=","query");$od=array();$ud=array();$qc=array(array("json"));$U=array();$Mh=array();foreach(array(lang(27)=>array("long"=>3,"integer"=>5,"short"=>8,"byte"=>10,"double"=>20,"float"=>66,"half_float"=>12,"scaled_float"=>21),lang(28)=>array("date"=>10),lang(25)=>array("string"=>65535,"text"=>65535),lang(29)=>array("binary"=>255),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}}$ic["clickhouse"]="ClickHouse (alpha)";if(isset($_GET["clickhouse"])){define("DRIVER","clickhouse");class
    63706396Min_DB{var$extension="JSON",$server_info,$errno,$_result,$error,$_url;var$_db='default';function
    6371 rootQuery($l,$F){@ini_set('track_errors',1);$Vc=@file_get_contents("$this->_url/?database=$l",false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$this->isQuerySelectLike($F)?"$F FORMAT JSONCompact":$F,'header'=>'Content-type: application/x-www-form-urlencoded','ignore_errors'=>1,))));if($Vc===false){$this->error=$php_errormsg;return$Vc;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Vc;return
    6372 false;}$H=json_decode($Vc,true);if($H===null){if(!$this->isQuerySelectLike($F)&&$Vc==='')return
    6373 true;$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$_b=get_defined_constants(true);foreach($_b['json']as$B=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$B)){$this->error=$B;break;}}}}return
     6397rootQuery($l,$F){@ini_set('track_errors',1);$Xc=@file_get_contents("$this->_url/?database=$l",false,stream_context_create(array('http'=>array('method'=>'POST','content'=>$this->isQuerySelectLike($F)?"$F FORMAT JSONCompact":$F,'header'=>'Content-type: application/x-www-form-urlencoded','ignore_errors'=>1,))));if($Xc===false){$this->error=$php_errormsg;return$Xc;}if(!preg_match('~^HTTP/[0-9.]+ 2~i',$http_response_header[0])){$this->error=$Xc;return
     6398false;}$H=json_decode($Xc,true);if($H===null){if(!$this->isQuerySelectLike($F)&&$Xc==='')return
     6399true;$this->errno=json_last_error();if(function_exists('json_last_error_msg'))$this->error=json_last_error_msg();else{$Ab=get_defined_constants(true);foreach($Ab['json']as$B=>$Y){if($Y==$this->errno&&preg_match('~^JSON_ERROR_~',$B)){$this->error=$B;break;}}}}return
    63746400new
    63756401Min_Result($H);}function
     
    63946420extends
    63956421Min_SQL{function
    6396 delete($Q,$zg,$z=0){if($zg==='')$zg='WHERE 1=1';return
    6397 queries("ALTER TABLE ".table($Q)." DELETE $zg");}function
    6398 update($Q,$N,$zg,$z=0,$L="\n"){$Yi=array();foreach($N
    6399 as$y=>$X)$Yi[]="$y = $X";$F=$L.implode(",$L",$Yi);return
    6400 queries("ALTER TABLE ".table($Q)." UPDATE $F$zg");}}function
     6422delete($Q,$Ag,$z=0){if($Ag==='')$Ag='WHERE 1=1';return
     6423queries("ALTER TABLE ".table($Q)." DELETE $Ag");}function
     6424update($Q,$N,$Ag,$z=0,$L="\n"){$aj=array();foreach($N
     6425as$y=>$X)$aj[]="$y = $X";$F=$L.implode(",$L",$aj);return
     6426queries("ALTER TABLE ".table($Q)." UPDATE $F$Ag");}}function
    64016427idf_escape($u){return"`".str_replace("`","``",$u)."`";}function
    64026428table($u){return
     
    64056431found_rows($R,$Z){$J=get_vals("SELECT COUNT(*) FROM ".idf_escape($R["Name"]).($Z?" WHERE ".implode(" AND ",$Z):""));return
    64066432empty($J)?false:$J[0];}function
    6407 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){$c=$Cf=array();foreach($p
    6408 as$o){if($o[1][2]===" NULL")$o[1][1]=" Nullable({$o[1][1]})";elseif($o[1][2]===' NOT NULL')$o[1][2]='';if($o[1][3])$o[1][3]='';$c[]=($o[1]?($Q!=""?($o[0]!=""?"MODIFY COLUMN ":"ADD COLUMN "):" ").implode($o[1]):"DROP COLUMN ".idf_escape($o[0]));$Cf[]=$o[1][0];}$c=array_merge($c,$ed);$O=($wc?" ENGINE ".$wc:"");if($Q=="")return
    6409 queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)$O$Xf".' ORDER BY ('.implode(',',$Cf).')');if($Q!=$B){$G=queries("RENAME TABLE ".table($Q)." TO ".table($B));if($c)$Q=$B;else
    6410 return$G;}if($O)$c[]=ltrim($O);return($c||$Xf?queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$c).$Xf):true);}function
     6433alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){$c=$Ef=array();foreach($p
     6434as$o){if($o[1][2]===" NULL")$o[1][1]=" Nullable({$o[1][1]})";elseif($o[1][2]===' NOT NULL')$o[1][2]='';if($o[1][3])$o[1][3]='';$c[]=($o[1]?($Q!=""?($o[0]!=""?"MODIFY COLUMN ":"ADD COLUMN "):" ").implode($o[1]):"DROP COLUMN ".idf_escape($o[0]));$Ef[]=$o[1][0];}$c=array_merge($c,$gd);$O=($yc?" ENGINE ".$yc:"");if($Q=="")return
     6435queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)$O$Zf".' ORDER BY ('.implode(',',$Ef).')');if($Q!=$B){$G=queries("RENAME TABLE ".table($Q)." TO ".table($B));if($c)$Q=$B;else
     6436return$G;}if($O)$c[]=ltrim($O);return($c||$Zf?queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$c).$Zf):true);}function
    64116437truncate_tables($S){return
    64126438apply_queries("TRUNCATE TABLE",$S);}function
    6413 drop_views($dj){return
    6414 drop_tables($dj);}function
     6439drop_views($fj){return
     6440drop_tables($fj);}function
    64156441drop_tables($S){return
    64166442apply_queries("DROP TABLE",$S);}function
    64176443connect(){global$b;$h=new
    6418 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2]))return$h;return$h->error;}function
    6419 get_databases($cd){global$h;$G=get_rows('SHOW DATABASES');$H=array();foreach($G
     6444Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2]))return$h;return$h->error;}function
     6445get_databases($ed){global$h;$G=get_rows('SHOW DATABASES');$H=array();foreach($G
    64206446as$I)$H[]=$I['name'];sort($H);return$H;}function
    64216447limit($F,$Z,$z,$C=0,$L=" "){return" $F$Z".($z!==null?$L."LIMIT $z".($C?", $C":""):"");}function
     
    64256451engines(){return
    64266452array('MergeTree');}function
    6427 logged_user(){global$b;$Jb=$b->credentials();return$Jb[1];}function
     6453logged_user(){global$b;$Kb=$b->credentials();return$Kb[1];}function
    64286454tables_list(){$G=get_rows('SHOW TABLES');$H=array();foreach($G
    64296455as$I)$H[$I['name']]='table';ksort($H);return$H;}function
    64306456count_tables($k){return
    64316457array();}function
    6432 table_status($B="",$Qc=false){global$h;$H=array();$S=get_rows("SELECT name, engine FROM system.tables WHERE database = ".q($h->_db));foreach($S
     6458table_status($B="",$Sc=false){global$h;$H=array();$S=get_rows("SELECT name, engine FROM system.tables WHERE database = ".q($h->_db));foreach($S
    64336459as$Q){$H[$Q['name']]=array('Name'=>$Q['name'],'Engine'=>$Q['engine'],);if($B===$Q['name'])return$H[$Q['name']];}return$H;}function
    64346460is_view($R){return
     
    64396465unconvert_field($o,$H){if(in_array($o['type'],array("Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Float32","Float64")))return"to$o[type]($H)";return$H;}function
    64406466fields($Q){$H=array();$G=get_rows("SELECT name, type, default_expression FROM system.columns WHERE ".idf_escape('table')." = ".q($Q));foreach($G
    6441 as$I){$T=trim($I['type']);$if=strpos($T,'Nullable(')===0;$H[trim($I['name'])]=array("field"=>trim($I['name']),"full_type"=>$T,"type"=>$T,"default"=>trim($I['default_expression']),"null"=>$if,"auto_increment"=>'0',"privileges"=>array("insert"=>1,"select"=>1,"update"=>0),);}return$H;}function
     6467as$I){$T=trim($I['type']);$kf=strpos($T,'Nullable(')===0;$H[trim($I['name'])]=array("field"=>trim($I['name']),"full_type"=>$T,"type"=>$T,"default"=>trim($I['default_expression']),"null"=>$kf,"auto_increment"=>'0',"privileges"=>array("insert"=>1,"select"=>1,"update"=>0),);}return$H;}function
    64426468indexes($Q,$i=null){return
    64436469array();}function
     
    64556481array();}function
    64566482get_schema(){return"";}function
    6457 set_schema($dh){return
     6483set_schema($fh){return
    64586484true;}function
    64596485auto_increment(){return'';}function
    64606486last_id(){return
    646164870;}function
    6462 support($Rc){return
    6463 preg_match("~^(columns|sql|status|table|drop_col)$~",$Rc);}$x="clickhouse";$U=array();$Kh=array();foreach(array(lang(27)=>array("Int8"=>3,"Int16"=>5,"Int32"=>10,"Int64"=>19,"UInt8"=>3,"UInt16"=>5,"UInt32"=>10,"UInt64"=>20,"Float32"=>7,"Float64"=>16,'Decimal'=>38,'Decimal32'=>9,'Decimal64'=>18,'Decimal128'=>38),lang(28)=>array("Date"=>13,"DateTime"=>20),lang(25)=>array("String"=>0),lang(29)=>array("FixedString"=>0),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}$Li=array();$yf=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$md=array();$sd=array("avg","count","count distinct","max","min","sum");$oc=array();}$gc=array("server"=>"MySQL")+$gc;if(!defined("DRIVER")){$kg=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
     6488support($Tc){return
     6489preg_match("~^(columns|sql|status|table|drop_col)$~",$Tc);}$x="clickhouse";$U=array();$Mh=array();foreach(array(lang(27)=>array("Int8"=>3,"Int16"=>5,"Int32"=>10,"Int64"=>19,"UInt8"=>3,"UInt16"=>5,"UInt32"=>10,"UInt64"=>20,"Float32"=>7,"Float64"=>16,'Decimal'=>38,'Decimal32'=>9,'Decimal64'=>18,'Decimal128'=>38),lang(28)=>array("Date"=>13,"DateTime"=>20),lang(25)=>array("String"=>0),lang(29)=>array("FixedString"=>0),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}$Ni=array();$_f=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","SQL");$od=array();$ud=array("avg","count","count distinct","max","min","sum");$qc=array();}$ic=array("server"=>"MySQL")+$ic;if(!defined("DRIVER")){$mg=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
    64646490Min_DB
    64656491extends
    64666492MySQLi{var$extension="MySQLi";function
    64676493__construct(){parent::init();}function
    6468 connect($M="",$V="",$E="",$j=null,$gg=null,$xh=null){global$b;mysqli_report(MYSQLI_REPORT_OFF);list($Cd,$gg)=explode(":",$M,2);$Fh=$b->connectSsl();if($Fh)$this->ssl_set($Fh['key'],$Fh['cert'],$Fh['ca'],'','');$H=@$this->real_connect(($M!=""?$Cd:ini_get("mysqli.default_host")),($M.$V!=""?$V:ini_get("mysqli.default_user")),($M.$V.$E!=""?$E:ini_get("mysqli.default_pw")),$j,(is_numeric($gg)?$gg:ini_get("mysqli.default_port")),(!is_numeric($gg)?$gg:$xh),($Fh?64:0));$this->options(MYSQLI_OPT_LOCAL_INFILE,false);return$H;}function
     6494connect($M="",$V="",$E="",$j=null,$ig=null,$zh=null){global$b;mysqli_report(MYSQLI_REPORT_OFF);list($Ed,$ig)=explode(":",$M,2);$Hh=$b->connectSsl();if($Hh)$this->ssl_set($Hh['key'],$Hh['cert'],$Hh['ca'],'','');$H=@$this->real_connect(($M!=""?$Ed:ini_get("mysqli.default_host")),($M.$V!=""?$V:ini_get("mysqli.default_user")),($M.$V.$E!=""?$E:ini_get("mysqli.default_pw")),$j,(is_numeric($ig)?$ig:ini_get("mysqli.default_port")),(!is_numeric($ig)?$ig:$zh),($Hh?64:0));$this->options(MYSQLI_OPT_LOCAL_INFILE,false);return$H;}function
    64696495set_charset($db){if(parent::set_charset($db))return
    64706496true;parent::set_charset('utf8');return$this->query("SET NAMES $db");}function
     
    64806506select_db($j){return
    64816507mysql_select_db($j,$this->_link);}function
    6482 query($F,$Fi=false){$G=@($Fi?mysql_unbuffered_query($F,$this->_link):mysql_query($F,$this->_link));$this->error="";if(!$G){$this->errno=mysql_errno($this->_link);$this->error=mysql_error($this->_link);return
     6508query($F,$Hi=false){$G=@($Hi?mysql_unbuffered_query($F,$this->_link):mysql_query($F,$this->_link));$this->error="";if(!$G){$this->errno=mysql_errno($this->_link);$this->error=mysql_error($this->_link);return
    64836509false;}if($G===true){$this->affected_rows=mysql_affected_rows($this->_link);$this->info=mysql_info($this->_link);return
    64846510true;}return
     
    65036529extends
    65046530Min_PDO{var$extension="PDO_MySQL";function
    6505 connect($M,$V,$E){global$b;$Af=array(PDO::MYSQL_ATTR_LOCAL_INFILE=>false);$Fh=$b->connectSsl();if($Fh){if(!empty($Fh['key']))$Af[PDO::MYSQL_ATTR_SSL_KEY]=$Fh['key'];if(!empty($Fh['cert']))$Af[PDO::MYSQL_ATTR_SSL_CERT]=$Fh['cert'];if(!empty($Fh['ca']))$Af[PDO::MYSQL_ATTR_SSL_CA]=$Fh['ca'];}$this->dsn("mysql:charset=utf8;host=".str_replace(":",";unix_socket=",preg_replace('~:(\d)~',';port=\1',$M)),$V,$E,$Af);return
     6531connect($M,$V,$E){global$b;$Cf=array(PDO::MYSQL_ATTR_LOCAL_INFILE=>false);$Hh=$b->connectSsl();if($Hh){if(!empty($Hh['key']))$Cf[PDO::MYSQL_ATTR_SSL_KEY]=$Hh['key'];if(!empty($Hh['cert']))$Cf[PDO::MYSQL_ATTR_SSL_CERT]=$Hh['cert'];if(!empty($Hh['ca']))$Cf[PDO::MYSQL_ATTR_SSL_CA]=$Hh['ca'];}$this->dsn("mysql:charset=utf8;host=".str_replace(":",";unix_socket=",preg_replace('~:(\d)~',';port=\1',$M)),$V,$E,$Cf);return
    65066532true;}function
    65076533set_charset($db){$this->query("SET NAMES $db");}function
    65086534select_db($j){return$this->query("USE ".idf_escape($j));}function
    6509 query($F,$Fi=false){$this->setAttribute(1000,!$Fi);return
    6510 parent::query($F,$Fi);}}}class
     6535query($F,$Hi=false){$this->setAttribute(1000,!$Hi);return
     6536parent::query($F,$Hi);}}}class
    65116537Min_Driver
    65126538extends
    65136539Min_SQL{function
    65146540insert($Q,$N){return($N?parent::insert($Q,$N):queries("INSERT INTO ".table($Q)." ()\nVALUES ()"));}function
    6515 insertUpdate($Q,$J,$ng){$f=array_keys(reset($J));$lg="INSERT INTO ".table($Q)." (".implode(", ",$f).") VALUES\n";$Yi=array();foreach($f
    6516 as$y)$Yi[$y]="$y = VALUES($y)";$Nh="\nON DUPLICATE KEY UPDATE ".implode(", ",$Yi);$Yi=array();$we=0;foreach($J
    6517 as$N){$Y="(".implode(", ",$N).")";if($Yi&&(strlen($lg)+$we+strlen($Y)+strlen($Nh)>1e6)){if(!queries($lg.implode(",\n",$Yi).$Nh))return
    6518 false;$Yi=array();$we=0;}$Yi[]=$Y;$we+=strlen($Y)+2;}return
    6519 queries($lg.implode(",\n",$Yi).$Nh);}function
    6520 slowQuery($F,$ii){if(min_version('5.7.8','10.1.2')){if(preg_match('~MariaDB~',$this->_conn->server_info))return"SET STATEMENT max_statement_time=$ii FOR $F";elseif(preg_match('~^(SELECT\b)(.+)~is',$F,$A))return"$A[1] /*+ MAX_EXECUTION_TIME(".($ii*1000).") */ $A[2]";}}function
     6541insertUpdate($Q,$J,$pg){$f=array_keys(reset($J));$ng="INSERT INTO ".table($Q)." (".implode(", ",$f).") VALUES\n";$aj=array();foreach($f
     6542as$y)$aj[$y]="$y = VALUES($y)";$Ph="\nON DUPLICATE KEY UPDATE ".implode(", ",$aj);$aj=array();$ye=0;foreach($J
     6543as$N){$Y="(".implode(", ",$N).")";if($aj&&(strlen($ng)+$ye+strlen($Y)+strlen($Ph)>1e6)){if(!queries($ng.implode(",\n",$aj).$Ph))return
     6544false;$aj=array();$ye=0;}$aj[]=$Y;$ye+=strlen($Y)+2;}return
     6545queries($ng.implode(",\n",$aj).$Ph);}function
     6546slowQuery($F,$ki){if(min_version('5.7.8','10.1.2')){if(preg_match('~MariaDB~',$this->_conn->server_info))return"SET STATEMENT max_statement_time=$ki FOR $F";elseif(preg_match('~^(SELECT\b)(.+)~is',$F,$A))return"$A[1] /*+ MAX_EXECUTION_TIME(".($ki*1000).") */ $A[2]";}}function
    65216547convertSearch($u,$X,$o){return(preg_match('~char|text|enum|set~',$o["type"])&&!preg_match("~^utf8~",$o["collation"])&&preg_match('~[\x80-\xFF]~',$X['val'])?"CONVERT($u USING ".charset($this->_conn).")":$u);}function
    65226548warnings(){$G=$this->_conn->query("SHOW WARNINGS");if($G&&$G->num_rows){ob_start();select($G);return
    65236549ob_get_clean();}}function
    6524 tableHelp($B){$De=preg_match('~MariaDB~',$this->_conn->server_info);if(information_schema(DB))return
    6525 strtolower(($De?"information-schema-$B-table/":str_replace("_","-",$B)."-table.html"));if(DB=="mysql")return($De?"mysql$B-table/":"system-database.html");}}function
     6550tableHelp($B){$Fe=preg_match('~MariaDB~',$this->_conn->server_info);if(information_schema(DB))return
     6551strtolower(($Fe?"information-schema-$B-table/":str_replace("_","-",$B)."-table.html"));if(DB=="mysql")return($Fe?"mysql$B-table/":"system-database.html");}}function
    65266552idf_escape($u){return"`".str_replace("`","``",$u)."`";}function
    65276553table($u){return
    65286554idf_escape($u);}function
    6529 connect(){global$b,$U,$Kh;$h=new
    6530 Min_DB;$Jb=$b->credentials();if($h->connect($Jb[0],$Jb[1],$Jb[2])){$h->set_charset(charset($h));$h->query("SET sql_quote_show_create = 1, autocommit = 1");if(min_version('5.7.8',10.2,$h)){$Kh[lang(25)][]="json";$U["json"]=4294967295;}return$h;}$H=$h->error;if(function_exists('iconv')&&!isutf8($H)&&strlen($bh=iconv("windows-1250","utf-8",$H))>strlen($H))$H=$bh;return$H;}function
    6531 get_databases($cd){$H=get_session("dbs");if($H===null){$F=(min_version(5)?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME":"SHOW DATABASES");$H=($cd?slow_query($F):get_vals($F));restart_session();set_session("dbs",$H);stop_session();}return$H;}function
     6555connect(){global$b,$U,$Mh;$h=new
     6556Min_DB;$Kb=$b->credentials();if($h->connect($Kb[0],$Kb[1],$Kb[2])){$h->set_charset(charset($h));$h->query("SET sql_quote_show_create = 1, autocommit = 1");if(min_version('5.7.8',10.2,$h)){$Mh[lang(25)][]="json";$U["json"]=4294967295;}return$h;}$H=$h->error;if(function_exists('iconv')&&!isutf8($H)&&strlen($dh=iconv("windows-1250","utf-8",$H))>strlen($H))$H=$dh;return$H;}function
     6557get_databases($ed){$H=get_session("dbs");if($H===null){$F=(min_version(5)?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME":"SHOW DATABASES");$H=($ed?slow_query($F):get_vals($F));restart_session();set_session("dbs",$H);stop_session();}return$H;}function
    65326558limit($F,$Z,$z,$C=0,$L=" "){return" $F$Z".($z!==null?$L."LIMIT $z".($C?" OFFSET $C":""):"");}function
    65336559limit1($Q,$F,$Z,$L="\n"){return
    65346560limit($F,$Z,1,0,$L);}function
    6535 db_collation($l,$qb){global$h;$H=null;$Gb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1);if(preg_match('~ COLLATE ([^ ]+)~',$Gb,$A))$H=$A[1];elseif(preg_match('~ CHARACTER SET ([^ ]+)~',$Gb,$A))$H=$qb[$A[1]][-1];return$H;}function
     6561db_collation($l,$qb){global$h;$H=null;$Hb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1);if(preg_match('~ COLLATE ([^ ]+)~',$Hb,$A))$H=$A[1];elseif(preg_match('~ CHARACTER SET ([^ ]+)~',$Hb,$A))$H=$qb[$A[1]][-1];return$H;}function
    65366562engines(){$H=array();foreach(get_rows("SHOW ENGINES")as$I){if(preg_match("~YES|DEFAULT~",$I["Support"]))$H[]=$I["Engine"];}return$H;}function
    65376563logged_user(){global$h;return$h->result("SELECT USER()");}function
     
    65406566count_tables($k){$H=array();foreach($k
    65416567as$l)$H[$l]=count(get_vals("SHOW TABLES IN ".idf_escape($l)));return$H;}function
    6542 table_status($B="",$Qc=false){$H=array();foreach(get_rows($Qc&&min_version(5)?"SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ".($B!=""?"AND TABLE_NAME = ".q($B):"ORDER BY Name"):"SHOW TABLE STATUS".($B!=""?" LIKE ".q(addcslashes($B,"%_\\")):""))as$I){if($I["Engine"]=="InnoDB")$I["Comment"]=preg_replace('~(?:(.+); )?InnoDB free: .*~','\1',$I["Comment"]);if(!isset($I["Engine"]))$I["Comment"]="";if($B!="")return$I;$H[$I["Name"]]=$I;}return$H;}function
     6568table_status($B="",$Sc=false){$H=array();foreach(get_rows($Sc&&min_version(5)?"SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ".($B!=""?"AND TABLE_NAME = ".q($B):"ORDER BY Name"):"SHOW TABLE STATUS".($B!=""?" LIKE ".q(addcslashes($B,"%_\\")):""))as$I){if($I["Engine"]=="InnoDB")$I["Comment"]=preg_replace('~(?:(.+); )?InnoDB free: .*~','\1',$I["Comment"]);if(!isset($I["Engine"]))$I["Comment"]="";if($B!="")return$I;$H[$I["Name"]]=$I;}return$H;}function
    65436569is_view($R){return$R["Engine"]===null;}function
    65446570fk_support($R){return
     
    65466572fields($Q){$H=array();foreach(get_rows("SHOW FULL COLUMNS FROM ".table($Q))as$I){preg_match('~^([^( ]+)(?:\((.+)\))?( unsigned)?( zerofill)?$~',$I["Type"],$A);$H[$I["Field"]]=array("field"=>$I["Field"],"full_type"=>$I["Type"],"type"=>$A[1],"length"=>$A[2],"unsigned"=>ltrim($A[3].$A[4]),"default"=>($I["Default"]!=""||preg_match("~char|set~",$A[1])?$I["Default"]:null),"null"=>($I["Null"]=="YES"),"auto_increment"=>($I["Extra"]=="auto_increment"),"on_update"=>(preg_match('~^on update (.+)~i',$I["Extra"],$A)?$A[1]:""),"collation"=>$I["Collation"],"privileges"=>array_flip(preg_split('~, *~',$I["Privileges"])),"comment"=>$I["Comment"],"primary"=>($I["Key"]=="PRI"),"generated"=>preg_match('~^(VIRTUAL|PERSISTENT|STORED)~',$I["Extra"]),);}return$H;}function
    65476573indexes($Q,$i=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($Q),$i)as$I){$B=$I["Key_name"];$H[$B]["type"]=($B=="PRIMARY"?"PRIMARY":($I["Index_type"]=="FULLTEXT"?"FULLTEXT":($I["Non_unique"]?($I["Index_type"]=="SPATIAL"?"SPATIAL":"INDEX"):"UNIQUE")));$H[$B]["columns"][]=$I["Column_name"];$H[$B]["lengths"][]=($I["Index_type"]=="SPATIAL"?null:$I["Sub_part"]);$H[$B]["descs"][]=null;}return$H;}function
    6548 foreign_keys($Q){global$h,$tf;static$dg='(?:`(?:[^`]|``)+`|"(?:[^"]|"")+")';$H=array();$Hb=$h->result("SHOW CREATE TABLE ".table($Q),1);if($Hb){preg_match_all("~CONSTRAINT ($dg) FOREIGN KEY ?\\(((?:$dg,? ?)+)\\) REFERENCES ($dg)(?:\\.($dg))? \\(((?:$dg,? ?)+)\\)(?: ON DELETE ($tf))?(?: ON UPDATE ($tf))?~",$Hb,$Ge,PREG_SET_ORDER);foreach($Ge
    6549 as$A){preg_match_all("~$dg~",$A[2],$zh);preg_match_all("~$dg~",$A[5],$ai);$H[idf_unescape($A[1])]=array("db"=>idf_unescape($A[4]!=""?$A[3]:$A[4]),"table"=>idf_unescape($A[4]!=""?$A[4]:$A[3]),"source"=>array_map('idf_unescape',$zh[0]),"target"=>array_map('idf_unescape',$ai[0]),"on_delete"=>($A[6]?$A[6]:"RESTRICT"),"on_update"=>($A[7]?$A[7]:"RESTRICT"),);}}return$H;}function
     6574foreign_keys($Q){global$h,$vf;static$fg='(?:`(?:[^`]|``)+`|"(?:[^"]|"")+")';$H=array();$Ib=$h->result("SHOW CREATE TABLE ".table($Q),1);if($Ib){preg_match_all("~CONSTRAINT ($fg) FOREIGN KEY ?\\(((?:$fg,? ?)+)\\) REFERENCES ($fg)(?:\\.($fg))? \\(((?:$fg,? ?)+)\\)(?: ON DELETE ($vf))?(?: ON UPDATE ($vf))?~",$Ib,$Ie,PREG_SET_ORDER);foreach($Ie
     6575as$A){preg_match_all("~$fg~",$A[2],$Ah);preg_match_all("~$fg~",$A[5],$ci);$H[idf_unescape($A[1])]=array("db"=>idf_unescape($A[4]!=""?$A[3]:$A[4]),"table"=>idf_unescape($A[4]!=""?$A[4]:$A[3]),"source"=>array_map('idf_unescape',$Ah[0]),"target"=>array_map('idf_unescape',$ci[0]),"on_delete"=>($A[6]?$A[6]:"RESTRICT"),"on_update"=>($A[7]?$A[7]:"RESTRICT"),);}}return$H;}function
    65506576view($B){global$h;return
    65516577array("select"=>preg_replace('~^(?:[^`]|`[^`]*`)*\s+AS\s+~isU','',$h->result("SHOW CREATE VIEW ".table($B),1)));}function
     
    65586584queries("CREATE DATABASE ".idf_escape($l).($d?" COLLATE ".q($d):""));}function
    65596585drop_databases($k){$H=apply_queries("DROP DATABASE",$k,'idf_escape');restart_session();set_session("dbs",null);return$H;}function
    6560 rename_database($B,$d){$H=false;if(create_database($B,$d)){$Ng=array();foreach(tables_list()as$Q=>$T)$Ng[]=table($Q)." TO ".idf_escape($B).".".table($Q);$H=(!$Ng||queries("RENAME TABLE ".implode(", ",$Ng)));if($H)queries("DROP DATABASE ".idf_escape(DB));restart_session();set_session("dbs",null);}return$H;}function
     6586rename_database($B,$d){$H=false;if(create_database($B,$d)){$Pg=array();foreach(tables_list()as$Q=>$T)$Pg[]=table($Q)." TO ".idf_escape($B).".".table($Q);$H=(!$Pg||queries("RENAME TABLE ".implode(", ",$Pg)));if($H)queries("DROP DATABASE ".idf_escape(DB));restart_session();set_session("dbs",null);}return$H;}function
    65616587auto_increment(){$Oa=" PRIMARY KEY";if($_GET["create"]!=""&&$_POST["auto_increment_col"]){foreach(indexes($_GET["create"])as$v){if(in_array($_POST["fields"][$_POST["auto_increment_col"]]["orig"],$v["columns"],true)){$Oa="";break;}if($v["type"]=="PRIMARY")$Oa=" UNIQUE";}}return" AUTO_INCREMENT$Oa";}function
    6562 alter_table($Q,$B,$p,$ed,$vb,$wc,$d,$Na,$Xf){$c=array();foreach($p
    6563 as$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,$ed);$O=($vb!==null?" COMMENT=".q($vb):"").($wc?" ENGINE=".q($wc):"").($d?" COLLATE ".q($d):"").($Na!=""?" AUTO_INCREMENT=$Na":"");if($Q=="")return
    6564 queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)$O$Xf");if($Q!=$B)$c[]="RENAME TO ".table($B);if($O)$c[]=ltrim($O);return($c||$Xf?queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$c).$Xf):true);}function
     6588alter_table($Q,$B,$p,$gd,$vb,$yc,$d,$Na,$Zf){$c=array();foreach($p
     6589as$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,$gd);$O=($vb!==null?" COMMENT=".q($vb):"").($yc?" ENGINE=".q($yc):"").($d?" COLLATE ".q($d):"").($Na!=""?" AUTO_INCREMENT=$Na":"");if($Q=="")return
     6590queries("CREATE TABLE ".table($B)." (\n".implode(",\n",$c)."\n)$O$Zf");if($Q!=$B)$c[]="RENAME TO ".table($B);if($O)$c[]=ltrim($O);return($c||$Zf?queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$c).$Zf):true);}function
    65656591alter_indexes($Q,$c){foreach($c
    65666592as$y=>$X)$c[$y]=($X[2]=="DROP"?"\nDROP INDEX ".idf_escape($X[1]):"\nADD $X[0] ".($X[0]=="PRIMARY"?"KEY ":"").($X[1]!=""?idf_escape($X[1])." ":"")."(".implode(", ",$X[2]).")");return
     
    65686594truncate_tables($S){return
    65696595apply_queries("TRUNCATE TABLE",$S);}function
    6570 drop_views($dj){return
    6571 queries("DROP VIEW ".implode(", ",array_map('table',$dj)));}function
     6596drop_views($fj){return
     6597queries("DROP VIEW ".implode(", ",array_map('table',$fj)));}function
    65726598drop_tables($S){return
    65736599queries("DROP TABLE ".implode(", ",array_map('table',$S)));}function
    6574 move_tables($S,$dj,$ai){$Ng=array();foreach(array_merge($S,$dj)as$Q)$Ng[]=table($Q)." TO ".idf_escape($ai).".".table($Q);return
    6575 queries("RENAME TABLE ".implode(", ",$Ng));}function
    6576 copy_tables($S,$dj,$ai){queries("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");foreach($S
    6577 as$Q){$B=($ai==DB?table("copy_$Q"):idf_escape($ai).".".table($Q));if(($_POST["overwrite"]&&!queries("\nDROP TABLE IF EXISTS $B"))||!queries("CREATE TABLE $B LIKE ".table($Q))||!queries("INSERT INTO $B SELECT * FROM ".table($Q)))return
    6578 false;foreach(get_rows("SHOW TRIGGERS LIKE ".q(addcslashes($Q,"%_\\")))as$I){$_i=$I["Trigger"];if(!queries("CREATE TRIGGER ".($ai==DB?idf_escape("copy_$_i"):idf_escape($ai).".".idf_escape($_i))." $I[Timing] $I[Event] ON $B FOR EACH ROW\n$I[Statement];"))return
    6579 false;}}foreach($dj
    6580 as$Q){$B=($ai==DB?table("copy_$Q"):idf_escape($ai).".".table($Q));$cj=view($Q);if(($_POST["overwrite"]&&!queries("DROP VIEW IF EXISTS $B"))||!queries("CREATE VIEW $B AS $cj[select]"))return
     6600move_tables($S,$fj,$ci){$Pg=array();foreach(array_merge($S,$fj)as$Q)$Pg[]=table($Q)." TO ".idf_escape($ci).".".table($Q);return
     6601queries("RENAME TABLE ".implode(", ",$Pg));}function
     6602copy_tables($S,$fj,$ci){queries("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");foreach($S
     6603as$Q){$B=($ci==DB?table("copy_$Q"):idf_escape($ci).".".table($Q));if(($_POST["overwrite"]&&!queries("\nDROP TABLE IF EXISTS $B"))||!queries("CREATE TABLE $B LIKE ".table($Q))||!queries("INSERT INTO $B SELECT * FROM ".table($Q)))return
     6604false;foreach(get_rows("SHOW TRIGGERS LIKE ".q(addcslashes($Q,"%_\\")))as$I){$Bi=$I["Trigger"];if(!queries("CREATE TRIGGER ".($ci==DB?idf_escape("copy_$Bi"):idf_escape($ci).".".idf_escape($Bi))." $I[Timing] $I[Event] ON $B FOR EACH ROW\n$I[Statement];"))return
     6605false;}}foreach($fj
     6606as$Q){$B=($ci==DB?table("copy_$Q"):idf_escape($ci).".".table($Q));$ej=view($Q);if(($_POST["overwrite"]&&!queries("DROP VIEW IF EXISTS $B"))||!queries("CREATE VIEW $B AS $ej[select]"))return
    65816607false;}return
    65826608true;}function
     
    65876613trigger_options(){return
    65886614array("Timing"=>array("BEFORE","AFTER"),"Event"=>array("INSERT","UPDATE","DELETE"),"Type"=>array("FOR EACH ROW"),);}function
    6589 routine($B,$T){global$h,$yc,$Td,$U;$Da=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$_h="(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";$Ei="((".implode("|",array_merge(array_keys($U),$Da)).")\\b(?:\\s*\\(((?:[^'\")]|$yc)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";$dg="$_h*(".($T=="FUNCTION"?"":$Td).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ei";$Gb=$h->result("SHOW CREATE $T ".idf_escape($B),2);preg_match("~\\(((?:$dg\\s*,?)*)\\)\\s*".($T=="FUNCTION"?"RETURNS\\s+$Ei\\s+":"")."(.*)~is",$Gb,$A);$p=array();preg_match_all("~$dg\\s*,?~is",$A[1],$Ge,PREG_SET_ORDER);foreach($Ge
    6590 as$Qf)$p[]=array("field"=>str_replace("``","`",$Qf[2]).$Qf[3],"type"=>strtolower($Qf[5]),"length"=>preg_replace_callback("~$yc~s",'normalize_enum',$Qf[6]),"unsigned"=>strtolower(preg_replace('~\s+~',' ',trim("$Qf[8] $Qf[7]"))),"null"=>1,"full_type"=>$Qf[4],"inout"=>strtoupper($Qf[1]),"collation"=>strtolower($Qf[9]),);if($T!="FUNCTION")return
     6615routine($B,$T){global$h,$_c,$Vd,$U;$Da=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Bh="(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";$Gi="((".implode("|",array_merge(array_keys($U),$Da)).")\\b(?:\\s*\\(((?:[^'\")]|$_c)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";$fg="$Bh*(".($T=="FUNCTION"?"":$Vd).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Gi";$Hb=$h->result("SHOW CREATE $T ".idf_escape($B),2);preg_match("~\\(((?:$fg\\s*,?)*)\\)\\s*".($T=="FUNCTION"?"RETURNS\\s+$Gi\\s+":"")."(.*)~is",$Hb,$A);$p=array();preg_match_all("~$fg\\s*,?~is",$A[1],$Ie,PREG_SET_ORDER);foreach($Ie
     6616as$Sf)$p[]=array("field"=>str_replace("``","`",$Sf[2]).$Sf[3],"type"=>strtolower($Sf[5]),"length"=>preg_replace_callback("~$_c~s",'normalize_enum',$Sf[6]),"unsigned"=>strtolower(preg_replace('~\s+~',' ',trim("$Sf[8] $Sf[7]"))),"null"=>1,"full_type"=>$Sf[4],"inout"=>strtoupper($Sf[1]),"collation"=>strtolower($Sf[9]),);if($T!="FUNCTION")return
    65916617array("fields"=>$p,"definition"=>$A[11]);return
    65926618array("fields"=>$p,"returns"=>array("type"=>$A[12],"length"=>$A[13],"unsigned"=>$A[15],"collation"=>$A[16]),"definition"=>$A[17],"language"=>"SQL",);}function
     
    66056631array();}function
    66066632get_schema(){return"";}function
    6607 set_schema($dh,$i=null){return
     6633set_schema($fh,$i=null){return
    66086634true;}function
    6609 create_sql($Q,$Na,$Lh){global$h;$H=$h->result("SHOW CREATE TABLE ".table($Q),1);if(!$Na)$H=preg_replace('~ AUTO_INCREMENT=\d+~','',$H);return$H;}function
     6635create_sql($Q,$Na,$Nh){global$h;$H=$h->result("SHOW CREATE TABLE ".table($Q),1);if(!$Na)$H=preg_replace('~ AUTO_INCREMENT=\d+~','',$H);return$H;}function
    66106636truncate_sql($Q){return"TRUNCATE ".table($Q);}function
    66116637use_sql($j){return"USE ".idf_escape($j);}function
     
    66196645convert_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(min_version(8)?"ST_":"")."AsWKT(".idf_escape($o["field"]).")";}function
    66206646unconvert_field($o,$H){if(preg_match("~binary~",$o["type"]))$H="UNHEX($H)";if($o["type"]=="bit")$H="CONV($H, 2, 10) + 0";if(preg_match("~geometry|point|linestring|polygon~",$o["type"]))$H=(min_version(8)?"ST_":"")."GeomFromText($H, SRID($o[field]))";return$H;}function
    6621 support($Rc){return!preg_match("~scheme|sequence|type|view_trigger|materializedview".(min_version(8)?"":"|descidx".(min_version(5.1)?"":"|event|partitioning".(min_version(5)?"":"|routine|trigger|view")))."~",$Rc);}function
     6647support($Tc){return!preg_match("~scheme|sequence|type|view_trigger|materializedview".(min_version(8)?"":"|descidx".(min_version(5.1)?"":"|event|partitioning".(min_version(5)?"":"|routine|trigger|view")))."~",$Tc);}function
    66226648kill_process($X){return
    66236649queries("KILL ".number($X));}function
    66246650connection_id(){return"SELECT CONNECTION_ID()";}function
    6625 max_connections(){global$h;return$h->result("SELECT @@max_connections");}$x="sql";$U=array();$Kh=array();foreach(array(lang(27)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(28)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(25)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(33)=>array("enum"=>65535,"set"=>64),lang(29)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(31)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$y=>$X){$U+=$X;$Kh[$y]=array_keys($X);}$Li=array("unsigned","zerofill","unsigned zerofill");$yf=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","FIND_IN_SET","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$md=array("char_length","date","from_unixtime","lower","round","floor","ceil","sec_to_time","time_to_sec","upper");$sd=array("avg","count","count distinct","group_concat","max","min","sum");$oc=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array(number_type()=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",str_replace(":","%3a",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.7.5";class
     6651max_connections(){global$h;return$h->result("SELECT @@max_connections");}$x="sql";$U=array();$Mh=array();foreach(array(lang(27)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(28)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(25)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(33)=>array("enum"=>65535,"set"=>64),lang(29)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(31)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$y=>$X){$U+=$X;$Mh[$y]=array_keys($X);}$Ni=array("unsigned","zerofill","unsigned zerofill");$_f=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","FIND_IN_SET","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$od=array("char_length","date","from_unixtime","lower","round","floor","ceil","sec_to_time","time_to_sec","upper");$ud=array("avg","count","count distinct","group_concat","max","min","sum");$qc=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array(number_type()=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",str_replace(":","%3a",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.7.6";class
    66266652Adminer{var$operators;function
    66276653name(){return"<a href='https://www.adminer.org/'".target_blank()." id='h1'>Adminer</a>";}function
     
    66296655array(SERVER,$_GET["username"],get_password());}function
    66306656connectSsl(){}function
    6631 permanentLogin($Gb=false){return
    6632 password_file($Gb);}function
     6657permanentLogin($Hb=false){return
     6658password_file($Hb);}function
    66336659bruteForceKey(){return$_SERVER["REMOTE_ADDR"];}function
    66346660serverName($M){return
     
    66366662database(){return
    66376663DB;}function
    6638 databases($cd=true){return
    6639 get_databases($cd);}function
     6664databases($ed=true){return
     6665get_databases($ed);}function
    66406666schemas(){return
    66416667schemas();}function
     
    66476673head(){return
    66486674true;}function
    6649 css(){$H=array();$Wc="adminer.css";if(file_exists($Wc))$H[]="$Wc?v=".crc32(file_get_contents($Wc));return$H;}function
    6650 loginForm(){global$gc;echo"<table cellspacing='0' class='layout'>\n",$this->loginFormField('driver','<tr><th>'.lang(34).'<td>',html_select("auth[driver]",$gc,DRIVER,"loginDriver(this);")."\n"),$this->loginFormField('server','<tr><th>'.lang(35).'<td>','<input name="auth[server]" value="'.h(SERVER).'" title="hostname[:port]" placeholder="localhost" autocapitalize="off">'."\n"),$this->loginFormField('username','<tr><th>'.lang(36).'<td>','<input name="auth[username]" id="username" value="'.h($_GET["username"]).'" autocomplete="username" autocapitalize="off">'.script("focus(qs('#username')); qs('#username').form['auth[driver]'].onchange();")),$this->loginFormField('password','<tr><th>'.lang(37).'<td>','<input type="password" name="auth[password]" autocomplete="current-password">'."\n"),$this->loginFormField('db','<tr><th>'.lang(38).'<td>','<input name="auth[db]" value="'.h($_GET["db"]).'" autocapitalize="off">'."\n"),"</table>\n","<p><input type='submit' value='".lang(39)."'>\n",checkbox("auth[permanent]",1,$_COOKIE["adminer_permanent"],lang(40))."\n";}function
    6651 loginFormField($B,$zd,$Y){return$zd.$Y;}function
    6652 login($Ae,$E){if($E=="")return
     6675css(){$H=array();$Yc="adminer.css";if(file_exists($Yc))$H[]="$Yc?v=".crc32(file_get_contents($Yc));return$H;}function
     6676loginForm(){global$ic;echo"<table cellspacing='0' class='layout'>\n",$this->loginFormField('driver','<tr><th>'.lang(34).'<td>',html_select("auth[driver]",$ic,DRIVER,"loginDriver(this);")."\n"),$this->loginFormField('server','<tr><th>'.lang(35).'<td>','<input name="auth[server]" value="'.h(SERVER).'" title="hostname[:port]" placeholder="localhost" autocapitalize="off">'."\n"),$this->loginFormField('username','<tr><th>'.lang(36).'<td>','<input name="auth[username]" id="username" value="'.h($_GET["username"]).'" autocomplete="username" autocapitalize="off">'.script("focus(qs('#username')); qs('#username').form['auth[driver]'].onchange();")),$this->loginFormField('password','<tr><th>'.lang(37).'<td>','<input type="password" name="auth[password]" autocomplete="current-password">'."\n"),$this->loginFormField('db','<tr><th>'.lang(38).'<td>','<input name="auth[db]" value="'.h($_GET["db"]).'" autocapitalize="off">'."\n"),"</table>\n","<p><input type='submit' value='".lang(39)."'>\n",checkbox("auth[permanent]",1,$_COOKIE["adminer_permanent"],lang(40))."\n";}function
     6677loginFormField($B,$Ad,$Y){return$Ad.$Y;}function
     6678login($Ce,$E){if($E=="")return
    66536679lang(41,target_blank());return
    66546680true;}function
    6655 tableName($Rh){return
    6656 h($Rh["Name"]);}function
    6657 fieldName($o,$Cf=0){return'<span title="'.h($o["full_type"]).'">'.h($o["field"]).'</span>';}function
    6658 selectLinks($Rh,$N=""){global$x,$m;echo'<p class="links">';$ze=array("select"=>lang(42));if(support("table")||support("indexes"))$ze["table"]=lang(43);if(support("table")){if(is_view($Rh))$ze["view"]=lang(44);else$ze["create"]=lang(45);}if($N!==null)$ze["edit"]=lang(46);$B=$Rh["Name"];foreach($ze
     6681tableName($Th){return
     6682h($Th["Name"]);}function
     6683fieldName($o,$Ef=0){return'<span title="'.h($o["full_type"]).'">'.h($o["field"]).'</span>';}function
     6684selectLinks($Th,$N=""){global$x,$m;echo'<p class="links">';$Ae=array("select"=>lang(42));if(support("table")||support("indexes"))$Ae["table"]=lang(43);if(support("table")){if(is_view($Th))$Ae["view"]=lang(44);else$Ae["create"]=lang(45);}if($N!==null)$Ae["edit"]=lang(46);$B=$Th["Name"];foreach($Ae
    66596685as$y=>$X)echo" <a href='".h(ME)."$y=".urlencode($B).($y=="edit"?$N:"")."'".bold(isset($_GET[$y])).">$X</a>";echo
    66606686doc_link(array($x=>$m->tableHelp($B)),"?"),"\n";}function
    66616687foreignKeys($Q){return
    66626688foreign_keys($Q);}function
    6663 backwardKeys($Q,$Qh){return
     6689backwardKeys($Q,$Sh){return
    66646690array();}function
    66656691backwardKeysPrint($Qa,$I){}function
    6666 selectQuery($F,$Gh,$Pc=false){global$x,$m;$H="</p>\n";if(!$Pc&&($gj=$m->warnings())){$t="warnings";$H=", <a href='#$t'>".lang(47)."</a>".script("qsl('a').onclick = partial(toggle, '$t');","")."$H<div id='$t' class='hidden'>\n$gj</div>\n";}return"<p><code class='jush-$x'>".h(str_replace("\n"," ",$F))."</code> <span class='time'>(".format_time($Gh).")</span>".(support("sql")?" <a href='".h(ME)."sql=".urlencode($F)."'>".lang(10)."</a>":"").$H;}function
     6692selectQuery($F,$Ih,$Rc=false){global$x,$m;$H="</p>\n";if(!$Rc&&($ij=$m->warnings())){$t="warnings";$H=", <a href='#$t'>".lang(47)."</a>".script("qsl('a').onclick = partial(toggle, '$t');","")."$H<div id='$t' class='hidden'>\n$ij</div>\n";}return"<p><code class='jush-$x'>".h(str_replace("\n"," ",$F))."</code> <span class='time'>(".format_time($Ih).")</span>".(support("sql")?" <a href='".h(ME)."sql=".urlencode($F)."'>".lang(10)."</a>":"").$H;}function
    66676693sqlCommandQuery($F){return
    66686694shorten_utf8(trim($F),1000);}function
    66696695rowDescription($Q){return"";}function
    6670 rowDescriptions($J,$fd){return$J;}function
     6696rowDescriptions($J,$hd){return$J;}function
    66716697selectLink($X,$o){}function
    6672 selectVal($X,$_,$o,$Kf){$H=($X===null?"<i>NULL</i>":(preg_match("~char|binary|boolean~",$o["type"])&&!preg_match("~var~",$o["type"])?"<code>$X</code>":$X));if(preg_match('~blob|bytea|raw|file~',$o["type"])&&!isutf8($X))$H="<i>".lang(48,strlen($Kf))."</i>";if(preg_match('~json~',$o["type"]))$H="<code class='jush-js'>$H</code>";return($_?"<a href='".h($_)."'".(is_url($_)?target_blank():"").">$H</a>":$H);}function
     6698selectVal($X,$_,$o,$Mf){$H=($X===null?"<i>NULL</i>":(preg_match("~char|binary|boolean~",$o["type"])&&!preg_match("~var~",$o["type"])?"<code>$X</code>":$X));if(preg_match('~blob|bytea|raw|file~',$o["type"])&&!isutf8($X))$H="<i>".lang(48,strlen($Mf))."</i>";if(preg_match('~json~',$o["type"]))$H="<code class='jush-js'>$H</code>";return($_?"<a href='".h($_)."'".(is_url($_)?target_blank():"").">$H</a>":$H);}function
    66736699editVal($X,$o){return$X;}function
    66746700tableStructurePrint($p){echo"<div class='scrollable'>\n","<table cellspacing='0' class='nowrap'>\n","<thead><tr><th>".lang(49)."<td>".lang(50).(support("comment")?"<td>".lang(51):"")."</thead>\n";foreach($p
    66756701as$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(52)."</i>":""),(isset($o["default"])?" <span title='".lang(53)."'>[<b>".h($o["default"])."</b>]</span>":""),(support("comment")?"<td>".h($o["comment"]):""),"\n";}echo"</table>\n","</div>\n";}function
    66766702tableIndexesPrint($w){echo"<table cellspacing='0'>\n";foreach($w
    6677 as$B=>$v){ksort($v["columns"]);$pg=array();foreach($v["columns"]as$y=>$X)$pg[]="<i>".h($X)."</i>".($v["lengths"][$y]?"(".$v["lengths"][$y].")":"").($v["descs"][$y]?" DESC":"");echo"<tr title='".h($B)."'><th>$v[type]<td>".implode(", ",$pg)."\n";}echo"</table>\n";}function
    6678 selectColumnsPrint($K,$f){global$md,$sd;print_fieldset("select",lang(54),$K);$s=0;$K[""]=array();foreach($K
    6679 as$y=>$X){$X=$_GET["columns"][$y];$e=select_input(" name='columns[$s][col]'",$f,$X["col"],($y!==""?"selectFieldChange":"selectAddRow"));echo"<div>".($md||$sd?"<select name='columns[$s][fun]'>".optionlist(array(-1=>"")+array_filter(array(lang(55)=>$md,lang(56)=>$sd)),$X["fun"])."</select>".on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'",1).script("qsl('select').onchange = function () { helpClose();".($y!==""?"":" qsl('select, input', this.parentNode).onchange();")." };","")."($e)":$e)."</div>\n";$s++;}echo"</div></fieldset>\n";}function
     6703as$B=>$v){ksort($v["columns"]);$rg=array();foreach($v["columns"]as$y=>$X)$rg[]="<i>".h($X)."</i>".($v["lengths"][$y]?"(".$v["lengths"][$y].")":"").($v["descs"][$y]?" DESC":"");echo"<tr title='".h($B)."'><th>$v[type]<td>".implode(", ",$rg)."\n";}echo"</table>\n";}function
     6704selectColumnsPrint($K,$f){global$od,$ud;print_fieldset("select",lang(54),$K);$s=0;$K[""]=array();foreach($K
     6705as$y=>$X){$X=$_GET["columns"][$y];$e=select_input(" name='columns[$s][col]'",$f,$X["col"],($y!==""?"selectFieldChange":"selectAddRow"));echo"<div>".($od||$ud?"<select name='columns[$s][fun]'>".optionlist(array(-1=>"")+array_filter(array(lang(55)=>$od,lang(56)=>$ud)),$X["fun"])."</select>".on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'",1).script("qsl('select').onchange = function () { helpClose();".($y!==""?"":" qsl('select, input', this.parentNode).onchange();")." };","")."($e)":$e)."</div>\n";$s++;}echo"</div></fieldset>\n";}function
    66806706selectSearchPrint($Z,$f,$w){print_fieldset("search",lang(57),$Z);foreach($w
    66816707as$s=>$v){if($v["type"]=="FULLTEXT"){echo"<div>(<i>".implode("</i>, <i>",array_map('h',$v["columns"]))."</i>) AGAINST"," <input type='search' name='fulltext[$s]' value='".h($_GET["fulltext"][$s])."'>",script("qsl('input').oninput = selectFieldChange;",""),checkbox("boolean[$s]",1,isset($_GET["boolean"][$s]),"BOOL"),"</div>\n";}}$cb="this.parentNode.firstChild.onchange();";foreach(array_merge((array)$_GET["where"],array(array()))as$s=>$X){if(!$X||("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators))){echo"<div>".select_input(" name='where[$s][col]'",$f,$X["col"],($X?"selectFieldChange":"selectAddRow"),"(".lang(58).")"),html_select("where[$s][op]",$this->operators,$X["op"],$cb),"<input type='search' name='where[$s][val]' value='".h($X["val"])."'>",script("mixin(qsl('input'), {oninput: function () { $cb }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});",""),"</div>\n";}}echo"</div></fieldset>\n";}function
    6682 selectOrderPrint($Cf,$f,$w){print_fieldset("sort",lang(59),$Cf);$s=0;foreach((array)$_GET["order"]as$y=>$X){if($X!=""){echo"<div>".select_input(" name='order[$s]'",$f,$X,"selectFieldChange"),checkbox("desc[$s]",1,isset($_GET["desc"][$y]),lang(60))."</div>\n";$s++;}}echo"<div>".select_input(" name='order[$s]'",$f,"","selectAddRow"),checkbox("desc[$s]",1,false,lang(60))."</div>\n","</div></fieldset>\n";}function
     6708selectOrderPrint($Ef,$f,$w){print_fieldset("sort",lang(59),$Ef);$s=0;foreach((array)$_GET["order"]as$y=>$X){if($X!=""){echo"<div>".select_input(" name='order[$s]'",$f,$X,"selectFieldChange"),checkbox("desc[$s]",1,isset($_GET["desc"][$y]),lang(60))."</div>\n";$s++;}}echo"<div>".select_input(" name='order[$s]'",$f,"","selectAddRow"),checkbox("desc[$s]",1,false,lang(60))."</div>\n","</div></fieldset>\n";}function
    66836709selectLimitPrint($z){echo"<fieldset><legend>".lang(61)."</legend><div>";echo"<input type='number' name='limit' class='size' value='".h($z)."'>",script("qsl('input').oninput = selectFieldChange;",""),"</div></fieldset>\n";}function
    6684 selectLengthPrint($gi){if($gi!==null){echo"<fieldset><legend>".lang(62)."</legend><div>","<input type='number' name='text_length' class='size' value='".h($gi)."'>","</div></fieldset>\n";}}function
     6710selectLengthPrint($ii){if($ii!==null){echo"<fieldset><legend>".lang(62)."</legend><div>","<input type='number' name='text_length' class='size' value='".h($ii)."'>","</div></fieldset>\n";}}function
    66856711selectActionPrint($w){echo"<fieldset><legend>".lang(63)."</legend><div>","<input type='submit' value='".lang(54)."'>"," <span id='noindex' title='".lang(64)."'></span>","<script".nonce().">\n","var indexColumns = ";$f=array();foreach($w
    6686 as$v){$Nb=reset($v["columns"]);if($v["type"]!="FULLTEXT"&&$Nb)$f[$Nb]=1;}$f[""]=1;foreach($f
     6712as$v){$Ob=reset($v["columns"]);if($v["type"]!="FULLTEXT"&&$Ob)$f[$Ob]=1;}$f[""]=1;foreach($f
    66876713as$y=>$X)json_row($y);echo";\n","selectFieldChange.call(qs('#form')['select']);\n","</script>\n","</div></fieldset>\n";}function
    66886714selectCommandPrint(){return!information_schema(DB);}function
    66896715selectImportPrint(){return!information_schema(DB);}function
    6690 selectEmailPrint($tc,$f){}function
    6691 selectColumnsProcess($f,$w){global$md,$sd;$K=array();$pd=array();foreach((array)$_GET["columns"]as$y=>$X){if($X["fun"]=="count"||($X["col"]!=""&&(!$X["fun"]||in_array($X["fun"],$md)||in_array($X["fun"],$sd)))){$K[$y]=apply_sql_function($X["fun"],($X["col"]!=""?idf_escape($X["col"]):"*"));if(!in_array($X["fun"],$sd))$pd[]=$K[$y];}}return
    6692 array($K,$pd);}function
     6716selectEmailPrint($vc,$f){}function
     6717selectColumnsProcess($f,$w){global$od,$ud;$K=array();$rd=array();foreach((array)$_GET["columns"]as$y=>$X){if($X["fun"]=="count"||($X["col"]!=""&&(!$X["fun"]||in_array($X["fun"],$od)||in_array($X["fun"],$ud)))){$K[$y]=apply_sql_function($X["fun"],($X["col"]!=""?idf_escape($X["col"]):"*"));if(!in_array($X["fun"],$ud))$rd[]=$K[$y];}}return
     6718array($K,$rd);}function
    66936719selectSearchProcess($p,$w){global$h,$m;$H=array();foreach($w
    6694 as$s=>$v){if($v["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$H[]="MATCH (".implode(", ",array_map('idf_escape',$v["columns"])).") AGAINST (".q($_GET["fulltext"][$s]).(isset($_GET["boolean"][$s])?" IN BOOLEAN MODE":"").")";}foreach((array)$_GET["where"]as$y=>$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$lg="";$xb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$Jd=process_length($X["val"]);$xb.=" ".($Jd!=""?$Jd:"(NULL)");}elseif($X["op"]=="SQL")$xb=" $X[val]";elseif($X["op"]=="LIKE %%")$xb=" LIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif($X["op"]=="ILIKE %%")$xb=" ILIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif($X["op"]=="FIND_IN_SET"){$lg="$X[op](".q($X["val"]).", ";$xb=")";}elseif(!preg_match('~NULL$~',$X["op"]))$xb.=" ".$this->processInput($p[$X["col"]],$X["val"]);if($X["col"]!="")$H[]=$lg.$m->convertSearch(idf_escape($X["col"]),$X,$p[$X["col"]]).$xb;else{$sb=array();foreach($p
    6695 as$B=>$o){if((preg_match('~^[-\d.'.(preg_match('~IN$~',$X["op"])?',':'').']+$~',$X["val"])||!preg_match('~'.number_type().'|bit~',$o["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||preg_match('~char|text|enum|set~',$o["type"])))$sb[]=$lg.$m->convertSearch(idf_escape($B),$X,$o).$xb;}$H[]=($sb?"(".implode(" OR ",$sb).")":"1 = 0");}}}return$H;}function
     6720as$s=>$v){if($v["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$H[]="MATCH (".implode(", ",array_map('idf_escape',$v["columns"])).") AGAINST (".q($_GET["fulltext"][$s]).(isset($_GET["boolean"][$s])?" IN BOOLEAN MODE":"").")";}foreach((array)$_GET["where"]as$y=>$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$ng="";$yb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$Ld=process_length($X["val"]);$yb.=" ".($Ld!=""?$Ld:"(NULL)");}elseif($X["op"]=="SQL")$yb=" $X[val]";elseif($X["op"]=="LIKE %%")$yb=" LIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif($X["op"]=="ILIKE %%")$yb=" ILIKE ".$this->processInput($p[$X["col"]],"%$X[val]%");elseif($X["op"]=="FIND_IN_SET"){$ng="$X[op](".q($X["val"]).", ";$yb=")";}elseif(!preg_match('~NULL$~',$X["op"]))$yb.=" ".$this->processInput($p[$X["col"]],$X["val"]);if($X["col"]!="")$H[]=$ng.$m->convertSearch(idf_escape($X["col"]),$X,$p[$X["col"]]).$yb;else{$sb=array();foreach($p
     6721as$B=>$o){if((preg_match('~^[-\d.'.(preg_match('~IN$~',$X["op"])?',':'').']+$~',$X["val"])||!preg_match('~'.number_type().'|bit~',$o["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||preg_match('~char|text|enum|set~',$o["type"])))$sb[]=$ng.$m->convertSearch(idf_escape($B),$X,$o).$yb;}$H[]=($sb?"(".implode(" OR ",$sb).")":"1 = 0");}}}return$H;}function
    66966722selectOrderProcess($p,$w){$H=array();foreach((array)$_GET["order"]as$y=>$X){if($X!="")$H[]=(preg_match('~^((COUNT\(DISTINCT |[A-Z0-9_]+\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\)|COUNT\(\*\))$~',$X)?$X:idf_escape($X)).(isset($_GET["desc"][$y])?" DESC":"");}return$H;}function
    66976723selectLimitProcess(){return(isset($_GET["limit"])?$_GET["limit"]:"50");}function
    66986724selectLengthProcess(){return(isset($_GET["text_length"])?$_GET["text_length"]:"100");}function
    6699 selectEmailProcess($Z,$fd){return
     6725selectEmailProcess($Z,$hd){return
    67006726false;}function
    6701 selectQueryBuild($K,$Z,$pd,$Cf,$z,$D){return"";}function
    6702 messageQuery($F,$hi,$Pc=false){global$x,$m;restart_session();$_d=&get_session("queries");if(!$_d[$_GET["db"]])$_d[$_GET["db"]]=array();if(strlen($F)>1e6)$F=preg_replace('~[\x80-\xFF]+$~','',substr($F,0,1e6))."\n…";$_d[$_GET["db"]][]=array($F,time(),$hi);$Dh="sql-".count($_d[$_GET["db"]]);$H="<a href='#$Dh' class='toggle'>".lang(65)."</a>\n";if(!$Pc&&($gj=$m->warnings())){$t="warnings-".count($_d[$_GET["db"]]);$H="<a href='#$t' class='toggle'>".lang(47)."</a>, $H<div id='$t' class='hidden'>\n$gj</div>\n";}return" <span class='time'>".@date("H:i:s")."</span>"." $H<div id='$Dh' class='hidden'><pre><code class='jush-$x'>".shorten_utf8($F,1000)."</code></pre>".($hi?" <span class='time'>($hi)</span>":'').(support("sql")?'<p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($_d[$_GET["db"]])-1)).'">'.lang(10).'</a>':'').'</div>';}function
    6703 editFunctions($o){global$oc;$H=($o["null"]?"NULL/":"");foreach($oc
    6704 as$y=>$md){if(!$y||(!isset($_GET["call"])&&(isset($_GET["select"])||where($_GET)))){foreach($md
    6705 as$dg=>$X){if(!$dg||preg_match("~$dg~",$o["type"]))$H.="/$X";}if($y&&!preg_match('~set|blob|bytea|raw|file~',$o["type"]))$H.="/SQL";}}if($o["auto_increment"]&&!isset($_GET["select"])&&!where($_GET))$H=lang(52);return
     6727selectQueryBuild($K,$Z,$rd,$Ef,$z,$D){return"";}function
     6728messageQuery($F,$ji,$Rc=false){global$x,$m;restart_session();$Bd=&get_session("queries");if(!$Bd[$_GET["db"]])$Bd[$_GET["db"]]=array();if(strlen($F)>1e6)$F=preg_replace('~[\x80-\xFF]+$~','',substr($F,0,1e6))."\n…";$Bd[$_GET["db"]][]=array($F,time(),$ji);$Fh="sql-".count($Bd[$_GET["db"]]);$H="<a href='#$Fh' class='toggle'>".lang(65)."</a>\n";if(!$Rc&&($ij=$m->warnings())){$t="warnings-".count($Bd[$_GET["db"]]);$H="<a href='#$t' class='toggle'>".lang(47)."</a>, $H<div id='$t' class='hidden'>\n$ij</div>\n";}return" <span class='time'>".@date("H:i:s")."</span>"." $H<div id='$Fh' class='hidden'><pre><code class='jush-$x'>".shorten_utf8($F,1000)."</code></pre>".($ji?" <span class='time'>($ji)</span>":'').(support("sql")?'<p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($Bd[$_GET["db"]])-1)).'">'.lang(10).'</a>':'').'</div>';}function
     6729editFunctions($o){global$qc;$H=($o["null"]?"NULL/":"");foreach($qc
     6730as$y=>$od){if(!$y||(!isset($_GET["call"])&&(isset($_GET["select"])||where($_GET)))){foreach($od
     6731as$fg=>$X){if(!$fg||preg_match("~$fg~",$o["type"]))$H.="/$X";}if($y&&!preg_match('~set|blob|bytea|raw|file~',$o["type"]))$H.="/SQL";}}if($o["auto_increment"]&&!isset($_GET["select"])&&!where($_GET))$H=lang(52);return
    67066732explode("/",$H);}function
    67076733editInput($Q,$o,$Ka,$Y){if($o["type"]=="enum")return(isset($_GET["select"])?"<label><input type='radio'$Ka value='-1' checked><i>".lang(8)."</i></label> ":"").($o["null"]?"<label><input type='radio'$Ka value=''".($Y!==null||isset($_GET["select"])?"":" checked")."><i>NULL</i></label> ":"").enum_input("radio",$Ka,$o,$Y,0);return"";}function
     
    67136739array('sql'=>'SQL','csv'=>'CSV,','csv;'=>'CSV;','tsv'=>'TSV');}function
    67146740dumpDatabase($l){}function
    6715 dumpTable($Q,$Lh,$ce=0){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($Lh)dump_csv(array_keys(fields($Q)));}else{if($ce==2){$p=array();foreach(fields($Q)as$B=>$o)$p[]=idf_escape($B)." $o[full_type]";$Gb="CREATE TABLE ".table($Q)." (".implode(", ",$p).")";}else$Gb=create_sql($Q,$_POST["auto_increment"],$Lh);set_utf8mb4($Gb);if($Lh&&$Gb){if($Lh=="DROP+CREATE"||$ce==1)echo"DROP ".($ce==2?"VIEW":"TABLE")." IF EXISTS ".table($Q).";\n";if($ce==1)$Gb=remove_definer($Gb);echo"$Gb;\n\n";}}}function
    6716 dumpData($Q,$Lh,$F){global$h,$x;$Ie=($x=="sqlite"?0:1048576);if($Lh){if($_POST["format"]=="sql"){if($Lh=="TRUNCATE+INSERT")echo
    6717 truncate_sql($Q).";\n";$p=fields($Q);}$G=$h->query($F,1);if($G){$Vd="";$Za="";$je=array();$Nh="";$Sc=($Q!=''?'fetch_assoc':'fetch_row');while($I=$G->$Sc()){if(!$je){$Yi=array();foreach($I
    6718 as$X){$o=$G->fetch_field();$je[]=$o->name;$y=idf_escape($o->name);$Yi[]="$y = VALUES($y)";}$Nh=($Lh=="INSERT+UPDATE"?"\nON DUPLICATE KEY UPDATE ".implode(", ",$Yi):"").";\n";}if($_POST["format"]!="sql"){if($Lh=="table"){dump_csv($je);$Lh="INSERT";}dump_csv($I);}else{if(!$Vd)$Vd="INSERT INTO ".table($Q)." (".implode(", ",array_map('idf_escape',$je)).") VALUES";foreach($I
    6719 as$y=>$X){$o=$p[$y];$I[$y]=($X!==null?unconvert_field($o,preg_match(number_type(),$o["type"])&&!preg_match('~\[~',$o["full_type"])&&is_numeric($X)?$X:q(($X===false?0:$X))):"NULL");}$bh=($Ie?"\n":" ")."(".implode(",\t",$I).")";if(!$Za)$Za=$Vd.$bh;elseif(strlen($Za)+4+strlen($bh)+strlen($Nh)<$Ie)$Za.=",$bh";else{echo$Za.$Nh;$Za=$Vd.$bh;}}}if($Za)echo$Za.$Nh;}elseif($_POST["format"]=="sql")echo"-- ".str_replace("\n"," ",$h->error)."\n";}}function
    6720 dumpFilename($Ed){return
    6721 friendly_url($Ed!=""?$Ed:(SERVER!=""?SERVER:"localhost"));}function
    6722 dumpHeaders($Ed,$Xe=false){$Nf=$_POST["output"];$Kc=(preg_match('~sql~',$_POST["format"])?"sql":($Xe?"tar":"csv"));header("Content-Type: ".($Nf=="gz"?"application/x-gzip":($Kc=="tar"?"application/x-tar":($Kc=="sql"||$Nf!="file"?"text/plain":"text/csv")."; charset=utf-8")));if($Nf=="gz")ob_start('ob_gzencode',1e6);return$Kc;}function
     6741dumpTable($Q,$Nh,$ee=0){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($Nh)dump_csv(array_keys(fields($Q)));}else{if($ee==2){$p=array();foreach(fields($Q)as$B=>$o)$p[]=idf_escape($B)." $o[full_type]";$Hb="CREATE TABLE ".table($Q)." (".implode(", ",$p).")";}else$Hb=create_sql($Q,$_POST["auto_increment"],$Nh);set_utf8mb4($Hb);if($Nh&&$Hb){if($Nh=="DROP+CREATE"||$ee==1)echo"DROP ".($ee==2?"VIEW":"TABLE")." IF EXISTS ".table($Q).";\n";if($ee==1)$Hb=remove_definer($Hb);echo"$Hb;\n\n";}}}function
     6742dumpData($Q,$Nh,$F){global$h,$x;$Ke=($x=="sqlite"?0:1048576);if($Nh){if($_POST["format"]=="sql"){if($Nh=="TRUNCATE+INSERT")echo
     6743truncate_sql($Q).";\n";$p=fields($Q);}$G=$h->query($F,1);if($G){$Xd="";$Za="";$le=array();$Ph="";$Uc=($Q!=''?'fetch_assoc':'fetch_row');while($I=$G->$Uc()){if(!$le){$aj=array();foreach($I
     6744as$X){$o=$G->fetch_field();$le[]=$o->name;$y=idf_escape($o->name);$aj[]="$y = VALUES($y)";}$Ph=($Nh=="INSERT+UPDATE"?"\nON DUPLICATE KEY UPDATE ".implode(", ",$aj):"").";\n";}if($_POST["format"]!="sql"){if($Nh=="table"){dump_csv($le);$Nh="INSERT";}dump_csv($I);}else{if(!$Xd)$Xd="INSERT INTO ".table($Q)." (".implode(", ",array_map('idf_escape',$le)).") VALUES";foreach($I
     6745as$y=>$X){$o=$p[$y];$I[$y]=($X!==null?unconvert_field($o,preg_match(number_type(),$o["type"])&&!preg_match('~\[~',$o["full_type"])&&is_numeric($X)?$X:q(($X===false?0:$X))):"NULL");}$dh=($Ke?"\n":" ")."(".implode(",\t",$I).")";if(!$Za)$Za=$Xd.$dh;elseif(strlen($Za)+4+strlen($dh)+strlen($Ph)<$Ke)$Za.=",$dh";else{echo$Za.$Ph;$Za=$Xd.$dh;}}}if($Za)echo$Za.$Ph;}elseif($_POST["format"]=="sql")echo"-- ".str_replace("\n"," ",$h->error)."\n";}}function
     6746dumpFilename($Gd){return
     6747friendly_url($Gd!=""?$Gd:(SERVER!=""?SERVER:"localhost"));}function
     6748dumpHeaders($Gd,$Ze=false){$Pf=$_POST["output"];$Mc=(preg_match('~sql~',$_POST["format"])?"sql":($Ze?"tar":"csv"));header("Content-Type: ".($Pf=="gz"?"application/x-gzip":($Mc=="tar"?"application/x-tar":($Mc=="sql"||$Pf!="file"?"text/plain":"text/csv")."; charset=utf-8")));if($Pf=="gz")ob_start('ob_gzencode',1e6);return$Mc;}function
    67236749importServerPath(){return"adminer.sql";}function
    67246750homepage(){echo'<p class="links">'.($_GET["ns"]==""&&support("database")?'<a href="'.h(ME).'database=">'.lang(68)."</a>\n":""),(support("scheme")?"<a href='".h(ME)."scheme='>".($_GET["ns"]!=""?lang(69):lang(70))."</a>\n":""),($_GET["ns"]!==""?'<a href="'.h(ME).'schema=">'.lang(71)."</a>\n":""),(support("privileges")?"<a href='".h(ME)."privileges='>".lang(72)."</a>\n":"");return
    67256751true;}function
    6726 navigation($We){global$ia,$x,$gc,$h;echo'<h1>
     6752navigation($Ye){global$ia,$x,$ic,$h;echo'<h1>
    67276753',$this->name(),' <span class="version">',$ia,'</span>
    67286754<a href="https://www.adminer.org/#download"',target_blank(),' id="version">',(version_compare($ia,$_COOKIE["adminer_version"])<0?h($_COOKIE["adminer_version"]):""),'</a>
    67296755</h1>
    6730 ';if($We=="auth"){$Nf="";foreach((array)$_SESSION["pwds"]as$aj=>$ph){foreach($ph
    6731 as$M=>$Vi){foreach($Vi
    6732 as$V=>$E){if($E!==null){$Tb=$_SESSION["db"][$aj][$M][$V];foreach(($Tb?array_keys($Tb):array(""))as$l)$Nf.="<li><a href='".h(auth_url($aj,$M,$V,$l))."'>($gc[$aj]) ".h($V.($M!=""?"@".$this->serverName($M):"").($l!=""?" - $l":""))."</a>\n";}}}}if($Nf)echo"<ul id='logins'>\n$Nf</ul>\n".script("mixin(qs('#logins'), {onmouseover: menuOver, onmouseout: menuOut});");}else{if($_GET["ns"]!==""&&!$We&&DB!=""){$h->select_db(DB);$S=table_status('',true);}echo
    6733 script_src(preg_replace("~\\?.*~","",ME)."?file=jush.js&version=4.7.5");if(support("sql")){echo'<script',nonce(),'>
    6734 ';if($S){$ze=array();foreach($S
    6735 as$Q=>$T)$ze[]=preg_quote($Q,'/');echo"var jushLinks = { $x: [ '".js_escape(ME).(support("table")?"table=":"select=")."\$&', /\\b(".implode("|",$ze).")\\b/g ] };\n";foreach(array("bac","bra","sqlite_quo","mssql_bra")as$X)echo"jushLinks.$X = jushLinks.$x;\n";}$oh=$h->server_info;echo'bodyLoad(\'',(is_object($h)?preg_replace('~^(\d\.?\d).*~s','\1',$oh):""),'\'',(preg_match('~MariaDB~',$oh)?", true":""),');
     6756';if($Ye=="auth"){$Pf="";foreach((array)$_SESSION["pwds"]as$cj=>$rh){foreach($rh
     6757as$M=>$Xi){foreach($Xi
     6758as$V=>$E){if($E!==null){$Ub=$_SESSION["db"][$cj][$M][$V];foreach(($Ub?array_keys($Ub):array(""))as$l)$Pf.="<li><a href='".h(auth_url($cj,$M,$V,$l))."'>($ic[$cj]) ".h($V.($M!=""?"@".$this->serverName($M):"").($l!=""?" - $l":""))."</a>\n";}}}}if($Pf)echo"<ul id='logins'>\n$Pf</ul>\n".script("mixin(qs('#logins'), {onmouseover: menuOver, onmouseout: menuOut});");}else{if($_GET["ns"]!==""&&!$Ye&&DB!=""){$h->select_db(DB);$S=table_status('',true);}echo
     6759script_src(preg_replace("~\\?.*~","",ME)."?file=jush.js&version=4.7.6");if(support("sql")){echo'<script',nonce(),'>
     6760';if($S){$Ae=array();foreach($S
     6761as$Q=>$T)$Ae[]=preg_quote($Q,'/');echo"var jushLinks = { $x: [ '".js_escape(ME).(support("table")?"table=":"select=")."\$&', /\\b(".implode("|",$Ae).")\\b/g ] };\n";foreach(array("bac","bra","sqlite_quo","mssql_bra")as$X)echo"jushLinks.$X = jushLinks.$x;\n";}$qh=$h->server_info;echo'bodyLoad(\'',(is_object($h)?preg_replace('~^(\d\.?\d).*~s','\1',$qh):""),'\'',(preg_match('~MariaDB~',$qh)?", true":""),');
    67366762</script>
    6737 ';}$this->databasesPrint($We);if(DB==""||!$We){echo"<p class='links'>".(support("sql")?"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])&&!isset($_GET["import"])).">".lang(65)."</a>\n<a href='".h(ME)."import='".bold(isset($_GET["import"])).">".lang(73)."</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(74)."</a>\n";}if($_GET["ns"]!==""&&!$We&&DB!=""){echo'<a href="'.h(ME).'create="'.bold($_GET["create"]==="").">".lang(75)."</a>\n";if(!$S)echo"<p class='message'>".lang(9)."\n";else$this->tablesPrint($S);}}}function
    6738 databasesPrint($We){global$b,$h;$k=$this->databases();if($k&&!in_array(DB,$k))array_unshift($k,DB);echo'<form action="">
     6763';}$this->databasesPrint($Ye);if(DB==""||!$Ye){echo"<p class='links'>".(support("sql")?"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])&&!isset($_GET["import"])).">".lang(65)."</a>\n<a href='".h(ME)."import='".bold(isset($_GET["import"])).">".lang(73)."</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(74)."</a>\n";}if($_GET["ns"]!==""&&!$Ye&&DB!=""){echo'<a href="'.h(ME).'create="'.bold($_GET["create"]==="").">".lang(75)."</a>\n";if(!$S)echo"<p class='message'>".lang(9)."\n";else$this->tablesPrint($S);}}}function
     6764databasesPrint($Ye){global$b,$h;$k=$this->databases();if($k&&!in_array(DB,$k))array_unshift($k,DB);echo'<form action="">
    67396765<p id="dbs">
    6740 ';hidden_fields_get();$Rb=script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});");echo"<span title='".lang(76)."'>".lang(77)."</span>: ".($k?"<select name='db'>".optionlist(array(""=>"")+$k,DB)."</select>$Rb":"<input name='db' value='".h(DB)."' autocapitalize='off'>\n"),"<input type='submit' value='".lang(20)."'".($k?" class='hidden'":"").">\n";if($We!="db"&&DB!=""&&$h->select_db(DB)){if(support("scheme")){echo"<br>".lang(78).": <select name='ns'>".optionlist(array(""=>"")+$b->schemas(),$_GET["ns"])."</select>$Rb";if($_GET["ns"]!="")set_schema($_GET["ns"]);}}foreach(array("import","sql","schema","dump","privileges")as$X){if(isset($_GET[$X])){echo"<input type='hidden' name='$X' value=''>";break;}}echo"</p></form>\n";}function
     6766';hidden_fields_get();$Sb=script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});");echo"<span title='".lang(76)."'>".lang(77)."</span>: ".($k?"<select name='db'>".optionlist(array(""=>"")+$k,DB)."</select>$Sb":"<input name='db' value='".h(DB)."' autocapitalize='off'>\n"),"<input type='submit' value='".lang(20)."'".($k?" class='hidden'":"").">\n";if($Ye!="db"&&DB!=""&&$h->select_db(DB)){if(support("scheme")){echo"<br>".lang(78).": <select name='ns'>".optionlist(array(""=>"")+$b->schemas(),$_GET["ns"])."</select>$Sb";if($_GET["ns"]!="")set_schema($_GET["ns"]);}}foreach(array("import","sql","schema","dump","privileges")as$X){if(isset($_GET[$X])){echo"<input type='hidden' name='$X' value=''>";break;}}echo"</p></form>\n";}function
    67416767tablesPrint($S){echo"<ul id='tables'>".script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");foreach($S
    67426768as$Q=>$O){$B=$this->tableName($O);if($B!=""){echo'<li><a href="'.h(ME).'select='.urlencode($Q).'"'.bold($_GET["select"]==$Q||$_GET["edit"]==$Q,"select").">".lang(79)."</a> ",(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($O)?"view":"structure"))." title='".lang(43)."'>$B</a>":"<span>$B</span>")."\n";}}echo"</ul>\n";}}$b=(function_exists('adminer_object')?adminer_object():new
    6743 Adminer);if($b->operators===null)$b->operators=$yf;function
    6744 page_header($ki,$n="",$Ya=array(),$li=""){global$ca,$ia,$b,$gc,$x;page_headers();if(is_ajax()&&$n){page_messages($n);exit;}$mi=$ki.($li!=""?": $li":"");$ni=strip_tags($mi.(SERVER!=""&&SERVER!="localhost"?h(" - ".SERVER):"")." - ".$b->name());echo'<!DOCTYPE html>
     6769Adminer);if($b->operators===null)$b->operators=$_f;function
     6770page_header($mi,$n="",$Ya=array(),$ni=""){global$ca,$ia,$b,$ic,$x;page_headers();if(is_ajax()&&$n){page_messages($n);exit;}$oi=$mi.($ni!=""?": $ni":"");$pi=strip_tags($oi.(SERVER!=""&&SERVER!="localhost"?h(" - ".SERVER):"")." - ".$b->name());echo'<!DOCTYPE html>
    67456771<html lang="',$ca,'" dir="',lang(80),'">
    67466772<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    67476773<meta name="robots" content="noindex">
    6748 <title>',$ni,'</title>
    6749 <link rel="stylesheet" type="text/css" href="',h(preg_replace("~\\?.*~","",ME)."?file=default.css&version=4.7.5"),'">
    6750 ',script_src(preg_replace("~\\?.*~","",ME)."?file=functions.js&version=4.7.5");if($b->head()){echo'<link rel="shortcut icon" type="image/x-icon" href="',h(preg_replace("~\\?.*~","",ME)."?file=favicon.ico&version=4.7.5"),'">
    6751 <link rel="apple-touch-icon" href="',h(preg_replace("~\\?.*~","",ME)."?file=favicon.ico&version=4.7.5"),'">
    6752 ';foreach($b->css()as$Lb){echo'<link rel="stylesheet" type="text/css" href="',h($Lb),'">
     6774<title>',$pi,'</title>
     6775<link rel="stylesheet" type="text/css" href="',h(preg_replace("~\\?.*~","",ME)."?file=default.css&version=4.7.6"),'">
     6776',script_src(preg_replace("~\\?.*~","",ME)."?file=functions.js&version=4.7.6");if($b->head()){echo'<link rel="shortcut icon" type="image/x-icon" href="',h(preg_replace("~\\?.*~","",ME)."?file=favicon.ico&version=4.7.6"),'">
     6777<link rel="apple-touch-icon" href="',h(preg_replace("~\\?.*~","",ME)."?file=favicon.ico&version=4.7.6"),'">
     6778';foreach($b->css()as$Mb){echo'<link rel="stylesheet" type="text/css" href="',h($Mb),'">
    67536779';}}echo'
    67546780<body class="',lang(80),' nojs">
    6755 ';$Wc=get_temp_dir()."/adminer.version";if(!$_COOKIE["adminer_version"]&&function_exists('openssl_verify')&&file_exists($Wc)&&filemtime($Wc)+86400>time()){$bj=unserialize(file_get_contents($Wc));$wg="-----BEGIN PUBLIC KEY-----
     6781';$Yc=get_temp_dir()."/adminer.version";if(!$_COOKIE["adminer_version"]&&function_exists('openssl_verify')&&file_exists($Yc)&&filemtime($Yc)+86400>time()){$dj=unserialize(file_get_contents($Yc));$yg="-----BEGIN PUBLIC KEY-----
    67566782MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7/+Z70djoK
    67576783RlHIZFZPO0uYRezq90+7Amk+FDNd7KkL5eDve+vHRJBLAszF/7XKXe11xwliIsFs
     
    67626788fQIDAQAB
    67636789-----END PUBLIC KEY-----
    6764 ";if(openssl_verify($bj["version"],base64_decode($bj["signature"]),$wg)==1)$_COOKIE["adminer_version"]=$bj["version"];}echo'<script',nonce(),'>
     6790";if(openssl_verify($dj["version"],base64_decode($dj["signature"]),$yg)==1)$_COOKIE["adminer_version"]=$dj["version"];}echo'<script',nonce(),'>
    67656791mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick',(isset($_COOKIE["adminer_version"])?"":", onload: partial(verifyVersion, '$ia', '".js_escape(ME)."', '".get_token()."')");?>});
    67666792document.body.className = document.body.className.replace(/ nojs/, ' js');
     
    67736799',script("mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});"),'
    67746800<div id="content">
    6775 ';if($Ya!==null){$_=substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$gc[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~\b(db|ns)=[^&]*&~','',ME),0,-1);$M=$b->serverName(SERVER);$M=($M!=""?$M:lang(35));if($Ya===false)echo"$M\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$M</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ya)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ya)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ya
    6776 as$y=>$X){$Zb=(is_array($X)?$X[1]:h($X));if($Zb!="")echo"<a href='".h(ME."$y=").urlencode(is_array($X)?$X[0]:$X)."'>$Zb</a> &raquo; ";}}echo"$ki\n";}}echo"<h2>$mi</h2>\n","<div id='ajaxstatus' class='jsonly hidden'></div>\n";restart_session();page_messages($n);$k=&get_session("dbs");if(DB!=""&&$k&&!in_array(DB,$k,true))$k=null;stop_session();define("PAGE_HEADER",1);}function
    6777 page_headers(){global$b;header("Content-Type: text/html; charset=utf-8");header("Cache-Control: no-cache");header("X-Frame-Options: deny");header("X-XSS-Protection: 0");header("X-Content-Type-Options: nosniff");header("Referrer-Policy: origin-when-cross-origin");foreach($b->csp()as$Kb){$yd=array();foreach($Kb
    6778 as$y=>$X)$yd[]="$y $X";header("Content-Security-Policy: ".implode("; ",$yd));}$b->headers();}function
     6801';if($Ya!==null){$_=substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$ic[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~\b(db|ns)=[^&]*&~','',ME),0,-1);$M=$b->serverName(SERVER);$M=($M!=""?$M:lang(35));if($Ya===false)echo"$M\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$M</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ya)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ya)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ya
     6802as$y=>$X){$bc=(is_array($X)?$X[1]:h($X));if($bc!="")echo"<a href='".h(ME."$y=").urlencode(is_array($X)?$X[0]:$X)."'>$bc</a> &raquo; ";}}echo"$mi\n";}}echo"<h2>$oi</h2>\n","<div id='ajaxstatus' class='jsonly hidden'></div>\n";restart_session();page_messages($n);$k=&get_session("dbs");if(DB!=""&&$k&&!in_array(DB,$k,true))$k=null;stop_session();define("PAGE_HEADER",1);}function
     6803page_headers(){global$b;header("Content-Type: text/html; charset=utf-8");header("Cache-Control: no-cache");header("X-Frame-Options: deny");header("X-XSS-Protection: 0");header("X-Content-Type-Options: nosniff");header("Referrer-Policy: origin-when-cross-origin");foreach($b->csp()as$Lb){$_d=array();foreach($Lb
     6804as$y=>$X)$_d[]="$y $X";header("Content-Security-Policy: ".implode("; ",$_d));}$b->headers();}function
    67796805csp(){return
    67806806array(array("script-src"=>"'self' 'unsafe-inline' 'nonce-".get_nonce()."' 'strict-dynamic'","connect-src"=>"'self'","frame-src"=>"https://www.adminer.org","object-src"=>"'none'","base-uri"=>"'none'","form-action"=>"'self'",),);}function
    6781 get_nonce(){static$gf;if(!$gf)$gf=base64_encode(rand_string());return$gf;}function
    6782 page_messages($n){$Ni=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$Se=$_SESSION["messages"][$Ni];if($Se){echo"<div class='message'>".implode("</div>\n<div class='message'>",$Se)."</div>".script("messagesPrint();");unset($_SESSION["messages"][$Ni]);}if($n)echo"<div class='error'>$n</div>\n";}function
    6783 page_footer($We=""){global$b,$ri;echo'</div>
    6784 
    6785 ';switch_lang();if($We!="auth"){echo'<form action="" method="post">
     6807get_nonce(){static$if;if(!$if)$if=base64_encode(rand_string());return$if;}function
     6808page_messages($n){$Pi=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$Ue=$_SESSION["messages"][$Pi];if($Ue){echo"<div class='message'>".implode("</div>\n<div class='message'>",$Ue)."</div>".script("messagesPrint();");unset($_SESSION["messages"][$Pi]);}if($n)echo"<div class='error'>$n</div>\n";}function
     6809page_footer($Ye=""){global$b,$ti;echo'</div>
     6810
     6811';switch_lang();if($Ye!="auth"){echo'<form action="" method="post">
    67866812<p class="logout">
    67876813<input type="submit" name="logout" value="',lang(82),'" id="logout">
    6788 <input type="hidden" name="token" value="',$ri,'">
     6814<input type="hidden" name="token" value="',$ti,'">
    67896815</p>
    67906816</form>
    67916817';}echo'<div id="menu">
    6792 ';$b->navigation($We);echo'</div>
     6818';$b->navigation($Ye);echo'</div>
    67936819',script("setupSubmitHighlight(document);");}function
    6794 int32($Ze){while($Ze>=2147483648)$Ze-=4294967296;while($Ze<=-2147483649)$Ze+=4294967296;return(int)$Ze;}function
    6795 long2str($W,$fj){$bh='';foreach($W
    6796 as$X)$bh.=pack('V',$X);if($fj)return
    6797 substr($bh,0,end($W));return$bh;}function
    6798 str2long($bh,$fj){$W=array_values(unpack('V*',str_pad($bh,4*ceil(strlen($bh)/4),"\0")));if($fj)$W[]=strlen($bh);return$W;}function
    6799 xxtea_mx($sj,$rj,$Oh,$fe){return
    6800 int32((($sj>>5&0x7FFFFFF)^$rj<<2)+(($rj>>3&0x1FFFFFFF)^$sj<<4))^int32(($Oh^$rj)+($fe^$sj));}function
    6801 encrypt_string($Jh,$y){if($Jh=="")return"";$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Jh,true);$Ze=count($W)-1;$sj=$W[$Ze];$rj=$W[0];$xg=floor(6+52/($Ze+1));$Oh=0;while($xg-->0){$Oh=int32($Oh+0x9E3779B9);$nc=$Oh>>2&3;for($Of=0;$Of<$Ze;$Of++){$rj=$W[$Of+1];$Ye=xxtea_mx($sj,$rj,$Oh,$y[$Of&3^$nc]);$sj=int32($W[$Of]+$Ye);$W[$Of]=$sj;}$rj=$W[0];$Ye=xxtea_mx($sj,$rj,$Oh,$y[$Of&3^$nc]);$sj=int32($W[$Ze]+$Ye);$W[$Ze]=$sj;}return
     6820int32($bf){while($bf>=2147483648)$bf-=4294967296;while($bf<=-2147483649)$bf+=4294967296;return(int)$bf;}function
     6821long2str($W,$hj){$dh='';foreach($W
     6822as$X)$dh.=pack('V',$X);if($hj)return
     6823substr($dh,0,end($W));return$dh;}function
     6824str2long($dh,$hj){$W=array_values(unpack('V*',str_pad($dh,4*ceil(strlen($dh)/4),"\0")));if($hj)$W[]=strlen($dh);return$W;}function
     6825xxtea_mx($uj,$tj,$Qh,$he){return
     6826int32((($uj>>5&0x7FFFFFF)^$tj<<2)+(($tj>>3&0x1FFFFFFF)^$uj<<4))^int32(($Qh^$tj)+($he^$uj));}function
     6827encrypt_string($Lh,$y){if($Lh=="")return"";$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Lh,true);$bf=count($W)-1;$uj=$W[$bf];$tj=$W[0];$zg=floor(6+52/($bf+1));$Qh=0;while($zg-->0){$Qh=int32($Qh+0x9E3779B9);$pc=$Qh>>2&3;for($Qf=0;$Qf<$bf;$Qf++){$tj=$W[$Qf+1];$af=xxtea_mx($uj,$tj,$Qh,$y[$Qf&3^$pc]);$uj=int32($W[$Qf]+$af);$W[$Qf]=$uj;}$tj=$W[0];$af=xxtea_mx($uj,$tj,$Qh,$y[$Qf&3^$pc]);$uj=int32($W[$bf]+$af);$W[$bf]=$uj;}return
    68026828long2str($W,false);}function
    6803 decrypt_string($Jh,$y){if($Jh=="")return"";if(!$y)return
    6804 false;$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Jh,false);$Ze=count($W)-1;$sj=$W[$Ze];$rj=$W[0];$xg=floor(6+52/($Ze+1));$Oh=int32($xg*0x9E3779B9);while($Oh){$nc=$Oh>>2&3;for($Of=$Ze;$Of>0;$Of--){$sj=$W[$Of-1];$Ye=xxtea_mx($sj,$rj,$Oh,$y[$Of&3^$nc]);$rj=int32($W[$Of]-$Ye);$W[$Of]=$rj;}$sj=$W[$Ze];$Ye=xxtea_mx($sj,$rj,$Oh,$y[$Of&3^$nc]);$rj=int32($W[0]-$Ye);$W[0]=$rj;$Oh=int32($Oh-0x9E3779B9);}return
    6805 long2str($W,true);}$h='';$xd=$_SESSION["token"];if(!$xd)$_SESSION["token"]=rand(1,1e6);$ri=get_token();$eg=array();if($_COOKIE["adminer_permanent"]){foreach(explode(" ",$_COOKIE["adminer_permanent"])as$X){list($y)=explode(":",$X);$eg[$y]=$X;}}function
    6806 add_invalid_login(){global$b;$kd=file_open_lock(get_temp_dir()."/adminer.invalid");if(!$kd)return;$Yd=unserialize(stream_get_contents($kd));$hi=time();if($Yd){foreach($Yd
    6807 as$Zd=>$X){if($X[0]<$hi)unset($Yd[$Zd]);}}$Xd=&$Yd[$b->bruteForceKey()];if(!$Xd)$Xd=array($hi+30*60,0);$Xd[1]++;file_write_unlock($kd,serialize($Yd));}function
    6808 check_invalid_login(){global$b;$Yd=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$Xd=$Yd[$b->bruteForceKey()];$ff=($Xd[1]>29?$Xd[0]-time():0);if($ff>0)auth_error(lang(83,ceil($ff/60)));}$La=$_POST["auth"];if($La){session_regenerate_id();$aj=$La["driver"];$M=$La["server"];$V=$La["username"];$E=(string)$La["password"];$l=$La["db"];set_password($aj,$M,$V,$E);$_SESSION["db"][$aj][$M][$V][$l]=true;if($La["permanent"]){$y=base64_encode($aj)."-".base64_encode($M)."-".base64_encode($V)."-".base64_encode($l);$qg=$b->permanentLogin(true);$eg[$y]="$y:".base64_encode($qg?encrypt_string($E,$qg):"");cookie("adminer_permanent",implode(" ",$eg));}if(count($_POST)==1||DRIVER!=$aj||SERVER!=$M||$_GET["username"]!==$V||DB!=$l)redirect(auth_url($aj,$M,$V,$l));}elseif($_POST["logout"]){if($xd&&!verify_token()){page_header(lang(82),lang(84));page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$y)set_session($y,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),lang(85).' '.lang(86));}}elseif($eg&&!$_SESSION["pwds"]){session_regenerate_id();$qg=$b->permanentLogin();foreach($eg
    6809 as$y=>$X){list(,$kb)=explode(":",$X);list($aj,$M,$V,$l)=array_map('base64_decode',explode("-",$y));set_password($aj,$M,$V,decrypt_string(base64_decode($kb),$qg));$_SESSION["db"][$aj][$M][$V][$l]=true;}}function
    6810 unset_permanent(){global$eg;foreach($eg
    6811 as$y=>$X){list($aj,$M,$V,$l)=array_map('base64_decode',explode("-",$y));if($aj==DRIVER&&$M==SERVER&&$V==$_GET["username"]&&$l==DB)unset($eg[$y]);}cookie("adminer_permanent",implode(" ",$eg));}function
    6812 auth_error($n){global$b,$xd;$qh=session_name();if(isset($_GET["username"])){header("HTTP/1.1 403 Forbidden");if(($_COOKIE[$qh]||$_GET[$qh])&&!$xd)$n=lang(87);else{restart_session();add_invalid_login();$E=get_password();if($E!==null){if($E===false)$n.='<br>'.lang(88,target_blank(),'<code>permanentLogin()</code>');set_password(DRIVER,SERVER,$_GET["username"],null);}unset_permanent();}}if(!$_COOKIE[$qh]&&$_GET[$qh]&&ini_bool("session.use_only_cookies"))$n=lang(89);$Rf=session_get_cookie_params();cookie("adminer_key",($_COOKIE["adminer_key"]?$_COOKIE["adminer_key"]:rand_string()),$Rf["lifetime"]);page_header(lang(39),$n,null);echo"<form action='' method='post'>\n","<div>";if(hidden_fields($_POST,array("auth")))echo"<p class='message'>".lang(90)."\n";echo"</div>\n";$b->loginForm();echo"</form>\n";page_footer("auth");exit;}if(isset($_GET["username"])&&!class_exists("Min_DB")){unset($_SESSION["pwds"][DRIVER]);unset_permanent();page_header(lang(91),lang(92,implode(", ",$kg)),false);page_footer("auth");exit;}stop_session(true);if(isset($_GET["username"])&&is_string(get_password())){list($Cd,$gg)=explode(":",SERVER,2);if(is_numeric($gg)&&$gg<1024)auth_error(lang(93));check_invalid_login();$h=connect();$m=new
    6813 Min_Driver($h);}$Ae=null;if(!is_object($h)||($Ae=$b->login($_GET["username"],get_password()))!==true){$n=(is_string($h)?h($h):(is_string($Ae)?$Ae:lang(94)));auth_error($n.(preg_match('~^ | $~',get_password())?'<br>'.lang(95):''));}if($La&&$_POST["token"])$_POST["token"]=$ri;$n='';if($_POST){if(!verify_token()){$Sd="max_input_vars";$Me=ini_get($Sd);if(extension_loaded("suhosin")){foreach(array("suhosin.request.max_vars","suhosin.post.max_vars")as$y){$X=ini_get($y);if($X&&(!$Me||$X<$Me)){$Sd=$y;$Me=$X;}}}$n=(!$_POST["token"]&&$Me?lang(96,"'$Sd'"):lang(84).' '.lang(97));}}elseif($_SERVER["REQUEST_METHOD"]=="POST"){$n=lang(98,"'post_max_size'");if(isset($_GET["sql"]))$n.=' '.lang(99);}function
    6814 select($G,$i=null,$Ff=array(),$z=0){global$x;$ze=array();$w=array();$f=array();$Va=array();$U=array();$H=array();odd('');for($s=0;(!$z||$s<$z)&&($I=$G->fetch_row());$s++){if(!$s){echo"<div class='scrollable'>\n","<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($ee=0;$ee<count($I);$ee++){$o=$G->fetch_field();$B=$o->name;$Ef=$o->orgtable;$Df=$o->orgname;$H[$o->table]=$Ef;if($Ff&&$x=="sql")$ze[$ee]=($B=="table"?"table=":($B=="possible_keys"?"indexes=":null));elseif($Ef!=""){if(!isset($w[$Ef])){$w[$Ef]=array();foreach(indexes($Ef,$i)as$v){if($v["type"]=="PRIMARY"){$w[$Ef]=array_flip($v["columns"]);break;}}$f[$Ef]=$w[$Ef];}if(isset($f[$Ef][$Df])){unset($f[$Ef][$Df]);$w[$Ef][$Df]=$ee;$ze[$ee]=$Ef;}}if($o->charsetnr==63)$Va[$ee]=true;$U[$ee]=$o->type;echo"<th".($Ef!=""||$o->name!=$Df?" title='".h(($Ef!=""?"$Ef.":"").$Df)."'":"").">".h($B).($Ff?doc_link(array('sql'=>"explain-output.html#explain_".strtolower($B),'mariadb'=>"explain/#the-columns-in-explain-select",)):"");}echo"</thead>\n";}echo"<tr".odd().">";foreach($I
    6815 as$y=>$X){if($X===null)$X="<i>NULL</i>";elseif($Va[$y]&&!isutf8($X))$X="<i>".lang(48,strlen($X))."</i>";else{$X=h($X);if($U[$y]==254)$X="<code>$X</code>";}if(isset($ze[$y])&&!$f[$ze[$y]]){if($Ff&&$x=="sql"){$Q=$I[array_search("table=",$ze)];$_=$ze[$y].urlencode($Ff[$Q]!=""?$Ff[$Q]:$Q);}else{$_="edit=".urlencode($ze[$y]);foreach($w[$ze[$y]]as$ob=>$ee)$_.="&where".urlencode("[".bracket_escape($ob)."]")."=".urlencode($I[$ee]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>\n</div>":"<p class='message'>".lang(12))."\n";return$H;}function
    6816 referencable_primary($kh){$H=array();foreach(table_status('',true)as$Sh=>$Q){if($Sh!=$kh&&fk_support($Q)){foreach(fields($Sh)as$o){if($o["primary"]){if($H[$Sh]){unset($H[$Sh]);break;}$H[$Sh]=$o;}}}}return$H;}function
    6817 adminer_settings(){parse_str($_COOKIE["adminer_settings"],$sh);return$sh;}function
    6818 adminer_setting($y){$sh=adminer_settings();return$sh[$y];}function
    6819 set_adminer_settings($sh){return
    6820 cookie("adminer_settings",http_build_query($sh+adminer_settings()));}function
     6829decrypt_string($Lh,$y){if($Lh=="")return"";if(!$y)return
     6830false;$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Lh,false);$bf=count($W)-1;$uj=$W[$bf];$tj=$W[0];$zg=floor(6+52/($bf+1));$Qh=int32($zg*0x9E3779B9);while($Qh){$pc=$Qh>>2&3;for($Qf=$bf;$Qf>0;$Qf--){$uj=$W[$Qf-1];$af=xxtea_mx($uj,$tj,$Qh,$y[$Qf&3^$pc]);$tj=int32($W[$Qf]-$af);$W[$Qf]=$tj;}$uj=$W[$bf];$af=xxtea_mx($uj,$tj,$Qh,$y[$Qf&3^$pc]);$tj=int32($W[0]-$af);$W[0]=$tj;$Qh=int32($Qh-0x9E3779B9);}return
     6831long2str($W,true);}$h='';$zd=$_SESSION["token"];if(!$zd)$_SESSION["token"]=rand(1,1e6);$ti=get_token();$gg=array();if($_COOKIE["adminer_permanent"]){foreach(explode(" ",$_COOKIE["adminer_permanent"])as$X){list($y)=explode(":",$X);$gg[$y]=$X;}}function
     6832add_invalid_login(){global$b;$md=file_open_lock(get_temp_dir()."/adminer.invalid");if(!$md)return;$ae=unserialize(stream_get_contents($md));$ji=time();if($ae){foreach($ae
     6833as$be=>$X){if($X[0]<$ji)unset($ae[$be]);}}$Zd=&$ae[$b->bruteForceKey()];if(!$Zd)$Zd=array($ji+30*60,0);$Zd[1]++;file_write_unlock($md,serialize($ae));}function
     6834check_invalid_login(){global$b;$ae=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$Zd=$ae[$b->bruteForceKey()];$hf=($Zd[1]>29?$Zd[0]-time():0);if($hf>0)auth_error(lang(83,ceil($hf/60)));}$La=$_POST["auth"];if($La){session_regenerate_id();$cj=$La["driver"];$M=$La["server"];$V=$La["username"];$E=(string)$La["password"];$l=$La["db"];set_password($cj,$M,$V,$E);$_SESSION["db"][$cj][$M][$V][$l]=true;if($La["permanent"]){$y=base64_encode($cj)."-".base64_encode($M)."-".base64_encode($V)."-".base64_encode($l);$sg=$b->permanentLogin(true);$gg[$y]="$y:".base64_encode($sg?encrypt_string($E,$sg):"");cookie("adminer_permanent",implode(" ",$gg));}if(count($_POST)==1||DRIVER!=$cj||SERVER!=$M||$_GET["username"]!==$V||DB!=$l)redirect(auth_url($cj,$M,$V,$l));}elseif($_POST["logout"]){if($zd&&!verify_token()){page_header(lang(82),lang(84));page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$y)set_session($y,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),lang(85).' '.lang(86));}}elseif($gg&&!$_SESSION["pwds"]){session_regenerate_id();$sg=$b->permanentLogin();foreach($gg
     6835as$y=>$X){list(,$kb)=explode(":",$X);list($cj,$M,$V,$l)=array_map('base64_decode',explode("-",$y));set_password($cj,$M,$V,decrypt_string(base64_decode($kb),$sg));$_SESSION["db"][$cj][$M][$V][$l]=true;}}function
     6836unset_permanent(){global$gg;foreach($gg
     6837as$y=>$X){list($cj,$M,$V,$l)=array_map('base64_decode',explode("-",$y));if($cj==DRIVER&&$M==SERVER&&$V==$_GET["username"]&&$l==DB)unset($gg[$y]);}cookie("adminer_permanent",implode(" ",$gg));}function
     6838auth_error($n){global$b,$zd;$sh=session_name();if(isset($_GET["username"])){header("HTTP/1.1 403 Forbidden");if(($_COOKIE[$sh]||$_GET[$sh])&&!$zd)$n=lang(87);else{restart_session();add_invalid_login();$E=get_password();if($E!==null){if($E===false)$n.='<br>'.lang(88,target_blank(),'<code>permanentLogin()</code>');set_password(DRIVER,SERVER,$_GET["username"],null);}unset_permanent();}}if(!$_COOKIE[$sh]&&$_GET[$sh]&&ini_bool("session.use_only_cookies"))$n=lang(89);$Tf=session_get_cookie_params();cookie("adminer_key",($_COOKIE["adminer_key"]?$_COOKIE["adminer_key"]:rand_string()),$Tf["lifetime"]);page_header(lang(39),$n,null);echo"<form action='' method='post'>\n","<div>";if(hidden_fields($_POST,array("auth")))echo"<p class='message'>".lang(90)."\n";echo"</div>\n";$b->loginForm();echo"</form>\n";page_footer("auth");exit;}if(isset($_GET["username"])&&!class_exists("Min_DB")){unset($_SESSION["pwds"][DRIVER]);unset_permanent();page_header(lang(91),lang(92,implode(", ",$mg)),false);page_footer("auth");exit;}stop_session(true);if(isset($_GET["username"])&&is_string(get_password())){list($Ed,$ig)=explode(":",SERVER,2);if(is_numeric($ig)&&($ig<1024||$ig>65535))auth_error(lang(93));check_invalid_login();$h=connect();$m=new
     6839Min_Driver($h);}$Ce=null;if(!is_object($h)||($Ce=$b->login($_GET["username"],get_password()))!==true){$n=(is_string($h)?h($h):(is_string($Ce)?$Ce:lang(94)));auth_error($n.(preg_match('~^ | $~',get_password())?'<br>'.lang(95):''));}if($La&&$_POST["token"])$_POST["token"]=$ti;$n='';if($_POST){if(!verify_token()){$Ud="max_input_vars";$Oe=ini_get($Ud);if(extension_loaded("suhosin")){foreach(array("suhosin.request.max_vars","suhosin.post.max_vars")as$y){$X=ini_get($y);if($X&&(!$Oe||$X<$Oe)){$Ud=$y;$Oe=$X;}}}$n=(!$_POST["token"]&&$Oe?lang(96,"'$Ud'"):lang(84).' '.lang(97));}}elseif($_SERVER["REQUEST_METHOD"]=="POST"){$n=lang(98,"'post_max_size'");if(isset($_GET["sql"]))$n.=' '.lang(99);}function
     6840select($G,$i=null,$Hf=array(),$z=0){global$x;$Ae=array();$w=array();$f=array();$Va=array();$U=array();$H=array();odd('');for($s=0;(!$z||$s<$z)&&($I=$G->fetch_row());$s++){if(!$s){echo"<div class='scrollable'>\n","<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($ge=0;$ge<count($I);$ge++){$o=$G->fetch_field();$B=$o->name;$Gf=$o->orgtable;$Ff=$o->orgname;$H[$o->table]=$Gf;if($Hf&&$x=="sql")$Ae[$ge]=($B=="table"?"table=":($B=="possible_keys"?"indexes=":null));elseif($Gf!=""){if(!isset($w[$Gf])){$w[$Gf]=array();foreach(indexes($Gf,$i)as$v){if($v["type"]=="PRIMARY"){$w[$Gf]=array_flip($v["columns"]);break;}}$f[$Gf]=$w[$Gf];}if(isset($f[$Gf][$Ff])){unset($f[$Gf][$Ff]);$w[$Gf][$Ff]=$ge;$Ae[$ge]=$Gf;}}if($o->charsetnr==63)$Va[$ge]=true;$U[$ge]=$o->type;echo"<th".($Gf!=""||$o->name!=$Ff?" title='".h(($Gf!=""?"$Gf.":"").$Ff)."'":"").">".h($B).($Hf?doc_link(array('sql'=>"explain-output.html#explain_".strtolower($B),'mariadb'=>"explain/#the-columns-in-explain-select",)):"");}echo"</thead>\n";}echo"<tr".odd().">";foreach($I
     6841as$y=>$X){if($X===null)$X="<i>NULL</i>";elseif($Va[$y]&&!isutf8($X))$X="<i>".lang(48,strlen($X))."</i>";else{$X=h($X);if($U[$y]==254)$X="<code>$X</code>";}if(isset($Ae[$y])&&!$f[$Ae[$y]]){if($Hf&&$x=="sql"){$Q=$I[array_search("table=",$Ae)];$_=$Ae[$y].urlencode($Hf[$Q]!=""?$Hf[$Q]:$Q);}else{$_="edit=".urlencode($Ae[$y]);foreach($w[$Ae[$y]]as$ob=>$ge)$_.="&where".urlencode("[".bracket_escape($ob)."]")."=".urlencode($I[$ge]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>\n</div>":"<p class='message'>".lang(12))."\n";return$H;}function
     6842referencable_primary($mh){$H=array();foreach(table_status('',true)as$Uh=>$Q){if($Uh!=$mh&&fk_support($Q)){foreach(fields($Uh)as$o){if($o["primary"]){if($H[$Uh]){unset($H[$Uh]);break;}$H[$Uh]=$o;}}}}return$H;}function
     6843adminer_settings(){parse_str($_COOKIE["adminer_settings"],$uh);return$uh;}function
     6844adminer_setting($y){$uh=adminer_settings();return$uh[$y];}function
     6845set_adminer_settings($uh){return
     6846cookie("adminer_settings",http_build_query($uh+adminer_settings()));}function
    68216847textarea($B,$Y,$J=10,$sb=80){global$x;echo"<textarea name='$B' rows='$J' cols='$sb' class='sqlarea jush-$x' spellcheck='false' wrap='off'>";if(is_array($Y)){foreach($Y
    68226848as$X)echo
     
    68246850echo
    68256851h($Y);echo"</textarea>";}function
    6826 edit_type($y,$o,$qb,$gd=array(),$Nc=array()){global$Kh,$U,$Li,$tf;$T=$o["type"];echo'<td><select name="',h($y),'[type]" class="type" aria-labelledby="label-type">';if($T&&!isset($U[$T])&&!isset($gd[$T])&&!in_array($T,$Nc))$Nc[]=$T;if($gd)$Kh[lang(100)]=$gd;echo
    6827 optionlist(array_merge($Nc,$Kh),$T),'</select>',on_help("getTarget(event).value",1),script("mixin(qsl('select'), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});",""),'<td><input name="',h($y),'[length]" value="',h($o["length"]),'" size="3"',(!$o["length"]&&preg_match('~var(char|binary)$~',$T)?" class='required'":"");echo' aria-labelledby="label-length">',script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});",""),'<td class="options">',"<select name='".h($y)."[collation]'".(preg_match('~(char|text|enum|set)$~',$T)?"":" class='hidden'").'><option value="">('.lang(101).')'.optionlist($qb,$o["collation"]).'</select>',($Li?"<select name='".h($y)."[unsigned]'".(!$T||preg_match(number_type(),$T)?"":" class='hidden'").'><option>'.optionlist($Li,$o["unsigned"]).'</select>':''),(isset($o['on_update'])?"<select name='".h($y)."[on_update]'".(preg_match('~timestamp|datetime~',$T)?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(102).")","CURRENT_TIMESTAMP"),(preg_match('~^CURRENT_TIMESTAMP~i',$o["on_update"])?"CURRENT_TIMESTAMP":$o["on_update"])).'</select>':''),($gd?"<select name='".h($y)."[on_delete]'".(preg_match("~`~",$T)?"":" class='hidden'")."><option value=''>(".lang(103).")".optionlist(explode("|",$tf),$o["on_delete"])."</select> ":" ");}function
    6828 process_length($we){global$yc;return(preg_match("~^\\s*\\(?\\s*$yc(?:\\s*,\\s*$yc)*+\\s*\\)?\\s*\$~",$we)&&preg_match_all("~$yc~",$we,$Ge)?"(".implode(",",$Ge[0]).")":preg_replace('~^[0-9].*~','(\0)',preg_replace('~[^-0-9,+()[\]]~','',$we)));}function
    6829 process_type($o,$pb="COLLATE"){global$Li;return" $o[type]".process_length($o["length"]).(preg_match(number_type(),$o["type"])&&in_array($o["unsigned"],$Li)?" $o[unsigned]":"").(preg_match('~char|text|enum|set~',$o["type"])&&$o["collation"]?" $pb ".q($o["collation"]):"");}function
    6830 process_field($o,$Di){return
    6831 array(idf_escape(trim($o["field"])),process_type($Di),($o["null"]?" NULL":" NOT NULL"),default_value($o),(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
    6832 default_value($o){$Vb=$o["default"];return($Vb===null?"":" DEFAULT ".(preg_match('~char|binary|text|enum|set~',$o["type"])||preg_match('~^(?![a-z])~i',$Vb)?q($Vb):$Vb));}function
     6852edit_type($y,$o,$qb,$id=array(),$Pc=array()){global$Mh,$U,$Ni,$vf;$T=$o["type"];echo'<td><select name="',h($y),'[type]" class="type" aria-labelledby="label-type">';if($T&&!isset($U[$T])&&!isset($id[$T])&&!in_array($T,$Pc))$Pc[]=$T;if($id)$Mh[lang(100)]=$id;echo
     6853optionlist(array_merge($Pc,$Mh),$T),'</select><td><input name="',h($y),'[length]" value="',h($o["length"]),'" size="3"',(!$o["length"]&&preg_match('~var(char|binary)$~',$T)?" class='required'":"");echo' aria-labelledby="label-length"><td class="options">',"<select name='".h($y)."[collation]'".(preg_match('~(char|text|enum|set)$~',$T)?"":" class='hidden'").'><option value="">('.lang(101).')'.optionlist($qb,$o["collation"]).'</select>',($Ni?"<select name='".h($y)."[unsigned]'".(!$T||preg_match(number_type(),$T)?"":" class='hidden'").'><option>'.optionlist($Ni,$o["unsigned"]).'</select>':''),(isset($o['on_update'])?"<select name='".h($y)."[on_update]'".(preg_match('~timestamp|datetime~',$T)?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(102).")","CURRENT_TIMESTAMP"),(preg_match('~^CURRENT_TIMESTAMP~i',$o["on_update"])?"CURRENT_TIMESTAMP":$o["on_update"])).'</select>':''),($id?"<select name='".h($y)."[on_delete]'".(preg_match("~`~",$T)?"":" class='hidden'")."><option value=''>(".lang(103).")".optionlist(explode("|",$vf),$o["on_delete"])."</select> ":" ");}function
     6854process_length($ye){global$_c;return(preg_match("~^\\s*\\(?\\s*$_c(?:\\s*,\\s*$_c)*+\\s*\\)?\\s*\$~",$ye)&&preg_match_all("~$_c~",$ye,$Ie)?"(".implode(",",$Ie[0]).")":preg_replace('~^[0-9].*~','(\0)',preg_replace('~[^-0-9,+()[\]]~','',$ye)));}function
     6855process_type($o,$pb="COLLATE"){global$Ni;return" $o[type]".process_length($o["length"]).(preg_match(number_type(),$o["type"])&&in_array($o["unsigned"],$Ni)?" $o[unsigned]":"").(preg_match('~char|text|enum|set~',$o["type"])&&$o["collation"]?" $pb ".q($o["collation"]):"");}function
     6856process_field($o,$Fi){return
     6857array(idf_escape(trim($o["field"])),process_type($Fi),($o["null"]?" NULL":" NOT NULL"),default_value($o),(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
     6858default_value($o){$Wb=$o["default"];return($Wb===null?"":" DEFAULT ".(preg_match('~char|binary|text|enum|set~',$o["type"])||preg_match('~^(?![a-z])~i',$Wb)?q($Wb):$Wb));}function
    68336859type_class($T){foreach(array('char'=>'text','date'=>'time|year','binary'=>'blob','enum'=>'set',)as$y=>$X){if(preg_match("~$y|$X~",$T))return" class='$y'";}}function
    6834 edit_fields($p,$qb,$T="TABLE",$gd=array()){global$Td;$p=array_values($p);echo'<thead><tr>
     6860edit_fields($p,$qb,$T="TABLE",$id=array()){global$Vd;$p=array_values($p);$Xb=(($_POST?$_POST["defaults"]:adminer_setting("defaults"))?"":" class='hidden'");$wb=(($_POST?$_POST["comments"]:adminer_setting("comments"))?"":" class='hidden'");echo'<thead><tr>
    68356861';if($T=="PROCEDURE"){echo'<td>';}echo'<th id="label-name">',($T=="TABLE"?lang(104):lang(105)),'<td id="label-type">',lang(50),'<textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;"></textarea>',script("qs('#enum-edit').onblur = editingLengthBlur;"),'<td id="label-length">',lang(106),'<td>',lang(107);if($T=="TABLE"){echo'<td id="label-null">NULL
    6836 <td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="',lang(52),'">AI</acronym>',doc_link(array('sql'=>"example-auto-increment.html",'mariadb'=>"auto_increment/",'sqlite'=>"autoinc.html",'pgsql'=>"datatype.html#DATATYPE-SERIAL",'mssql'=>"ms186775.aspx",)),'<td id="label-default">',lang(53),(support("comment")?"<td id='label-comment'>".lang(51):"");}echo'<td>',"<input type='image' class='icon' name='add[".(support("move_col")?0:count($p))."]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.5")."' alt='+' title='".lang(108)."'>".script("row_count = ".count($p).";"),'</thead>
     6862<td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="',lang(52),'">AI</acronym>',doc_link(array('sql'=>"example-auto-increment.html",'mariadb'=>"auto_increment/",'sqlite'=>"autoinc.html",'pgsql'=>"datatype.html#DATATYPE-SERIAL",'mssql'=>"ms186775.aspx",)),'<td id="label-default"',$Xb,'>',lang(53),(support("comment")?"<td id='label-comment'$wb>".lang(51):"");}echo'<td>',"<input type='image' class='icon' name='add[".(support("move_col")?0:count($p))."]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.6")."' alt='+' title='".lang(108)."'>".script("row_count = ".count($p).";"),'</thead>
    68376863<tbody>
    68386864',script("mixin(qsl('tbody'), {onclick: editingClick, onkeydown: editingKeydown, oninput: editingInput});");foreach($p
    6839 as$s=>$o){$s++;$Gf=$o[($_POST?"orig":"field")];$dc=(isset($_POST["add"][$s-1])||(isset($o["field"])&&!$_POST["drop_col"][$s]))&&(support("drop_col")||$Gf=="");echo'<tr',($dc?"":" style='display: none;'"),'>
    6840 ',($T=="PROCEDURE"?"<td>".html_select("fields[$s][inout]",explode("|",$Td),$o["inout"]):""),'<th>';if($dc){echo'<input name="fields[',$s,'][field]" value="',h($o["field"]),'" data-maxlength="64" autocapitalize="off" aria-labelledby="label-name">',script("qsl('input').oninput = function () { editingNameChange.call(this);".($o["field"]!=""||count($p)>1?"":" editingAddRow.call(this);")." };","");}echo'<input type="hidden" name="fields[',$s,'][orig]" value="',h($Gf),'">';edit_type("fields[$s]",$o,$qb,$gd);if($T=="TABLE"){echo'<td>',checkbox("fields[$s][null]",1,$o["null"],"","","block","label-null"),'<td><label class="block"><input type="radio" name="auto_increment_col" value="',$s,'"';if($o["auto_increment"]){echo' checked';}echo' aria-labelledby="label-ai"></label><td>',checkbox("fields[$s][has_default]",1,$o["has_default"],"","","","label-default"),'<input name="fields[',$s,'][default]" value="',h($o["default"]),'" aria-labelledby="label-default">',(support("comment")?"<td><input name='fields[$s][comment]' value='".h($o["comment"])."' data-maxlength='".(min_version(5.5)?1024:255)."' aria-labelledby='label-comment'>":"");}echo"<td>",(support("move_col")?"<input type='image' class='icon' name='add[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.5")."' alt='+' title='".lang(108)."'> "."<input type='image' class='icon' name='up[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=up.gif&version=4.7.5")."' alt='↑' title='".lang(109)."'> "."<input type='image' class='icon' name='down[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=down.gif&version=4.7.5")."' alt='↓' title='".lang(110)."'> ":""),($Gf==""||support("drop_col")?"<input type='image' class='icon' name='drop_col[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=cross.gif&version=4.7.5")."' alt='x' title='".lang(111)."'>":"");}}function
    6841 process_fields(&$p){$C=0;if($_POST["up"]){$qe=0;foreach($p
    6842 as$y=>$o){if(key($_POST["up"])==$y){unset($p[$y]);array_splice($p,$qe,0,array($o));break;}if(isset($o["field"]))$qe=$C;$C++;}}elseif($_POST["down"]){$id=false;foreach($p
    6843 as$y=>$o){if(isset($o["field"])&&$id){unset($p[key($_POST["down"])]);array_splice($p,$C,0,array($id));break;}if(key($_POST["down"])==$y)$id=$o;$C++;}}elseif($_POST["add"]){$p=array_values($p);array_splice($p,key($_POST["add"]),0,array(array()));}elseif(!$_POST["drop_col"])return
     6865as$s=>$o){$s++;$If=$o[($_POST?"orig":"field")];$fc=(isset($_POST["add"][$s-1])||(isset($o["field"])&&!$_POST["drop_col"][$s]))&&(support("drop_col")||$If=="");echo'<tr',($fc?"":" style='display: none;'"),'>
     6866',($T=="PROCEDURE"?"<td>".html_select("fields[$s][inout]",explode("|",$Vd),$o["inout"]):""),'<th>';if($fc){echo'<input name="fields[',$s,'][field]" value="',h($o["field"]),'" data-maxlength="64" autocapitalize="off" aria-labelledby="label-name">';}echo'<input type="hidden" name="fields[',$s,'][orig]" value="',h($If),'">';edit_type("fields[$s]",$o,$qb,$id);if($T=="TABLE"){echo'<td>',checkbox("fields[$s][null]",1,$o["null"],"","","block","label-null"),'<td><label class="block"><input type="radio" name="auto_increment_col" value="',$s,'"';if($o["auto_increment"]){echo' checked';}echo' aria-labelledby="label-ai"></label><td',$Xb,'>',checkbox("fields[$s][has_default]",1,$o["has_default"],"","","","label-default"),'<input name="fields[',$s,'][default]" value="',h($o["default"]),'" aria-labelledby="label-default">',(support("comment")?"<td$wb><input name='fields[$s][comment]' value='".h($o["comment"])."' data-maxlength='".(min_version(5.5)?1024:255)."' aria-labelledby='label-comment'>":"");}echo"<td>",(support("move_col")?"<input type='image' class='icon' name='add[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.6")."' alt='+' title='".lang(108)."'> "."<input type='image' class='icon' name='up[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=up.gif&version=4.7.6")."' alt='↑' title='".lang(109)."'> "."<input type='image' class='icon' name='down[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=down.gif&version=4.7.6")."' alt='↓' title='".lang(110)."'> ":""),($If==""||support("drop_col")?"<input type='image' class='icon' name='drop_col[$s]' src='".h(preg_replace("~\\?.*~","",ME)."?file=cross.gif&version=4.7.6")."' alt='x' title='".lang(111)."'>":"");}}function
     6867process_fields(&$p){$C=0;if($_POST["up"]){$se=0;foreach($p
     6868as$y=>$o){if(key($_POST["up"])==$y){unset($p[$y]);array_splice($p,$se,0,array($o));break;}if(isset($o["field"]))$se=$C;$C++;}}elseif($_POST["down"]){$kd=false;foreach($p
     6869as$y=>$o){if(isset($o["field"])&&$kd){unset($p[key($_POST["down"])]);array_splice($p,$C,0,array($kd));break;}if(key($_POST["down"])==$y)$kd=$o;$C++;}}elseif($_POST["add"]){$p=array_values($p);array_splice($p,key($_POST["add"]),0,array(array()));}elseif(!$_POST["drop_col"])return
    68446870false;return
    68456871true;}function
    68466872normalize_enum($A){return"'".str_replace("'","''",addcslashes(stripcslashes(str_replace($A[0][0].$A[0][0],$A[0][0],substr($A[0],1,-1))),'\\'))."'";}function
    6847 grant($nd,$sg,$f,$sf){if(!$sg)return
    6848 true;if($sg==array("ALL PRIVILEGES","GRANT OPTION"))return($nd=="GRANT"?queries("$nd ALL PRIVILEGES$sf WITH GRANT OPTION"):queries("$nd ALL PRIVILEGES$sf")&&queries("$nd GRANT OPTION$sf"));return
    6849 queries("$nd ".preg_replace('~(GRANT OPTION)\([^)]*\)~','\1',implode("$f, ",$sg).$f).$sf);}function
    6850 drop_create($hc,$Gb,$ic,$ei,$kc,$_e,$Re,$Pe,$Qe,$pf,$cf){if($_POST["drop"])query_redirect($hc,$_e,$Re);elseif($pf=="")query_redirect($Gb,$_e,$Qe);elseif($pf!=$cf){$Ib=queries($Gb);queries_redirect($_e,$Pe,$Ib&&queries($hc));if($Ib)queries($ic);}else
    6851 queries_redirect($_e,$Pe,queries($ei)&&queries($kc)&&queries($hc)&&queries($Gb));}function
    6852 create_trigger($sf,$I){global$x;$ji=" $I[Timing] $I[Event]".($I["Event"]=="UPDATE OF"?" ".idf_escape($I["Of"]):"");return"CREATE TRIGGER ".idf_escape($I["Trigger"]).($x=="mssql"?$sf.$ji:$ji.$sf).rtrim(" $I[Type]\n$I[Statement]",";").";";}function
    6853 create_routine($Xg,$I){global$Td,$x;$N=array();$p=(array)$I["fields"];ksort($p);foreach($p
    6854 as$o){if($o["field"]!="")$N[]=(preg_match("~^($Td)\$~",$o["inout"])?"$o[inout] ":"").idf_escape($o["field"]).process_type($o,"CHARACTER SET");}$Wb=rtrim("\n$I[definition]",";");return"CREATE $Xg ".idf_escape(trim($I["name"]))." (".implode(", ",$N).")".(isset($_GET["function"])?" RETURNS".process_type($I["returns"],"CHARACTER SET"):"").($I["language"]?" LANGUAGE $I[language]":"").($x=="pgsql"?" AS ".q($Wb):"$Wb;");}function
     6873grant($pd,$ug,$f,$uf){if(!$ug)return
     6874true;if($ug==array("ALL PRIVILEGES","GRANT OPTION"))return($pd=="GRANT"?queries("$pd ALL PRIVILEGES$uf WITH GRANT OPTION"):queries("$pd ALL PRIVILEGES$uf")&&queries("$pd GRANT OPTION$uf"));return
     6875queries("$pd ".preg_replace('~(GRANT OPTION)\([^)]*\)~','\1',implode("$f, ",$ug).$f).$uf);}function
     6876drop_create($jc,$Hb,$kc,$gi,$mc,$Be,$Te,$Re,$Se,$rf,$ef){if($_POST["drop"])query_redirect($jc,$Be,$Te);elseif($rf=="")query_redirect($Hb,$Be,$Se);elseif($rf!=$ef){$Jb=queries($Hb);queries_redirect($Be,$Re,$Jb&&queries($jc));if($Jb)queries($kc);}else
     6877queries_redirect($Be,$Re,queries($gi)&&queries($mc)&&queries($jc)&&queries($Hb));}function
     6878create_trigger($uf,$I){global$x;$li=" $I[Timing] $I[Event]".($I["Event"]=="UPDATE OF"?" ".idf_escape($I["Of"]):"");return"CREATE TRIGGER ".idf_escape($I["Trigger"]).($x=="mssql"?$uf.$li:$li.$uf).rtrim(" $I[Type]\n$I[Statement]",";").";";}function
     6879create_routine($Zg,$I){global$Vd,$x;$N=array();$p=(array)$I["fields"];ksort($p);foreach($p
     6880as$o){if($o["field"]!="")$N[]=(preg_match("~^($Vd)\$~",$o["inout"])?"$o[inout] ":"").idf_escape($o["field"]).process_type($o,"CHARACTER SET");}$Yb=rtrim("\n$I[definition]",";");return"CREATE $Zg ".idf_escape(trim($I["name"]))." (".implode(", ",$N).")".(isset($_GET["function"])?" RETURNS".process_type($I["returns"],"CHARACTER SET"):"").($I["language"]?" LANGUAGE $I[language]":"").($x=="pgsql"?" AS ".q($Yb):"$Yb;");}function
    68556881remove_definer($F){return
    68566882preg_replace('~^([A-Z =]+) DEFINER=`'.preg_replace('~@(.*)~','`@`(%|\1)',logged_user()).'`~','\1',$F);}function
    6857 format_foreign_key($q){global$tf;$l=$q["db"];$hf=$q["ns"];return" FOREIGN KEY (".implode(", ",array_map('idf_escape',$q["source"])).") REFERENCES ".($l!=""&&$l!=$_GET["db"]?idf_escape($l).".":"").($hf!=""&&$hf!=$_GET["ns"]?idf_escape($hf).".":"").table($q["table"])." (".implode(", ",array_map('idf_escape',$q["target"])).")".(preg_match("~^($tf)\$~",$q["on_delete"])?" ON DELETE $q[on_delete]":"").(preg_match("~^($tf)\$~",$q["on_update"])?" ON UPDATE $q[on_update]":"");}function
    6858 tar_file($Wc,$oi){$H=pack("a100a8a8a8a12a12",$Wc,644,0,0,decoct($oi->size),decoct(time()));$ib=8*32;for($s=0;$s<strlen($H);$s++)$ib+=ord($H[$s]);$H.=sprintf("%06o",$ib)."\0 ";echo$H,str_repeat("\0",512-strlen($H));$oi->send();echo
    6859 str_repeat("\0",511-($oi->size+511)%512);}function
    6860 ini_bytes($Sd){$X=ini_get($Sd);switch(strtolower(substr($X,-1))){case'g':$X*=1024;case'm':$X*=1024;case'k':$X*=1024;}return$X;}function
    6861 doc_link($cg,$fi="<sup>?</sup>"){global$x,$h;$oh=$h->server_info;$bj=preg_replace('~^(\d\.?\d).*~s','\1',$oh);$Qi=array('sql'=>"https://dev.mysql.com/doc/refman/$bj/en/",'sqlite'=>"https://www.sqlite.org/",'pgsql'=>"https://www.postgresql.org/docs/$bj/",'mssql'=>"https://msdn.microsoft.com/library/",'oracle'=>"https://www.oracle.com/pls/topic/lookup?ctx=db".preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s','\1\2',$oh)."&id=",);if(preg_match('~MariaDB~',$oh)){$Qi['sql']="https://mariadb.com/kb/en/library/";$cg['sql']=(isset($cg['mariadb'])?$cg['mariadb']:str_replace(".html","/",$cg['sql']));}return($cg[$x]?"<a href='$Qi[$x]$cg[$x]'".target_blank().">$fi</a>":"");}function
     6883format_foreign_key($q){global$vf;$l=$q["db"];$jf=$q["ns"];return" FOREIGN KEY (".implode(", ",array_map('idf_escape',$q["source"])).") REFERENCES ".($l!=""&&$l!=$_GET["db"]?idf_escape($l).".":"").($jf!=""&&$jf!=$_GET["ns"]?idf_escape($jf).".":"").table($q["table"])." (".implode(", ",array_map('idf_escape',$q["target"])).")".(preg_match("~^($vf)\$~",$q["on_delete"])?" ON DELETE $q[on_delete]":"").(preg_match("~^($vf)\$~",$q["on_update"])?" ON UPDATE $q[on_update]":"");}function
     6884tar_file($Yc,$qi){$H=pack("a100a8a8a8a12a12",$Yc,644,0,0,decoct($qi->size),decoct(time()));$ib=8*32;for($s=0;$s<strlen($H);$s++)$ib+=ord($H[$s]);$H.=sprintf("%06o",$ib)."\0 ";echo$H,str_repeat("\0",512-strlen($H));$qi->send();echo
     6885str_repeat("\0",511-($qi->size+511)%512);}function
     6886ini_bytes($Ud){$X=ini_get($Ud);switch(strtolower(substr($X,-1))){case'g':$X*=1024;case'm':$X*=1024;case'k':$X*=1024;}return$X;}function
     6887doc_link($eg,$hi="<sup>?</sup>"){global$x,$h;$qh=$h->server_info;$dj=preg_replace('~^(\d\.?\d).*~s','\1',$qh);$Si=array('sql'=>"https://dev.mysql.com/doc/refman/$dj/en/",'sqlite'=>"https://www.sqlite.org/",'pgsql'=>"https://www.postgresql.org/docs/$dj/",'mssql'=>"https://msdn.microsoft.com/library/",'oracle'=>"https://www.oracle.com/pls/topic/lookup?ctx=db".preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s','\1\2',$qh)."&id=",);if(preg_match('~MariaDB~',$qh)){$Si['sql']="https://mariadb.com/kb/en/library/";$eg['sql']=(isset($eg['mariadb'])?$eg['mariadb']:str_replace(".html","/",$eg['sql']));}return($eg[$x]?"<a href='$Si[$x]$eg[$x]'".target_blank().">$hi</a>":"");}function
    68626888ob_gzencode($P){return
    68636889gzencode($P);}function
    68646890db_size($l){global$h;if(!$h->select_db($l))return"?";$H=0;foreach(table_status()as$R)$H+=$R["Data_length"]+$R["Index_length"];return
    68656891format_number($H);}function
    6866 set_utf8mb4($Gb){global$h;static$N=false;if(!$N&&preg_match('~\butf8mb4~i',$Gb)){$N=true;echo"SET NAMES ".charset($h).";\n\n";}}function
    6867 connect_error(){global$b,$h,$ri,$n,$gc;if(DB!=""){header("HTTP/1.1 404 Not Found");page_header(lang(38).": ".h(DB),lang(112),true);}else{if($_POST["db"]&&!$n)queries_redirect(substr(ME,0,-1),lang(113),drop_databases($_POST["db"]));page_header(lang(114),$n,false);echo"<p class='links'>\n";foreach(array('database'=>lang(115),'privileges'=>lang(72),'processlist'=>lang(116),'variables'=>lang(117),'status'=>lang(118),)as$y=>$X){if(support($y))echo"<a href='".h(ME)."$y='>$X</a>\n";}echo"<p>".lang(119,$gc[DRIVER],"<b>".h($h->server_info)."</b>","<b>$h->extension</b>")."\n","<p>".lang(120,"<b>".h(logged_user())."</b>")."\n";$k=$b->databases();if($k){$eh=support("scheme");$qb=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable'>\n",script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});"),"<thead><tr>".(support("database")?"<td>":"")."<th>".lang(38)." - <a href='".h(ME)."refresh=1'>".lang(121)."</a>"."<td>".lang(122)."<td>".lang(123)."<td>".lang(124)." - <a href='".h(ME)."dbsize=1'>".lang(125)."</a>".script("qsl('a').onclick = partial(ajaxSetHtml, '".js_escape(ME)."script=connect');","")."</thead>\n";$k=($_GET["dbsize"]?count_tables($k):array_flip($k));foreach($k
    6868 as$l=>$S){$Wg=h(ME)."db=".urlencode($l);$t=h("Db-".$l);echo"<tr".odd().">".(support("database")?"<td>".checkbox("db[]",$l,in_array($l,(array)$_POST["db"]),"","","",$t):""),"<th><a href='$Wg' id='$t'>".h($l)."</a>";$d=h(db_collation($l,$qb));echo"<td>".(support("database")?"<a href='$Wg".($eh?"&amp;ns=":"")."&amp;database=' title='".lang(68)."'>$d</a>":$d),"<td align='right'><a href='$Wg&amp;schema=' id='tables-".h($l)."' title='".lang(71)."'>".($_GET["dbsize"]?$S:"?")."</a>","<td align='right' id='size-".h($l)."'>".($_GET["dbsize"]?db_size($l):"?"),"\n";}echo"</table>\n",(support("database")?"<div class='footer'><div>\n"."<fieldset><legend>".lang(126)." <span id='selected'></span></legend><div>\n"."<input type='hidden' name='all' value=''>".script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); };")."<input type='submit' name='drop' value='".lang(127)."'>".confirm()."\n"."</div></fieldset>\n"."</div></div>\n":""),"<input type='hidden' name='token' value='$ri'>\n","</form>\n",script("tableCheck();");}}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(78).": ".h($_GET["ns"]),lang(128),true);page_footer("ns");exit;}}$tf="RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT";class
     6892set_utf8mb4($Hb){global$h;static$N=false;if(!$N&&preg_match('~\butf8mb4~i',$Hb)){$N=true;echo"SET NAMES ".charset($h).";\n\n";}}function
     6893connect_error(){global$b,$h,$ti,$n,$ic;if(DB!=""){header("HTTP/1.1 404 Not Found");page_header(lang(38).": ".h(DB),lang(112),true);}else{if($_POST["db"]&&!$n)queries_redirect(substr(ME,0,-1),lang(113),drop_databases($_POST["db"]));page_header(lang(114),$n,false);echo"<p class='links'>\n";foreach(array('database'=>lang(115),'privileges'=>lang(72),'processlist'=>lang(116),'variables'=>lang(117),'status'=>lang(118),)as$y=>$X){if(support($y))echo"<a href='".h(ME)."$y='>$X</a>\n";}echo"<p>".lang(119,$ic[DRIVER],"<b>".h($h->server_info)."</b>","<b>$h->extension</b>")."\n","<p>".lang(120,"<b>".h(logged_user())."</b>")."\n";$k=$b->databases();if($k){$gh=support("scheme");$qb=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable'>\n",script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});"),"<thead><tr>".(support("database")?"<td>":"")."<th>".lang(38)." - <a href='".h(ME)."refresh=1'>".lang(121)."</a>"."<td>".lang(122)."<td>".lang(123)."<td>".lang(124)." - <a href='".h(ME)."dbsize=1'>".lang(125)."</a>".script("qsl('a').onclick = partial(ajaxSetHtml, '".js_escape(ME)."script=connect');","")."</thead>\n";$k=($_GET["dbsize"]?count_tables($k):array_flip($k));foreach($k
     6894as$l=>$S){$Yg=h(ME)."db=".urlencode($l);$t=h("Db-".$l);echo"<tr".odd().">".(support("database")?"<td>".checkbox("db[]",$l,in_array($l,(array)$_POST["db"]),"","","",$t):""),"<th><a href='$Yg' id='$t'>".h($l)."</a>";$d=h(db_collation($l,$qb));echo"<td>".(support("database")?"<a href='$Yg".($gh?"&amp;ns=":"")."&amp;database=' title='".lang(68)."'>$d</a>":$d),"<td align='right'><a href='$Yg&amp;schema=' id='tables-".h($l)."' title='".lang(71)."'>".($_GET["dbsize"]?$S:"?")."</a>","<td align='right' id='size-".h($l)."'>".($_GET["dbsize"]?db_size($l):"?"),"\n";}echo"</table>\n",(support("database")?"<div class='footer'><div>\n"."<fieldset><legend>".lang(126)." <span id='selected'></span></legend><div>\n"."<input type='hidden' name='all' value=''>".script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); };")."<input type='submit' name='drop' value='".lang(127)."'>".confirm()."\n"."</div></fieldset>\n"."</div></div>\n":""),"<input type='hidden' name='token' value='$ti'>\n","</form>\n",script("tableCheck();");}}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(78).": ".h($_GET["ns"]),lang(128),true);page_footer("ns");exit;}}$vf="RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT";class
    68696895TmpFile{var$handler;var$size;function
    68706896__construct(){$this->handler=tmpfile();}function
    6871 write($Bb){$this->size+=strlen($Bb);fwrite($this->handler,$Bb);}function
    6872 send(){fseek($this->handler,0);fpassthru($this->handler);fclose($this->handler);}}$yc="'(?:''|[^'\\\\]|\\\\.)*'";$Td="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"]));$K=array(idf_escape($_GET["field"]));$G=$m->select($a,$K,array(where($_GET,$p)),$K);$I=($G?$G->fetch_row():array());echo$m->value($I[0],$p[$_GET["field"]]);exit;}elseif(isset($_GET["table"])){$a=$_GET["table"];$p=fields($a);if(!$p)$n=error();$R=table_status1($a,true);$B=$b->tableName($R);page_header(($p&&is_view($R)?$R['Engine']=='materialized view'?lang(129):lang(130):lang(131)).": ".($B!=""?$B:h($a)),$n);$b->selectLinks($R);$vb=$R["Comment"];if($vb!="")echo"<p class='nowrap'>".lang(51).": ".h($vb)."\n";if($p)$b->tableStructurePrint($p);if(!is_view($R)){if(support("indexes")){echo"<h3 id='indexes'>".lang(132)."</h3>\n";$w=indexes($a);if($w)$b->tableIndexesPrint($w);echo'<p class="links"><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(133)."</a>\n";}if(fk_support($R)){echo"<h3 id='foreign-keys'>".lang(100)."</h3>\n";$gd=foreign_keys($a);if($gd){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(134)."<td>".lang(135)."<td>".lang(103)."<td>".lang(102)."<td></thead>\n";foreach($gd
    6873 as$B=>$q){echo"<tr title='".h($B)."'>","<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>".h($q["on_delete"])."\n","<td>".h($q["on_update"])."\n",'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($B)).'">'.lang(136).'</a>';}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(137)."</a>\n";}}if(support(is_view($R)?"view_trigger":"trigger")){echo"<h3 id='triggers'>".lang(138)."</h3>\n";$Ci=triggers($a);if($Ci){echo"<table cellspacing='0'>\n";foreach($Ci
    6874 as$y=>$X)echo"<tr valign='top'><td>".h($X[0])."<td>".h($X[1])."<th>".h($y)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($y))."'>".lang(136)."</a>\n";echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(139)."</a>\n";}}elseif(isset($_GET["schema"])){page_header(lang(71),"",array(),h(DB.($_GET["ns"]?".$_GET[ns]":"")));$Uh=array();$Vh=array();$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE["adminer_schema-".str_replace(".","_",DB)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$Ge,PREG_SET_ORDER);foreach($Ge
    6875 as$s=>$A){$Uh[$A[1]]=array($A[2],$A[3]);$Vh[]="\n\t'".js_escape($A[1])."': [ $A[2], $A[3] ]";}$si=0;$Sa=-1;$dh=array();$Ig=array();$ue=array();foreach(table_status('',true)as$Q=>$R){if(is_view($R))continue;$hg=0;$dh[$Q]["fields"]=array();foreach(fields($Q)as$B=>$o){$hg+=1.25;$o["pos"]=$hg;$dh[$Q]["fields"][$B]=$o;}$dh[$Q]["pos"]=($Uh[$Q]?$Uh[$Q]:array($si,0));foreach($b->foreignKeys($Q)as$X){if(!$X["db"]){$se=$Sa;if($Uh[$Q][1]||$Uh[$X["table"]][1])$se=min(floatval($Uh[$Q][1]),floatval($Uh[$X["table"]][1]))-1;else$Sa-=.1;while($ue[(string)$se])$se-=.0001;$dh[$Q]["references"][$X["table"]][(string)$se]=array($X["source"],$X["target"]);$Ig[$X["table"]][$Q][(string)$se]=$X["target"];$ue[(string)$se]=true;}}$si=max($si,$dh[$Q]["pos"][0]+2.5+$hg);}echo'<div id="schema" style="height: ',$si,'em;">
     6897write($Cb){$this->size+=strlen($Cb);fwrite($this->handler,$Cb);}function
     6898send(){fseek($this->handler,0);fpassthru($this->handler);fclose($this->handler);}}$_c="'(?:''|[^'\\\\]|\\\\.)*'";$Vd="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"]));$K=array(idf_escape($_GET["field"]));$G=$m->select($a,$K,array(where($_GET,$p)),$K);$I=($G?$G->fetch_row():array());echo$m->value($I[0],$p[$_GET["field"]]);exit;}elseif(isset($_GET["table"])){$a=$_GET["table"];$p=fields($a);if(!$p)$n=error();$R=table_status1($a,true);$B=$b->tableName($R);page_header(($p&&is_view($R)?$R['Engine']=='materialized view'?lang(129):lang(130):lang(131)).": ".($B!=""?$B:h($a)),$n);$b->selectLinks($R);$vb=$R["Comment"];if($vb!="")echo"<p class='nowrap'>".lang(51).": ".h($vb)."\n";if($p)$b->tableStructurePrint($p);if(!is_view($R)){if(support("indexes")){echo"<h3 id='indexes'>".lang(132)."</h3>\n";$w=indexes($a);if($w)$b->tableIndexesPrint($w);echo'<p class="links"><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(133)."</a>\n";}if(fk_support($R)){echo"<h3 id='foreign-keys'>".lang(100)."</h3>\n";$id=foreign_keys($a);if($id){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(134)."<td>".lang(135)."<td>".lang(103)."<td>".lang(102)."<td></thead>\n";foreach($id
     6899as$B=>$q){echo"<tr title='".h($B)."'>","<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>".h($q["on_delete"])."\n","<td>".h($q["on_update"])."\n",'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($B)).'">'.lang(136).'</a>';}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(137)."</a>\n";}}if(support(is_view($R)?"view_trigger":"trigger")){echo"<h3 id='triggers'>".lang(138)."</h3>\n";$Ei=triggers($a);if($Ei){echo"<table cellspacing='0'>\n";foreach($Ei
     6900as$y=>$X)echo"<tr valign='top'><td>".h($X[0])."<td>".h($X[1])."<th>".h($y)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($y))."'>".lang(136)."</a>\n";echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(139)."</a>\n";}}elseif(isset($_GET["schema"])){page_header(lang(71),"",array(),h(DB.($_GET["ns"]?".$_GET[ns]":"")));$Wh=array();$Xh=array();$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE["adminer_schema-".str_replace(".","_",DB)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$Ie,PREG_SET_ORDER);foreach($Ie
     6901as$s=>$A){$Wh[$A[1]]=array($A[2],$A[3]);$Xh[]="\n\t'".js_escape($A[1])."': [ $A[2], $A[3] ]";}$ui=0;$Sa=-1;$fh=array();$Kg=array();$we=array();foreach(table_status('',true)as$Q=>$R){if(is_view($R))continue;$jg=0;$fh[$Q]["fields"]=array();foreach(fields($Q)as$B=>$o){$jg+=1.25;$o["pos"]=$jg;$fh[$Q]["fields"][$B]=$o;}$fh[$Q]["pos"]=($Wh[$Q]?$Wh[$Q]:array($ui,0));foreach($b->foreignKeys($Q)as$X){if(!$X["db"]){$ue=$Sa;if($Wh[$Q][1]||$Wh[$X["table"]][1])$ue=min(floatval($Wh[$Q][1]),floatval($Wh[$X["table"]][1]))-1;else$Sa-=.1;while($we[(string)$ue])$ue-=.0001;$fh[$Q]["references"][$X["table"]][(string)$ue]=array($X["source"],$X["target"]);$Kg[$X["table"]][$Q][(string)$ue]=$X["target"];$we[(string)$ue]=true;}}$ui=max($ui,$fh[$Q]["pos"][0]+2.5+$jg);}echo'<div id="schema" style="height: ',$ui,'em;">
    68766902<script',nonce(),'>
    68776903qs(\'#schema\').onselectstart = function () { return false; };
    6878 var tablePos = {',implode(",",$Vh)."\n",'};
    6879 var em = qs(\'#schema\').offsetHeight / ',$si,';
     6904var tablePos = {',implode(",",$Xh)."\n",'};
     6905var em = qs(\'#schema\').offsetHeight / ',$ui,';
    68806906document.onmousemove = schemaMousemove;
    68816907document.onmouseup = partialArg(schemaMouseup, \'',js_escape(DB),'\');
    68826908</script>
    6883 ';foreach($dh
    6884 as$B=>$Q){echo"<div class='table' style='top: ".$Q["pos"][0]."em; left: ".$Q["pos"][1]."em;'>",'<a href="'.h(ME).'table='.urlencode($B).'"><b>'.h($B)."</b></a>",script("qsl('div').onmousedown = schemaMousedown;");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$bi=>$Jg){foreach($Jg
    6885 as$se=>$Fg){$te=$se-$Uh[$B][1];$s=0;foreach($Fg[0]as$zh)echo"\n<div class='references' title='".h($bi)."' id='refs$se-".($s++)."' style='left: $te"."em; top: ".$Q["fields"][$zh]["pos"]."em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: ".(-$te)."em;'></div></div>";}}foreach((array)$Ig[$B]as$bi=>$Jg){foreach($Jg
    6886 as$se=>$f){$te=$se-$Uh[$B][1];$s=0;foreach($f
    6887 as$ai)echo"\n<div class='references' title='".h($bi)."' id='refd$se-".($s++)."' style='left: $te"."em; top: ".$Q["fields"][$ai]["pos"]."em; height: 1.25em; background: url(".h(preg_replace("~\\?.*~","",ME)."?file=arrow.gif) no-repeat right center;&version=4.7.5")."'><div style='height: .5em; border-bottom: 1px solid Gray; width: ".(-$te)."em;'></div></div>";}}echo"\n</div>\n";}foreach($dh
    6888 as$B=>$Q){foreach((array)$Q["references"]as$bi=>$Jg){foreach($Jg
    6889 as$se=>$Fg){$Ve=$si;$Ke=-10;foreach($Fg[0]as$y=>$zh){$ig=$Q["pos"][0]+$Q["fields"][$zh]["pos"];$jg=$dh[$bi]["pos"][0]+$dh[$bi]["fields"][$Fg[1][$y]]["pos"];$Ve=min($Ve,$ig,$jg);$Ke=max($Ke,$ig,$jg);}echo"<div class='references' id='refl$se' style='left: $se"."em; top: $Ve"."em; padding: .5em 0;'><div style='border-right: 1px solid Gray; margin-top: 1px; height: ".($Ke-$Ve)."em;'></div></div>\n";}}}echo'</div>
     6909';foreach($fh
     6910as$B=>$Q){echo"<div class='table' style='top: ".$Q["pos"][0]."em; left: ".$Q["pos"][1]."em;'>",'<a href="'.h(ME).'table='.urlencode($B).'"><b>'.h($B)."</b></a>",script("qsl('div').onmousedown = schemaMousedown;");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$di=>$Lg){foreach($Lg
     6911as$ue=>$Hg){$ve=$ue-$Wh[$B][1];$s=0;foreach($Hg[0]as$Ah)echo"\n<div class='references' title='".h($di)."' id='refs$ue-".($s++)."' style='left: $ve"."em; top: ".$Q["fields"][$Ah]["pos"]."em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: ".(-$ve)."em;'></div></div>";}}foreach((array)$Kg[$B]as$di=>$Lg){foreach($Lg
     6912as$ue=>$f){$ve=$ue-$Wh[$B][1];$s=0;foreach($f
     6913as$ci)echo"\n<div class='references' title='".h($di)."' id='refd$ue-".($s++)."' style='left: $ve"."em; top: ".$Q["fields"][$ci]["pos"]."em; height: 1.25em; background: url(".h(preg_replace("~\\?.*~","",ME)."?file=arrow.gif) no-repeat right center;&version=4.7.6")."'><div style='height: .5em; border-bottom: 1px solid Gray; width: ".(-$ve)."em;'></div></div>";}}echo"\n</div>\n";}foreach($fh
     6914as$B=>$Q){foreach((array)$Q["references"]as$di=>$Lg){foreach($Lg
     6915as$ue=>$Hg){$Xe=$ui;$Me=-10;foreach($Hg[0]as$y=>$Ah){$kg=$Q["pos"][0]+$Q["fields"][$Ah]["pos"];$lg=$fh[$di]["pos"][0]+$fh[$di]["fields"][$Hg[1][$y]]["pos"];$Xe=min($Xe,$kg,$lg);$Me=max($Me,$kg,$lg);}echo"<div class='references' id='refl$ue' style='left: $ue"."em; top: $Xe"."em; padding: .5em 0;'><div style='border-right: 1px solid Gray; margin-top: 1px; height: ".($Me-$Xe)."em;'></div></div>\n";}}}echo'</div>
    68906916<p class="links"><a href="',h(ME."schema=".urlencode($ea)),'" id="schema-link">',lang(140),'</a>
    6891 ';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$n){$Eb="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$y)$Eb.="&$y=".urlencode($_POST[$y]);cookie("adminer_export",substr($Eb,1));$S=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$Kc=dump_headers((count($S)==1?key($S):DB),(DB==""||count($S)>1));$be=preg_match('~sql~',$_POST["format"]);if($be){echo"-- Adminer $ia ".$gc[DRIVER]." dump\n\n";if($x=="sql"){echo"SET NAMES utf8;
     6917';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$n){$Fb="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$y)$Fb.="&$y=".urlencode($_POST[$y]);cookie("adminer_export",substr($Fb,1));$S=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$Mc=dump_headers((count($S)==1?key($S):DB),(DB==""||count($S)>1));$de=preg_match('~sql~',$_POST["format"]);if($de){echo"-- Adminer $ia ".$ic[DRIVER]." dump\n\n";if($x=="sql"){echo"SET NAMES utf8;
    68926918SET time_zone = '+00:00';
    6893 ".($_POST["data_style"]?"SET foreign_key_checks = 0;
    6894 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
     6919SET foreign_key_checks = 0;
     6920".($_POST["data_style"]?"SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
    68956921":"")."
    6896 ";$h->query("SET time_zone = '+00:00';");}}$Lh=$_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
    6897 as$l){$b->dumpDatabase($l);if($h->select_db($l)){if($be&&preg_match('~CREATE~',$Lh)&&($Gb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1))){set_utf8mb4($Gb);if($Lh=="DROP+CREATE")echo"DROP DATABASE IF EXISTS ".idf_escape($l).";\n";echo"$Gb;\n";}if($be){if($Lh)echo
    6898 use_sql($l).";\n\n";$Mf="";if($_POST["routines"]){foreach(array("FUNCTION","PROCEDURE")as$Xg){foreach(get_rows("SHOW $Xg STATUS WHERE Db = ".q($l),null,"-- ")as$I){$Gb=remove_definer($h->result("SHOW CREATE $Xg ".idf_escape($I["Name"]),2));set_utf8mb4($Gb);$Mf.=($Lh!='DROP+CREATE'?"DROP $Xg IF EXISTS ".idf_escape($I["Name"]).";;\n":"")."$Gb;;\n\n";}}}if($_POST["events"]){foreach(get_rows("SHOW EVENTS",null,"-- ")as$I){$Gb=remove_definer($h->result("SHOW CREATE EVENT ".idf_escape($I["Name"]),3));set_utf8mb4($Gb);$Mf.=($Lh!='DROP+CREATE'?"DROP EVENT IF EXISTS ".idf_escape($I["Name"]).";;\n":"")."$Gb;;\n\n";}}if($Mf)echo"DELIMITER ;;\n\n$Mf"."DELIMITER ;\n\n";}if($_POST["table_style"]||$_POST["data_style"]){$dj=array();foreach(table_status('',true)as$B=>$R){$Q=(DB==""||in_array($B,(array)$_POST["tables"]));$Ob=(DB==""||in_array($B,(array)$_POST["data"]));if($Q||$Ob){if($Kc=="tar"){$oi=new
    6899 TmpFile;ob_start(array($oi,'write'),1e5);}$b->dumpTable($B,($Q?$_POST["table_style"]:""),(is_view($R)?2:0));if(is_view($R))$dj[]=$B;elseif($Ob){$p=fields($B);$b->dumpData($B,$_POST["data_style"],"SELECT *".convert_fields($p,$p)." FROM ".table($B));}if($be&&$_POST["triggers"]&&$Q&&($Ci=trigger_sql($B)))echo"\nDELIMITER ;;\n$Ci\nDELIMITER ;\n";if($Kc=="tar"){ob_end_flush();tar_file((DB!=""?"":"$l/")."$B.csv",$oi);}elseif($be)echo"\n";}}foreach($dj
    6900 as$cj)$b->dumpTable($cj,$_POST["table_style"],1);if($Kc=="tar")echo
    6901 pack("x512");}}}if($be)echo"-- ".$h->result("SELECT NOW()")."\n";exit;}page_header(lang(74),$n,($_GET["export"]!=""?array("table"=>$_GET["export"]):array()),h(DB));echo'
     6922";$h->query("SET time_zone = '+00:00';");}}$Nh=$_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
     6923as$l){$b->dumpDatabase($l);if($h->select_db($l)){if($de&&preg_match('~CREATE~',$Nh)&&($Hb=$h->result("SHOW CREATE DATABASE ".idf_escape($l),1))){set_utf8mb4($Hb);if($Nh=="DROP+CREATE")echo"DROP DATABASE IF EXISTS ".idf_escape($l).";\n";echo"$Hb;\n";}if($de){if($Nh)echo
     6924use_sql($l).";\n\n";$Of="";if($_POST["routines"]){foreach(array("FUNCTION","PROCEDURE")as$Zg){foreach(get_rows("SHOW $Zg STATUS WHERE Db = ".q($l),null,"-- ")as$I){$Hb=remove_definer($h->result("SHOW CREATE $Zg ".idf_escape($I["Name"]),2));set_utf8mb4($Hb);$Of.=($Nh!='DROP+CREATE'?"DROP $Zg IF EXISTS ".idf_escape($I["Name"]).";;\n":"")."$Hb;;\n\n";}}}if($_POST["events"]){foreach(get_rows("SHOW EVENTS",null,"-- ")as$I){$Hb=remove_definer($h->result("SHOW CREATE EVENT ".idf_escape($I["Name"]),3));set_utf8mb4($Hb);$Of.=($Nh!='DROP+CREATE'?"DROP EVENT IF EXISTS ".idf_escape($I["Name"]).";;\n":"")."$Hb;;\n\n";}}if($Of)echo"DELIMITER ;;\n\n$Of"."DELIMITER ;\n\n";}if($_POST["table_style"]||$_POST["data_style"]){$fj=array();foreach(table_status('',true)as$B=>$R){$Q=(DB==""||in_array($B,(array)$_POST["tables"]));$Pb=(DB==""||in_array($B,(array)$_POST["data"]));if($Q||$Pb){if($Mc=="tar"){$qi=new
     6925TmpFile;ob_start(array($qi,'write'),1e5);}$b->dumpTable($B,($Q?$_POST["table_style"]:""),(is_view($R)?2:0));if(is_view($R))$fj[]=$B;elseif($Pb){$p=fields($B);$b->dumpData($B,$_POST["data_style"],"SELECT *".convert_fields($p,$p)." FROM ".table($B));}if($de&&$_POST["triggers"]&&$Q&&($Ei=trigger_sql($B)))echo"\nDELIMITER ;;\n$Ei\nDELIMITER ;\n";if($Mc=="tar"){ob_end_flush();tar_file((DB!=""?"":"$l/")."$B.csv",$qi);}elseif($de)echo"\n";}}foreach($fj
     6926as$ej)$b->dumpTable($ej,$_POST["table_style"],1);if($Mc=="tar")echo
     6927pack("x512");}}}if($de)echo"-- ".$h->result("SELECT NOW()")."\n";exit;}page_header(lang(74),$n,($_GET["export"]!=""?array("table"=>$_GET["export"]):array()),h(DB));echo'
    69026928<form action="" method="post">
    69036929<table cellspacing="0" class="layout">
    6904 ';$Sb=array('','USE','DROP+CREATE','CREATE');$Wh=array('','DROP+CREATE','CREATE');$Pb=array('','TRUNCATE+INSERT','INSERT');if($x=="sql")$Pb[]='INSERT+UPDATE';parse_str($_COOKIE["adminer_export"],$I);if(!$I)$I=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($I["events"])){$I["routines"]=$I["events"]=($_GET["dump"]=="");$I["triggers"]=$I["table_style"];}echo"<tr><th>".lang(141)."<td>".html_select("output",$b->dumpOutput(),$I["output"],0)."\n";echo"<tr><th>".lang(142)."<td>".html_select("format",$b->dumpFormat(),$I["format"],0)."\n";echo($x=="sqlite"?"":"<tr><th>".lang(38)."<td>".html_select('db_style',$Sb,$I["db_style"]).(support("routine")?checkbox("routines",1,$I["routines"],lang(143)):"").(support("event")?checkbox("events",1,$I["events"],lang(144)):"")),"<tr><th>".lang(123)."<td>".html_select('table_style',$Wh,$I["table_style"]).checkbox("auto_increment",1,$I["auto_increment"],lang(52)).(support("trigger")?checkbox("triggers",1,$I["triggers"],lang(138)):""),"<tr><th>".lang(145)."<td>".html_select('data_style',$Pb,$I["data_style"]),'</table>
     6930';$Tb=array('','USE','DROP+CREATE','CREATE');$Yh=array('','DROP+CREATE','CREATE');$Qb=array('','TRUNCATE+INSERT','INSERT');if($x=="sql")$Qb[]='INSERT+UPDATE';parse_str($_COOKIE["adminer_export"],$I);if(!$I)$I=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($I["events"])){$I["routines"]=$I["events"]=($_GET["dump"]=="");$I["triggers"]=$I["table_style"];}echo"<tr><th>".lang(141)."<td>".html_select("output",$b->dumpOutput(),$I["output"],0)."\n";echo"<tr><th>".lang(142)."<td>".html_select("format",$b->dumpFormat(),$I["format"],0)."\n";echo($x=="sqlite"?"":"<tr><th>".lang(38)."<td>".html_select('db_style',$Tb,$I["db_style"]).(support("routine")?checkbox("routines",1,$I["routines"],lang(143)):"").(support("event")?checkbox("events",1,$I["events"],lang(144)):"")),"<tr><th>".lang(123)."<td>".html_select('table_style',$Yh,$I["table_style"]).checkbox("auto_increment",1,$I["auto_increment"],lang(52)).(support("trigger")?checkbox("triggers",1,$I["triggers"],lang(138)):""),"<tr><th>".lang(145)."<td>".html_select('data_style',$Qb,$I["data_style"]),'</table>
    69056931<p><input type="submit" value="',lang(74),'">
    6906 <input type="hidden" name="token" value="',$ri,'">
     6932<input type="hidden" name="token" value="',$ti,'">
    69076933
    69086934<table cellspacing="0">
    6909 ',script("qsl('table').onclick = dumpClick;");$mg=array();if(DB!=""){$gb=($a!=""?"":" checked");echo"<thead><tr>","<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$gb>".lang(123)."</label>".script("qs('#check-tables').onclick = partial(formCheck, /^tables\\[/);",""),"<th style='text-align: right;'><label class='block'>".lang(145)."<input type='checkbox' id='check-data'$gb></label>".script("qs('#check-data').onclick = partial(formCheck, /^data\\[/);",""),"</thead>\n";$dj="";$Xh=tables_list();foreach($Xh
    6910 as$B=>$T){$lg=preg_replace('~_.*~','',$B);$gb=($a==""||$a==(substr($a,-1)=="%"?"$lg%":$B));$pg="<tr><td>".checkbox("tables[]",$B,$gb,$B,"","block");if($T!==null&&!preg_match('~table~i',$T))$dj.="$pg\n";else
    6911 echo"$pg<td align='right'><label class='block'><span id='Rows-".h($B)."'></span>".checkbox("data[]",$B,$gb)."</label>\n";$mg[$lg]++;}echo$dj;if($Xh)echo
     6935',script("qsl('table').onclick = dumpClick;");$og=array();if(DB!=""){$gb=($a!=""?"":" checked");echo"<thead><tr>","<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$gb>".lang(123)."</label>".script("qs('#check-tables').onclick = partial(formCheck, /^tables\\[/);",""),"<th style='text-align: right;'><label class='block'>".lang(145)."<input type='checkbox' id='check-data'$gb></label>".script("qs('#check-data').onclick = partial(formCheck, /^data\\[/);",""),"</thead>\n";$fj="";$Zh=tables_list();foreach($Zh
     6936as$B=>$T){$ng=preg_replace('~_.*~','',$B);$gb=($a==""||$a==(substr($a,-1)=="%"?"$ng%":$B));$rg="<tr><td>".checkbox("tables[]",$B,$gb,$B,"","block");if($T!==null&&!preg_match('~table~i',$T))$fj.="$rg\n";else
     6937echo"$rg<td align='right'><label class='block'><span id='Rows-".h($B)."'></span>".checkbox("data[]",$B,$gb)."</label>\n";$og[$ng]++;}echo$fj;if($Zh)echo
    69126938script("ajaxSetHtml('".js_escape(ME)."script=db');");}else{echo"<thead><tr><th style='text-align: left;'>","<label class='block'><input type='checkbox' id='check-databases'".($a==""?" checked":"").">".lang(38)."</label>",script("qs('#check-databases').onclick = partial(formCheck, /^databases\\[/);",""),"</thead>\n";$k=$b->databases();if($k){foreach($k
    6913 as$l){if(!information_schema($l)){$lg=preg_replace('~_.*~','',$l);echo"<tr><td>".checkbox("databases[]",$l,$a==""||$a=="$lg%",$l,"","block")."\n";$mg[$lg]++;}}}else
     6939as$l){if(!information_schema($l)){$ng=preg_replace('~_.*~','',$l);echo"<tr><td>".checkbox("databases[]",$l,$a==""||$a=="$ng%",$l,"","block")."\n";$og[$ng]++;}}}else
    69146940echo"<tr><td><textarea name='databases' rows='10' cols='20'></textarea>";}echo'</table>
    69156941</form>
    6916 ';$Yc=true;foreach($mg
    6917 as$y=>$X){if($y!=""&&$X>1){echo($Yc?"<p>":" ")."<a href='".h(ME)."dump=".urlencode("$y%")."'>".h($y)."</a>";$Yc=false;}}}elseif(isset($_GET["privileges"])){page_header(lang(72));echo'<p class="links"><a href="'.h(ME).'user=">'.lang(146)."</a>";$G=$h->query("SELECT User, Host FROM mysql.".(DB==""?"user":"db WHERE ".q(DB)." LIKE Db")." ORDER BY Host, User");$nd=$G;if(!$G)$G=$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",($nd?"":"<input type='hidden' name='grant' value=''>\n"),"<table cellspacing='0'>\n","<thead><tr><th>".lang(36)."<th>".lang(35)."<th></thead>\n";while($I=$G->fetch_assoc())echo'<tr'.odd().'><td>'.h($I["User"])."<td>".h($I["Host"]).'<td><a href="'.h(ME.'user='.urlencode($I["User"]).'&host='.urlencode($I["Host"])).'">'.lang(10)."</a>\n";if(!$nd||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";}elseif(isset($_GET["sql"])){if(!$n&&$_POST["export"]){dump_headers("sql");$b->dumpTable("","");$b->dumpData("","table",$_POST["query"]);exit;}restart_session();$Ad=&get_session("queries");$_d=&$Ad[DB];if(!$n&&$_POST["clear"]){$_d=array();redirect(remove_from_uri("history"));}page_header((isset($_GET["import"])?lang(73):lang(65)),$n);if(!$n&&$_POST){$kd=false;if(!isset($_GET["import"]))$F=$_POST["query"];elseif($_POST["webfile"]){$Ch=$b->importServerPath();$kd=@fopen((file_exists($Ch)?$Ch:"compress.zlib://$Ch.gz"),"rb");$F=($kd?fread($kd,1e6):false);}else$F=get_file("sql_file",true);if(is_string($F)){if(function_exists('memory_get_usage'))@ini_set("memory_limit",max(ini_bytes("memory_limit"),2*strlen($F)+memory_get_usage()+8e6));if($F!=""&&strlen($F)<1e6){$xg=$F.(preg_match("~;[ \t\r\n]*\$~",$F)?"":";");if(!$_d||reset(end($_d))!=$xg){restart_session();$_d[]=array($xg,time());set_session("queries",$Ad);stop_session();}}$_h="(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";$Yb=";";$C=0;$vc=true;$i=connect();if(is_object($i)&&DB!=""){$i->select_db(DB);if($_GET["ns"]!="")set_schema($_GET["ns"],$i);}$ub=0;$_c=array();$Tf='[\'"'.($x=="sql"?'`#':($x=="sqlite"?'`[':($x=="mssql"?'[':''))).']|/\*|-- |$'.($x=="pgsql"?'|\$[^$]*\$':'');$ti=microtime(true);parse_str($_COOKIE["adminer_export"],$ya);$mc=$b->dumpFormat();unset($mc["sql"]);while($F!=""){if(!$C&&preg_match("~^$_h*+DELIMITER\\s+(\\S+)~i",$F,$A)){$Yb=$A[1];$F=substr($F,strlen($A[0]));}else{preg_match('('.preg_quote($Yb)."\\s*|$Tf)",$F,$A,PREG_OFFSET_CAPTURE,$C);list($id,$hg)=$A[0];if(!$id&&$kd&&!feof($kd))$F.=fread($kd,1e5);else{if(!$id&&rtrim($F)=="")break;$C=$hg+strlen($id);if($id&&rtrim($id)!=$Yb){while(preg_match('('.($id=='/*'?'\*/':($id=='['?']':(preg_match('~^-- |^#~',$id)?"\n":preg_quote($id)."|\\\\."))).'|$)s',$F,$A,PREG_OFFSET_CAPTURE,$C)){$bh=$A[0][0];if(!$bh&&$kd&&!feof($kd))$F.=fread($kd,1e5);else{$C=$A[0][1]+strlen($bh);if($bh[0]!="\\")break;}}}else{$vc=false;$xg=substr($F,0,$hg);$ub++;$pg="<pre id='sql-$ub'><code class='jush-$x'>".$b->sqlCommandQuery($xg)."</code></pre>\n";if($x=="sqlite"&&preg_match("~^$_h*+ATTACH\\b~i",$xg,$A)){echo$pg,"<p class='error'>".lang(147)."\n";$_c[]=" <a href='#sql-$ub'>$ub</a>";if($_POST["error_stops"])break;}else{if(!$_POST["only_errors"]){echo$pg;ob_flush();flush();}$Gh=microtime(true);if($h->multi_query($xg)&&is_object($i)&&preg_match("~^$_h*+USE\\b~i",$xg))$i->query($xg);do{$G=$h->store_result();if($h->error){echo($_POST["only_errors"]?$pg:""),"<p class='error'>".lang(148).($h->errno?" ($h->errno)":"").": ".error()."\n";$_c[]=" <a href='#sql-$ub'>$ub</a>";if($_POST["error_stops"])break
    6918 2;}else{$hi=" <span class='time'>(".format_time($Gh).")</span>".(strlen($xg)<1000?" <a href='".h(ME)."sql=".urlencode(trim($xg))."'>".lang(10)."</a>":"");$_a=$h->affected_rows;$gj=($_POST["only_errors"]?"":$m->warnings());$hj="warnings-$ub";if($gj)$hi.=", <a href='#$hj'>".lang(47)."</a>".script("qsl('a').onclick = partial(toggle, '$hj');","");$Hc=null;$Ic="explain-$ub";if(is_object($G)){$z=$_POST["limit"];$Ff=select($G,$i,array(),$z);if(!$_POST["only_errors"]){echo"<form action='' method='post'>\n";$jf=$G->num_rows;echo"<p>".($jf?($z&&$jf>$z?lang(149,$z):"").lang(150,$jf):""),$hi;if($i&&preg_match("~^($_h|\\()*+SELECT\\b~i",$xg)&&($Hc=explain($i,$xg)))echo", <a href='#$Ic'>Explain</a>".script("qsl('a').onclick = partial(toggle, '$Ic');","");$t="export-$ub";echo", <a href='#$t'>".lang(74)."</a>".script("qsl('a').onclick = partial(toggle, '$t');","")."<span id='$t' class='hidden'>: ".html_select("output",$b->dumpOutput(),$ya["output"])." ".html_select("format",$mc,$ya["format"])."<input type='hidden' name='query' value='".h($xg)."'>"." <input type='submit' name='export' value='".lang(74)."'><input type='hidden' name='token' value='$ri'></span>\n"."</form>\n";}}else{if(preg_match("~^$_h*+(CREATE|DROP|ALTER)$_h++(DATABASE|SCHEMA)\\b~i",$xg)){restart_session();set_session("dbs",null);stop_session();}if(!$_POST["only_errors"])echo"<p class='message' title='".h($h->info)."'>".lang(151,$_a)."$hi\n";}echo($gj?"<div id='$hj' class='hidden'>\n$gj</div>\n":"");if($Hc){echo"<div id='$Ic' class='hidden'>\n";select($Hc,$i,$Ff);echo"</div>\n";}}$Gh=microtime(true);}while($h->next_result());}$F=substr($F,$C);$C=0;}}}}if($vc)echo"<p class='message'>".lang(152)."\n";elseif($_POST["only_errors"]){echo"<p class='message'>".lang(153,$ub-count($_c))," <span class='time'>(".format_time($ti).")</span>\n";}elseif($_c&&$ub>1)echo"<p class='error'>".lang(148).": ".implode("",$_c)."\n";}else
     6942';$ad=true;foreach($og
     6943as$y=>$X){if($y!=""&&$X>1){echo($ad?"<p>":" ")."<a href='".h(ME)."dump=".urlencode("$y%")."'>".h($y)."</a>";$ad=false;}}}elseif(isset($_GET["privileges"])){page_header(lang(72));echo'<p class="links"><a href="'.h(ME).'user=">'.lang(146)."</a>";$G=$h->query("SELECT User, Host FROM mysql.".(DB==""?"user":"db WHERE ".q(DB)." LIKE Db")." ORDER BY Host, User");$pd=$G;if(!$G)$G=$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",($pd?"":"<input type='hidden' name='grant' value=''>\n"),"<table cellspacing='0'>\n","<thead><tr><th>".lang(36)."<th>".lang(35)."<th></thead>\n";while($I=$G->fetch_assoc())echo'<tr'.odd().'><td>'.h($I["User"])."<td>".h($I["Host"]).'<td><a href="'.h(ME.'user='.urlencode($I["User"]).'&host='.urlencode($I["Host"])).'">'.lang(10)."</a>\n";if(!$pd||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";}elseif(isset($_GET["sql"])){if(!$n&&$_POST["export"]){dump_headers("sql");$b->dumpTable("","");$b->dumpData("","table",$_POST["query"]);exit;}restart_session();$Cd=&get_session("queries");$Bd=&$Cd[DB];if(!$n&&$_POST["clear"]){$Bd=array();redirect(remove_from_uri("history"));}page_header((isset($_GET["import"])?lang(73):lang(65)),$n);if(!$n&&$_POST){$md=false;if(!isset($_GET["import"]))$F=$_POST["query"];elseif($_POST["webfile"]){$Eh=$b->importServerPath();$md=@fopen((file_exists($Eh)?$Eh:"compress.zlib://$Eh.gz"),"rb");$F=($md?fread($md,1e6):false);}else$F=get_file("sql_file",true);if(is_string($F)){if(function_exists('memory_get_usage'))@ini_set("memory_limit",max(ini_bytes("memory_limit"),2*strlen($F)+memory_get_usage()+8e6));if($F!=""&&strlen($F)<1e6){$zg=$F.(preg_match("~;[ \t\r\n]*\$~",$F)?"":";");if(!$Bd||reset(end($Bd))!=$zg){restart_session();$Bd[]=array($zg,time());set_session("queries",$Cd);stop_session();}}$Bh="(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";$ac=";";$C=0;$xc=true;$i=connect();if(is_object($i)&&DB!=""){$i->select_db(DB);if($_GET["ns"]!="")set_schema($_GET["ns"],$i);}$ub=0;$Bc=array();$Vf='[\'"'.($x=="sql"?'`#':($x=="sqlite"?'`[':($x=="mssql"?'[':''))).']|/\*|-- |$'.($x=="pgsql"?'|\$[^$]*\$':'');$vi=microtime(true);parse_str($_COOKIE["adminer_export"],$ya);$oc=$b->dumpFormat();unset($oc["sql"]);while($F!=""){if(!$C&&preg_match("~^$Bh*+DELIMITER\\s+(\\S+)~i",$F,$A)){$ac=$A[1];$F=substr($F,strlen($A[0]));}else{preg_match('('.preg_quote($ac)."\\s*|$Vf)",$F,$A,PREG_OFFSET_CAPTURE,$C);list($kd,$jg)=$A[0];if(!$kd&&$md&&!feof($md))$F.=fread($md,1e5);else{if(!$kd&&rtrim($F)=="")break;$C=$jg+strlen($kd);if($kd&&rtrim($kd)!=$ac){while(preg_match('('.($kd=='/*'?'\*/':($kd=='['?']':(preg_match('~^-- |^#~',$kd)?"\n":preg_quote($kd)."|\\\\."))).'|$)s',$F,$A,PREG_OFFSET_CAPTURE,$C)){$dh=$A[0][0];if(!$dh&&$md&&!feof($md))$F.=fread($md,1e5);else{$C=$A[0][1]+strlen($dh);if($dh[0]!="\\")break;}}}else{$xc=false;$zg=substr($F,0,$jg);$ub++;$rg="<pre id='sql-$ub'><code class='jush-$x'>".$b->sqlCommandQuery($zg)."</code></pre>\n";if($x=="sqlite"&&preg_match("~^$Bh*+ATTACH\\b~i",$zg,$A)){echo$rg,"<p class='error'>".lang(147)."\n";$Bc[]=" <a href='#sql-$ub'>$ub</a>";if($_POST["error_stops"])break;}else{if(!$_POST["only_errors"]){echo$rg;ob_flush();flush();}$Ih=microtime(true);if($h->multi_query($zg)&&is_object($i)&&preg_match("~^$Bh*+USE\\b~i",$zg))$i->query($zg);do{$G=$h->store_result();if($h->error){echo($_POST["only_errors"]?$rg:""),"<p class='error'>".lang(148).($h->errno?" ($h->errno)":"").": ".error()."\n";$Bc[]=" <a href='#sql-$ub'>$ub</a>";if($_POST["error_stops"])break
     69442;}else{$ji=" <span class='time'>(".format_time($Ih).")</span>".(strlen($zg)<1000?" <a href='".h(ME)."sql=".urlencode(trim($zg))."'>".lang(10)."</a>":"");$_a=$h->affected_rows;$ij=($_POST["only_errors"]?"":$m->warnings());$jj="warnings-$ub";if($ij)$ji.=", <a href='#$jj'>".lang(47)."</a>".script("qsl('a').onclick = partial(toggle, '$jj');","");$Jc=null;$Kc="explain-$ub";if(is_object($G)){$z=$_POST["limit"];$Hf=select($G,$i,array(),$z);if(!$_POST["only_errors"]){echo"<form action='' method='post'>\n";$lf=$G->num_rows;echo"<p>".($lf?($z&&$lf>$z?lang(149,$z):"").lang(150,$lf):""),$ji;if($i&&preg_match("~^($Bh|\\()*+SELECT\\b~i",$zg)&&($Jc=explain($i,$zg)))echo", <a href='#$Kc'>Explain</a>".script("qsl('a').onclick = partial(toggle, '$Kc');","");$t="export-$ub";echo", <a href='#$t'>".lang(74)."</a>".script("qsl('a').onclick = partial(toggle, '$t');","")."<span id='$t' class='hidden'>: ".html_select("output",$b->dumpOutput(),$ya["output"])." ".html_select("format",$oc,$ya["format"])."<input type='hidden' name='query' value='".h($zg)."'>"." <input type='submit' name='export' value='".lang(74)."'><input type='hidden' name='token' value='$ti'></span>\n"."</form>\n";}}else{if(preg_match("~^$Bh*+(CREATE|DROP|ALTER)$Bh++(DATABASE|SCHEMA)\\b~i",$zg)){restart_session();set_session("dbs",null);stop_session();}if(!$_POST["only_errors"])echo"<p class='message' title='".h($h->info)."'>".lang(151,$_a)."$ji\n";}echo($ij?"<div id='$jj' class='hidden'>\n$ij</div>\n":"");if($Jc){echo"<div id='$Kc' class='hidden'>\n";select($Jc,$i,$Hf);echo"</div>\n";}}$Ih=microtime(true);}while($h->next_result());}$F=substr($F,$C);$C=0;}}}}if($xc)echo"<p class='message'>".lang(152)."\n";elseif($_POST["only_errors"]){echo"<p class='message'>".lang(153,$ub-count($Bc))," <span class='time'>(".format_time($vi).")</span>\n";}elseif($Bc&&$ub>1)echo"<p class='error'>".lang(148).": ".implode("",$Bc)."\n";}else
    69196945echo"<p class='error'>".upload_error($F)."\n";}echo'
    69206946<form action="" method="post" enctype="multipart/form-data" id="form">
    6921 ';$Ec="<input type='submit' value='".lang(154)."' title='Ctrl+Enter'>";if(!isset($_GET["import"])){$xg=$_GET["sql"];if($_POST)$xg=$_POST["query"];elseif($_GET["history"]=="all")$xg=$_d;elseif($_GET["history"]!="")$xg=$_d[$_GET["history"]][0];echo"<p>";textarea("query",$xg,20);echo
    6922 script(($_POST?"":"qs('textarea').focus();\n")."qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '".remove_from_uri("sql|limit|error_stops|only_errors")."');"),"<p>$Ec\n",lang(155).": <input type='number' name='limit' class='size' value='".h($_POST?$_POST["limit"]:$_GET["limit"])."'>\n";}else{echo"<fieldset><legend>".lang(156)."</legend><div>";$td=(extension_loaded("zlib")?"[.gz]":"");echo(ini_bool("file_uploads")?"SQL$td (&lt; ".ini_get("upload_max_filesize")."B): <input type='file' name='sql_file[]' multiple>\n$Ec":lang(157)),"</div></fieldset>\n";$Id=$b->importServerPath();if($Id){echo"<fieldset><legend>".lang(158)."</legend><div>",lang(159,"<code>".h($Id)."$td</code>"),' <input type="submit" name="webfile" value="'.lang(160).'">',"</div></fieldset>\n";}echo"<p>";}echo
    6923 checkbox("error_stops",1,($_POST?$_POST["error_stops"]:isset($_GET["import"])),lang(161))."\n",checkbox("only_errors",1,($_POST?$_POST["only_errors"]:isset($_GET["import"])),lang(162))."\n","<input type='hidden' name='token' value='$ri'>\n";if(!isset($_GET["import"])&&$_d){print_fieldset("history",lang(163),$_GET["history"]!="");for($X=end($_d);$X;$X=prev($_d)){$y=key($_d);list($xg,$hi,$qc)=$X;echo'<a href="'.h(ME."sql=&history=$y").'">'.lang(10)."</a>"." <span class='time' title='".@date('Y-m-d',$hi)."'>".@date("H:i:s",$hi)."</span>"." <code class='jush-$x'>".shorten_utf8(ltrim(str_replace("\n"," ",str_replace("\r","",preg_replace('~^(#|-- ).*~m','',$xg)))),80,"</code>").($qc?" <span class='time'>($qc)</span>":"")."<br>\n";}echo"<input type='submit' name='clear' value='".lang(164)."'>\n","<a href='".h(ME."sql=&history=all")."'>".lang(165)."</a>\n","</div></fieldset>\n";}echo'</form>
    6924 ';}elseif(isset($_GET["edit"])){$a=$_GET["edit"];$p=fields($a);$Z=(isset($_GET["select"])?($_POST["check"]&&count($_POST["check"])==1?where_check($_POST["check"][0],$p):""):where($_GET,$p));$Mi=(isset($_GET["select"])?$_POST["edit"]:$Z);foreach($p
    6925 as$B=>$o){if(!isset($o["privileges"][$Mi?"update":"insert"])||$b->fieldName($o)==""||$o["generated"])unset($p[$B]);}if($_POST&&!$n&&!isset($_GET["select"])){$_e=$_POST["referer"];if($_POST["insert"])$_e=($Mi?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$_e))$_e=ME."select=".urlencode($a);$w=indexes($a);$Hi=unique_array($_GET["where"],$w);$_g="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($_e,lang(166),$m->delete($a,$_g,!$Hi));else{$N=array();foreach($p
    6926 as$B=>$o){$X=process_input($o);if($X!==false&&$X!==null)$N[idf_escape($B)]=$X;}if($Mi){if(!$N)redirect($_e);queries_redirect($_e,lang(167),$m->update($a,$N,$_g,!$Hi));if(is_ajax()){page_headers();page_messages($n);exit;}}else{$G=$m->insert($a,$N);$re=($G?last_id():0);queries_redirect($_e,lang(168,($re?" $re":"")),$G);}}}$I=null;if($_POST["save"])$I=(array)$_POST["fields"];elseif($Z){$K=array();foreach($p
     6947';$Gc="<input type='submit' value='".lang(154)."' title='Ctrl+Enter'>";if(!isset($_GET["import"])){$zg=$_GET["sql"];if($_POST)$zg=$_POST["query"];elseif($_GET["history"]=="all")$zg=$Bd;elseif($_GET["history"]!="")$zg=$Bd[$_GET["history"]][0];echo"<p>";textarea("query",$zg,20);echo
     6948script(($_POST?"":"qs('textarea').focus();\n")."qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '".remove_from_uri("sql|limit|error_stops|only_errors")."');"),"<p>$Gc\n",lang(155).": <input type='number' name='limit' class='size' value='".h($_POST?$_POST["limit"]:$_GET["limit"])."'>\n";}else{echo"<fieldset><legend>".lang(156)."</legend><div>";$vd=(extension_loaded("zlib")?"[.gz]":"");echo(ini_bool("file_uploads")?"SQL$vd (&lt; ".ini_get("upload_max_filesize")."B): <input type='file' name='sql_file[]' multiple>\n$Gc":lang(157)),"</div></fieldset>\n";$Kd=$b->importServerPath();if($Kd){echo"<fieldset><legend>".lang(158)."</legend><div>",lang(159,"<code>".h($Kd)."$vd</code>"),' <input type="submit" name="webfile" value="'.lang(160).'">',"</div></fieldset>\n";}echo"<p>";}echo
     6949checkbox("error_stops",1,($_POST?$_POST["error_stops"]:isset($_GET["import"])),lang(161))."\n",checkbox("only_errors",1,($_POST?$_POST["only_errors"]:isset($_GET["import"])),lang(162))."\n","<input type='hidden' name='token' value='$ti'>\n";if(!isset($_GET["import"])&&$Bd){print_fieldset("history",lang(163),$_GET["history"]!="");for($X=end($Bd);$X;$X=prev($Bd)){$y=key($Bd);list($zg,$ji,$sc)=$X;echo'<a href="'.h(ME."sql=&history=$y").'">'.lang(10)."</a>"." <span class='time' title='".@date('Y-m-d',$ji)."'>".@date("H:i:s",$ji)."</span>"." <code class='jush-$x'>".shorten_utf8(ltrim(str_replace("\n"," ",str_replace("\r","",preg_replace('~^(#|-- ).*~m','',$zg)))),80,"</code>").($sc?" <span class='time'>($sc)</span>":"")."<br>\n";}echo"<input type='submit' name='clear' value='".lang(164)."'>\n","<a href='".h(ME."sql=&history=all")."'>".lang(165)."</a>\n","</div></fieldset>\n";}echo'</form>
     6950';}elseif(isset($_GET["edit"])){$a=$_GET["edit"];$p=fields($a);$Z=(isset($_GET["select"])?($_POST["check"]&&count($_POST["check"])==1?where_check($_POST["check"][0],$p):""):where($_GET,$p));$Oi=(isset($_GET["select"])?$_POST["edit"]:$Z);foreach($p
     6951as$B=>$o){if(!isset($o["privileges"][$Oi?"update":"insert"])||$b->fieldName($o)==""||$o["generated"])unset($p[$B]);}if($_POST&&!$n&&!isset($_GET["select"])){$Be=$_POST["referer"];if($_POST["insert"])$Be=($Oi?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$Be))$Be=ME."select=".urlencode($a);$w=indexes($a);$Ji=unique_array($_GET["where"],$w);$Bg="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($Be,lang(166),$m->delete($a,$Bg,!$Ji));else{$N=array();foreach($p
     6952as$B=>$o){$X=process_input($o);if($X!==false&&$X!==null)$N[idf_escape($B)]=$X;}if($Oi){if(!$N)redirect($Be);queries_redirect($Be,lang(167),$m->update($a,$N,$Bg,!$Ji));if(is_ajax()){page_headers();page_messages($n);exit;}}else{$G=$m->insert($a,$N);$te=($G?last_id():0);queries_redirect($Be,lang(168,($te?" $te":"")),$G);}}}$I=null;if($_POST["save"])$I=(array)$_POST["fields"];elseif($Z){$K=array();foreach($p
    69276953as$B=>$o){if(isset($o["privileges"]["select"])){$Ha=convert_field($o);if($_POST["clone"]&&$o["auto_increment"])$Ha="''";if($x=="sql"&&preg_match("~enum|set~",$o["type"]))$Ha="1*".idf_escape($B);$K[]=($Ha?"$Ha AS ":"").idf_escape($B);}}$I=array();if(!support("table"))$K=array("*");if($K){$G=$m->select($a,$K,array($Z),$K,array(),(isset($_GET["select"])?2:1));if(!$G)$n=error();else{$I=$G->fetch_assoc();if(!$I)$I=false;}if(isset($_GET["select"])&&(!$I||$G->fetch_assoc()))$I=null;}}if(!support("table")&&!$p){if(!$Z){$G=$m->select($a,array("*"),$Z,array("*"));$I=($G?$G->fetch_assoc():false);if(!$I)$I=array($m->primary=>"");}if($I){foreach($I
    6928 as$y=>$X){if(!$Z)$I[$y]=null;$p[$y]=array("field"=>$y,"null"=>($y!=$m->primary),"auto_increment"=>($y==$m->primary));}}}edit_form($a,$p,$I,$Mi);}elseif(isset($_GET["create"])){$a=$_GET["create"];$Vf=array();foreach(array('HASH','LINEAR HASH','KEY','LINEAR KEY','RANGE','LIST')as$y)$Vf[$y]=$y;$Hg=referencable_primary($a);$gd=array();foreach($Hg
    6929 as$Sh=>$o)$gd[str_replace("`","``",$Sh)."`".str_replace("`","``",$o["field"])]=$Sh;$If=array();$R=array();if($a!=""){$If=fields($a);$R=table_status($a);if(!$R)$n=lang(9);}$I=$_POST;$I["fields"]=(array)$I["fields"];if($I["auto_increment_col"])$I["fields"][$I["auto_increment_col"]]["auto_increment"]=true;if($_POST)set_adminer_settings(array("comments"=>$_POST["comments"],"defaults"=>$_POST["defaults"]));if($_POST&&!process_fields($I["fields"])&&!$n){if($_POST["drop"])queries_redirect(substr(ME,0,-1),lang(169),drop_tables(array($a)));else{$p=array();$Ea=array();$Ri=false;$ed=array();$Hf=reset($If);$Ba=" FIRST";foreach($I["fields"]as$y=>$o){$q=$gd[$o["type"]];$Di=($q!==null?$Hg[$q]:$o);if($o["field"]!=""){if(!$o["has_default"])$o["default"]=null;if($y==$I["auto_increment_col"])$o["auto_increment"]=true;$ug=process_field($o,$Di);$Ea[]=array($o["orig"],$ug,$Ba);if($ug!=process_field($Hf,$Hf)){$p[]=array($o["orig"],$ug,$Ba);if($o["orig"]!=""||$Ba)$Ri=true;}if($q!==null)$ed[idf_escape($o["field"])]=($a!=""&&$x!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$gd[$o["type"]],'source'=>array($o["field"]),'target'=>array($Di["field"]),'on_delete'=>$o["on_delete"],));$Ba=" AFTER ".idf_escape($o["field"]);}elseif($o["orig"]!=""){$Ri=true;$p[]=array($o["orig"]);}if($o["orig"]!=""){$Hf=next($If);if(!$Hf)$Ba="";}}$Xf="";if($Vf[$I["partition_by"]]){$Yf=array();if($I["partition_by"]=='RANGE'||$I["partition_by"]=='LIST'){foreach(array_filter($I["partition_names"])as$y=>$X){$Y=$I["partition_values"][$y];$Yf[]="\n  PARTITION ".idf_escape($X)." VALUES ".($I["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$Xf.="\nPARTITION BY $I[partition_by]($I[partition])".($Yf?" (".implode(",",$Yf)."\n)":($I["partitions"]?" PARTITIONS ".(+$I["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$Xf.="\nREMOVE PARTITIONING";$Oe=lang(170);if($a==""){cookie("adminer_engine",$I["Engine"]);$Oe=lang(171);}$B=trim($I["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($B),$Oe,alter_table($a,$B,($x=="sqlite"&&($Ri||$ed)?$Ea:$p),$ed,($I["Comment"]!=$R["Comment"]?$I["Comment"]:null),($I["Engine"]&&$I["Engine"]!=$R["Engine"]?$I["Engine"]:""),($I["Collation"]&&$I["Collation"]!=$R["Collation"]?$I["Collation"]:""),($I["Auto_increment"]!=""?number($I["Auto_increment"]):""),$Xf));}}page_header(($a!=""?lang(45):lang(75)),$n,array("table"=>$a),h($a));if(!$_POST){$I=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($U["int"])?"int":(isset($U["integer"])?"integer":"")),"on_update"=>"")),"partition_names"=>array(""),);if($a!=""){$I=$R;$I["name"]=$a;$I["fields"]=array();if(!$_GET["auto_increment"])$I["Auto_increment"]="";foreach($If
    6930 as$o){$o["has_default"]=isset($o["default"]);$I["fields"][]=$o;}if(support("partitioning")){$ld="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$G=$h->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $ld ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($I["partition_by"],$I["partitions"],$I["partition"])=$G->fetch_row();$Yf=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $ld AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$Yf[""]="";$I["partition_names"]=array_keys($Yf);$I["partition_values"]=array_values($Yf);}}}$qb=collations();$xc=engines();foreach($xc
    6931 as$wc){if(!strcasecmp($wc,$I["Engine"])){$I["Engine"]=$wc;break;}}echo'
     6954as$y=>$X){if(!$Z)$I[$y]=null;$p[$y]=array("field"=>$y,"null"=>($y!=$m->primary),"auto_increment"=>($y==$m->primary));}}}edit_form($a,$p,$I,$Oi);}elseif(isset($_GET["create"])){$a=$_GET["create"];$Xf=array();foreach(array('HASH','LINEAR HASH','KEY','LINEAR KEY','RANGE','LIST')as$y)$Xf[$y]=$y;$Jg=referencable_primary($a);$id=array();foreach($Jg
     6955as$Uh=>$o)$id[str_replace("`","``",$Uh)."`".str_replace("`","``",$o["field"])]=$Uh;$Kf=array();$R=array();if($a!=""){$Kf=fields($a);$R=table_status($a);if(!$R)$n=lang(9);}$I=$_POST;$I["fields"]=(array)$I["fields"];if($I["auto_increment_col"])$I["fields"][$I["auto_increment_col"]]["auto_increment"]=true;if($_POST)set_adminer_settings(array("comments"=>$_POST["comments"],"defaults"=>$_POST["defaults"]));if($_POST&&!process_fields($I["fields"])&&!$n){if($_POST["drop"])queries_redirect(substr(ME,0,-1),lang(169),drop_tables(array($a)));else{$p=array();$Ea=array();$Ti=false;$gd=array();$Jf=reset($Kf);$Ba=" FIRST";foreach($I["fields"]as$y=>$o){$q=$id[$o["type"]];$Fi=($q!==null?$Jg[$q]:$o);if($o["field"]!=""){if(!$o["has_default"])$o["default"]=null;if($y==$I["auto_increment_col"])$o["auto_increment"]=true;$wg=process_field($o,$Fi);$Ea[]=array($o["orig"],$wg,$Ba);if($wg!=process_field($Jf,$Jf)){$p[]=array($o["orig"],$wg,$Ba);if($o["orig"]!=""||$Ba)$Ti=true;}if($q!==null)$gd[idf_escape($o["field"])]=($a!=""&&$x!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$id[$o["type"]],'source'=>array($o["field"]),'target'=>array($Fi["field"]),'on_delete'=>$o["on_delete"],));$Ba=" AFTER ".idf_escape($o["field"]);}elseif($o["orig"]!=""){$Ti=true;$p[]=array($o["orig"]);}if($o["orig"]!=""){$Jf=next($Kf);if(!$Jf)$Ba="";}}$Zf="";if($Xf[$I["partition_by"]]){$ag=array();if($I["partition_by"]=='RANGE'||$I["partition_by"]=='LIST'){foreach(array_filter($I["partition_names"])as$y=>$X){$Y=$I["partition_values"][$y];$ag[]="\n  PARTITION ".idf_escape($X)." VALUES ".($I["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$Zf.="\nPARTITION BY $I[partition_by]($I[partition])".($ag?" (".implode(",",$ag)."\n)":($I["partitions"]?" PARTITIONS ".(+$I["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$Zf.="\nREMOVE PARTITIONING";$Qe=lang(170);if($a==""){cookie("adminer_engine",$I["Engine"]);$Qe=lang(171);}$B=trim($I["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($B),$Qe,alter_table($a,$B,($x=="sqlite"&&($Ti||$gd)?$Ea:$p),$gd,($I["Comment"]!=$R["Comment"]?$I["Comment"]:null),($I["Engine"]&&$I["Engine"]!=$R["Engine"]?$I["Engine"]:""),($I["Collation"]&&$I["Collation"]!=$R["Collation"]?$I["Collation"]:""),($I["Auto_increment"]!=""?number($I["Auto_increment"]):""),$Zf));}}page_header(($a!=""?lang(45):lang(75)),$n,array("table"=>$a),h($a));if(!$_POST){$I=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($U["int"])?"int":(isset($U["integer"])?"integer":"")),"on_update"=>"")),"partition_names"=>array(""),);if($a!=""){$I=$R;$I["name"]=$a;$I["fields"]=array();if(!$_GET["auto_increment"])$I["Auto_increment"]="";foreach($Kf
     6956as$o){$o["has_default"]=isset($o["default"]);$I["fields"][]=$o;}if(support("partitioning")){$nd="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$G=$h->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $nd ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($I["partition_by"],$I["partitions"],$I["partition"])=$G->fetch_row();$ag=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $nd AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$ag[""]="";$I["partition_names"]=array_keys($ag);$I["partition_values"]=array_values($ag);}}}$qb=collations();$zc=engines();foreach($zc
     6957as$yc){if(!strcasecmp($yc,$I["Engine"])){$I["Engine"]=$yc;break;}}echo'
    69326958<form action="" method="post" id="form">
    69336959<p>
     
    69356961lang(172),': <input name="name" data-maxlength="64" value="',h($I["name"]),'" autocapitalize="off">
    69366962';if($a==""&&!$_POST)echo
    6937 script("focus(qs('#form')['name']);");echo($xc?"<select name='Engine'>".optionlist(array(""=>"(".lang(173).")")+$xc,$I["Engine"])."</select>".on_help("getTarget(event).value",1).script("qsl('select').onchange = helpClose;"):""),' ',($qb&&!preg_match("~sqlite|mssql~",$x)?html_select("Collation",array(""=>"(".lang(101).")")+$qb,$I["Collation"]):""),' <input type="submit" value="',lang(14),'">
     6963script("focus(qs('#form')['name']);");echo($zc?"<select name='Engine'>".optionlist(array(""=>"(".lang(173).")")+$zc,$I["Engine"])."</select>".on_help("getTarget(event).value",1).script("qsl('select').onchange = helpClose;"):""),' ',($qb&&!preg_match("~sqlite|mssql~",$x)?html_select("Collation",array(""=>"(".lang(101).")")+$qb,$I["Collation"]):""),' <input type="submit" value="',lang(14),'">
    69386964';}echo'
    69396965';if(support("columns")){echo'<div class="scrollable">
    69406966<table cellspacing="0" id="edit-fields" class="nowrap">
    6941 ';edit_fields($I["fields"],$qb,"TABLE",$gd);echo'</table>
    6942 </div>
     6967';edit_fields($I["fields"],$qb,"TABLE",$id);echo'</table>
     6968',script("editFields();"),'</div>
    69436969<p>
    69446970',lang(52),': <input type="number" name="Auto_increment" size="6" value="',h($I["Auto_increment"]),'">
     
    69466972<input type="submit" value="',lang(14),'">
    69476973';}echo'
    6948 ';if($a!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$a));}if(support("partitioning")){$Wf=preg_match('~RANGE|LIST~',$I["partition_by"]);print_fieldset("partition",lang(176),$I["partition_by"]);echo'<p>
    6949 ',"<select name='partition_by'>".optionlist(array(""=>"")+$Vf,$I["partition_by"])."</select>".on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')",1).script("qsl('select').onchange = partitionByChange;"),'(<input name="partition" value="',h($I["partition"]),'">)
    6950 ',lang(177),': <input type="number" name="partitions" class="size',($Wf||!$I["partition_by"]?" hidden":""),'" value="',h($I["partitions"]),'">
    6951 <table cellspacing="0" id="partition-table"',($Wf?"":" class='hidden'"),'>
     6974';if($a!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$a));}if(support("partitioning")){$Yf=preg_match('~RANGE|LIST~',$I["partition_by"]);print_fieldset("partition",lang(176),$I["partition_by"]);echo'<p>
     6975',"<select name='partition_by'>".optionlist(array(""=>"")+$Xf,$I["partition_by"])."</select>".on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')",1).script("qsl('select').onchange = partitionByChange;"),'(<input name="partition" value="',h($I["partition"]),'">)
     6976',lang(177),': <input type="number" name="partitions" class="size',($Yf||!$I["partition_by"]?" hidden":""),'" value="',h($I["partitions"]),'">
     6977<table cellspacing="0" id="partition-table"',($Yf?"":" class='hidden'"),'>
    69526978<thead><tr><th>',lang(178),'<th>',lang(179),'</thead>
    69536979';foreach($I["partition_names"]as$y=>$X){echo'<tr>','<td><input name="partition_names[]" value="'.h($X).'" autocapitalize="off">',($y==count($I["partition_names"])-1?script("qsl('input').oninput = partitionNameChange;"):''),'<td><input name="partition_values[]" value="'.h($I["partition_values"][$y]).'">';}echo'</table>
    69546980</div></fieldset>
    6955 ';}echo'<input type="hidden" name="token" value="',$ri,'">
     6981';}echo'<input type="hidden" name="token" value="',$ti,'">
    69566982</form>
    6957 ',script("qs('#form')['defaults'].onclick();".(support("comment")?" editingCommentsClick(qs('#form')['comments']);":""));}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$Ld=array("PRIMARY","UNIQUE","INDEX");$R=table_status($a,true);if(preg_match('~MyISAM|M?aria'.(min_version(5.6,'10.0.5')?'|InnoDB':'').'~i',$R["Engine"]))$Ld[]="FULLTEXT";if(preg_match('~MyISAM|M?aria'.(min_version(5.7,'10.2.2')?'|InnoDB':'').'~i',$R["Engine"]))$Ld[]="SPATIAL";$w=indexes($a);$ng=array();if($x=="mongo"){$ng=$w["_id_"];unset($Ld[0]);unset($w["_id_"]);}$I=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["drop_col"]){$c=array();foreach($I["indexes"]as$v){$B=$v["name"];if(in_array($v["type"],$Ld)){$f=array();$xe=array();$ac=array();$N=array();ksort($v["columns"]);foreach($v["columns"]as$y=>$e){if($e!=""){$we=$v["lengths"][$y];$Zb=$v["descs"][$y];$N[]=idf_escape($e).($we?"(".(+$we).")":"").($Zb?" DESC":"");$f[]=$e;$xe[]=($we?$we:null);$ac[]=$Zb;}}if($f){$Fc=$w[$B];if($Fc){ksort($Fc["columns"]);ksort($Fc["lengths"]);ksort($Fc["descs"]);if($v["type"]==$Fc["type"]&&array_values($Fc["columns"])===$f&&(!$Fc["lengths"]||array_values($Fc["lengths"])===$xe)&&array_values($Fc["descs"])===$ac){unset($w[$B]);continue;}}$c[]=array($v["type"],$B,$N);}}}foreach($w
    6958 as$B=>$Fc)$c[]=array($Fc["type"],$B,"DROP");if(!$c)redirect(ME."table=".urlencode($a));queries_redirect(ME."table=".urlencode($a),lang(180),alter_indexes($a,$c));}page_header(lang(132),$n,array("table"=>$a),h($a));$p=array_keys(fields($a));if($_POST["add"]){foreach($I["indexes"]as$y=>$v){if($v["columns"][count($v["columns"])]!="")$I["indexes"][$y]["columns"][]="";}$v=end($I["indexes"]);if($v["type"]||array_filter($v["columns"],'strlen'))$I["indexes"][]=array("columns"=>array(1=>""));}if(!$I){foreach($w
     6983';}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$Nd=array("PRIMARY","UNIQUE","INDEX");$R=table_status($a,true);if(preg_match('~MyISAM|M?aria'.(min_version(5.6,'10.0.5')?'|InnoDB':'').'~i',$R["Engine"]))$Nd[]="FULLTEXT";if(preg_match('~MyISAM|M?aria'.(min_version(5.7,'10.2.2')?'|InnoDB':'').'~i',$R["Engine"]))$Nd[]="SPATIAL";$w=indexes($a);$pg=array();if($x=="mongo"){$pg=$w["_id_"];unset($Nd[0]);unset($w["_id_"]);}$I=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["drop_col"]){$c=array();foreach($I["indexes"]as$v){$B=$v["name"];if(in_array($v["type"],$Nd)){$f=array();$ze=array();$cc=array();$N=array();ksort($v["columns"]);foreach($v["columns"]as$y=>$e){if($e!=""){$ye=$v["lengths"][$y];$bc=$v["descs"][$y];$N[]=idf_escape($e).($ye?"(".(+$ye).")":"").($bc?" DESC":"");$f[]=$e;$ze[]=($ye?$ye:null);$cc[]=$bc;}}if($f){$Hc=$w[$B];if($Hc){ksort($Hc["columns"]);ksort($Hc["lengths"]);ksort($Hc["descs"]);if($v["type"]==$Hc["type"]&&array_values($Hc["columns"])===$f&&(!$Hc["lengths"]||array_values($Hc["lengths"])===$ze)&&array_values($Hc["descs"])===$cc){unset($w[$B]);continue;}}$c[]=array($v["type"],$B,$N);}}}foreach($w
     6984as$B=>$Hc)$c[]=array($Hc["type"],$B,"DROP");if(!$c)redirect(ME."table=".urlencode($a));queries_redirect(ME."table=".urlencode($a),lang(180),alter_indexes($a,$c));}page_header(lang(132),$n,array("table"=>$a),h($a));$p=array_keys(fields($a));if($_POST["add"]){foreach($I["indexes"]as$y=>$v){if($v["columns"][count($v["columns"])]!="")$I["indexes"][$y]["columns"][]="";}$v=end($I["indexes"]);if($v["type"]||array_filter($v["columns"],'strlen'))$I["indexes"][]=array("columns"=>array(1=>""));}if(!$I){foreach($w
    69596985as$y=>$v){$w[$y]["name"]=$y;$w[$y]["columns"][]="";}$w[]=array("columns"=>array(1=>""));$I["indexes"]=$w;}echo'
    69606986<form action="" method="post">
     
    69626988<table cellspacing="0" class="nowrap">
    69636989<thead><tr>
    6964 <th id="label-type">',lang(181),'<th><input type="submit" class="wayoff">',lang(182),'<th id="label-name">',lang(183),'<th><noscript>',"<input type='image' class='icon' name='add[0]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.5")."' alt='+' title='".lang(108)."'>",'</noscript>
     6990<th id="label-type">',lang(181),'<th><input type="submit" class="wayoff">',lang(182),'<th id="label-name">',lang(183),'<th><noscript>',"<input type='image' class='icon' name='add[0]' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.6")."' alt='+' title='".lang(108)."'>",'</noscript>
    69656991</thead>
    6966 ';if($ng){echo"<tr><td>PRIMARY<td>";foreach($ng["columns"]as$y=>$e){echo
    6967 select_input(" disabled",$p,$e),"<label><input disabled type='checkbox'>".lang(60)."</label> ";}echo"<td><td>\n";}$ee=1;foreach($I["indexes"]as$v){if(!$_POST["drop_col"]||$ee!=key($_POST["drop_col"])){echo"<tr><td>".html_select("indexes[$ee][type]",array(-1=>"")+$Ld,$v["type"],($ee==count($I["indexes"])?"indexesAddRow.call(this);":1),"label-type"),"<td>";ksort($v["columns"]);$s=1;foreach($v["columns"]as$y=>$e){echo"<span>".select_input(" name='indexes[$ee][columns][$s]' title='".lang(49)."'",($p?array_combine($p,$p):$p),$e,"partial(".($s==count($v["columns"])?"indexesAddColumn":"indexesChangeColumn").", '".js_escape($x=="sql"?"":$_GET["indexes"]."_")."')"),($x=="sql"||$x=="mssql"?"<input type='number' name='indexes[$ee][lengths][$s]' class='size' value='".h($v["lengths"][$y])."' title='".lang(106)."'>":""),(support("descidx")?checkbox("indexes[$ee][descs][$s]",1,$v["descs"][$y],lang(60)):"")," </span>";$s++;}echo"<td><input name='indexes[$ee][name]' value='".h($v["name"])."' autocapitalize='off' aria-labelledby='label-name'>\n","<td><input type='image' class='icon' name='drop_col[$ee]' src='".h(preg_replace("~\\?.*~","",ME)."?file=cross.gif&version=4.7.5")."' alt='x' title='".lang(111)."'>".script("qsl('input').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");}$ee++;}echo'</table>
     6992';if($pg){echo"<tr><td>PRIMARY<td>";foreach($pg["columns"]as$y=>$e){echo
     6993select_input(" disabled",$p,$e),"<label><input disabled type='checkbox'>".lang(60)."</label> ";}echo"<td><td>\n";}$ge=1;foreach($I["indexes"]as$v){if(!$_POST["drop_col"]||$ge!=key($_POST["drop_col"])){echo"<tr><td>".html_select("indexes[$ge][type]",array(-1=>"")+$Nd,$v["type"],($ge==count($I["indexes"])?"indexesAddRow.call(this);":1),"label-type"),"<td>";ksort($v["columns"]);$s=1;foreach($v["columns"]as$y=>$e){echo"<span>".select_input(" name='indexes[$ge][columns][$s]' title='".lang(49)."'",($p?array_combine($p,$p):$p),$e,"partial(".($s==count($v["columns"])?"indexesAddColumn":"indexesChangeColumn").", '".js_escape($x=="sql"?"":$_GET["indexes"]."_")."')"),($x=="sql"||$x=="mssql"?"<input type='number' name='indexes[$ge][lengths][$s]' class='size' value='".h($v["lengths"][$y])."' title='".lang(106)."'>":""),(support("descidx")?checkbox("indexes[$ge][descs][$s]",1,$v["descs"][$y],lang(60)):"")," </span>";$s++;}echo"<td><input name='indexes[$ge][name]' value='".h($v["name"])."' autocapitalize='off' aria-labelledby='label-name'>\n","<td><input type='image' class='icon' name='drop_col[$ge]' src='".h(preg_replace("~\\?.*~","",ME)."?file=cross.gif&version=4.7.6")."' alt='x' title='".lang(111)."'>".script("qsl('input').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");}$ge++;}echo'</table>
    69686994</div>
    69696995<p>
    69706996<input type="submit" value="',lang(14),'">
    6971 <input type="hidden" name="token" value="',$ri,'">
     6997<input type="hidden" name="token" value="',$ti,'">
    69726998</form>
    6973 ';}elseif(isset($_GET["database"])){$I=$_POST;if($_POST&&!$n&&!isset($_POST["add_x"])){$B=trim($I["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),lang(184),drop_databases(array(DB)));}elseif(DB!==$B){if(DB!=""){$_GET["db"]=$B;queries_redirect(preg_replace('~\bdb=[^&]*&~','',ME)."db=".urlencode($B),lang(185),rename_database($B,$I["collation"]));}else{$k=explode("\n",str_replace("\r","",$B));$Mh=true;$qe="";foreach($k
    6974 as$l){if(count($k)==1||$l!=""){if(!create_database($l,$I["collation"]))$Mh=false;$qe=$l;}}restart_session();set_session("dbs",null);queries_redirect(ME."db=".urlencode($qe),lang(186),$Mh);}}else{if(!$I["collation"])redirect(substr(ME,0,-1));query_redirect("ALTER DATABASE ".idf_escape($B).(preg_match('~^[a-z0-9_]+$~i',$I["collation"])?" COLLATE $I[collation]":""),substr(ME,0,-1),lang(187));}}page_header(DB!=""?lang(68):lang(115),$n,array(),h(DB));$qb=collations();$B=DB;if($_POST)$B=$I["name"];elseif(DB!="")$I["collation"]=db_collation(DB,$qb);elseif($x=="sql"){foreach(get_vals("SHOW GRANTS")as$nd){if(preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\.\*)?~',$nd,$A)&&$A[1]){$B=stripcslashes(idf_unescape("`$A[2]`"));break;}}}echo'
     6999';}elseif(isset($_GET["database"])){$I=$_POST;if($_POST&&!$n&&!isset($_POST["add_x"])){$B=trim($I["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),lang(184),drop_databases(array(DB)));}elseif(DB!==$B){if(DB!=""){$_GET["db"]=$B;queries_redirect(preg_replace('~\bdb=[^&]*&~','',ME)."db=".urlencode($B),lang(185),rename_database($B,$I["collation"]));}else{$k=explode("\n",str_replace("\r","",$B));$Oh=true;$se="";foreach($k
     7000as$l){if(count($k)==1||$l!=""){if(!create_database($l,$I["collation"]))$Oh=false;$se=$l;}}restart_session();set_session("dbs",null);queries_redirect(ME."db=".urlencode($se),lang(186),$Oh);}}else{if(!$I["collation"])redirect(substr(ME,0,-1));query_redirect("ALTER DATABASE ".idf_escape($B).(preg_match('~^[a-z0-9_]+$~i',$I["collation"])?" COLLATE $I[collation]":""),substr(ME,0,-1),lang(187));}}page_header(DB!=""?lang(68):lang(115),$n,array(),h(DB));$qb=collations();$B=DB;if($_POST)$B=$I["name"];elseif(DB!="")$I["collation"]=db_collation(DB,$qb);elseif($x=="sql"){foreach(get_vals("SHOW GRANTS")as$pd){if(preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\.\*)?~',$pd,$A)&&$A[1]){$B=stripcslashes(idf_unescape("`$A[2]`"));break;}}}echo'
    69757001<form action="" method="post">
    69767002<p>
    69777003',($_POST["add_x"]||strpos($B,"\n")?'<textarea id="name" name="name" rows="10" cols="40">'.h($B).'</textarea><br>':'<input name="name" id="name" value="'.h($B).'" data-maxlength="64" autocapitalize="off">')."\n".($qb?html_select("collation",array(""=>"(".lang(101).")")+$qb,$I["collation"]).doc_link(array('sql'=>"charset-charsets.html",'mariadb'=>"supported-character-sets-and-collations/",'mssql'=>"ms187963.aspx",)):""),script("focus(qs('#name'));"),'<input type="submit" value="',lang(14),'">
    6978 ';if(DB!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,DB))."\n";elseif(!$_POST["add_x"]&&$_GET["db"]=="")echo"<input type='image' class='icon' name='add' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.5")."' alt='+' title='".lang(108)."'>\n";echo'<input type="hidden" name="token" value="',$ri,'">
     7004';if(DB!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,DB))."\n";elseif(!$_POST["add_x"]&&$_GET["db"]=="")echo"<input type='image' class='icon' name='add' src='".h(preg_replace("~\\?.*~","",ME)."?file=plus.gif&version=4.7.6")."' alt='+' title='".lang(108)."'>\n";echo'<input type="hidden" name="token" value="',$ti,'">
    69797005</form>
    69807006';}elseif(isset($_GET["scheme"])){$I=$_POST;if($_POST&&!$n){$_=preg_replace('~ns=[^&]*&~','',ME)."ns=";if($_POST["drop"])query_redirect("DROP SCHEMA ".idf_escape($_GET["ns"]),$_,lang(188));else{$B=trim($I["name"]);$_.=urlencode($B);if($_GET["ns"]=="")query_redirect("CREATE SCHEMA ".idf_escape($B),$_,lang(189));elseif($_GET["ns"]!=$B)query_redirect("ALTER SCHEMA ".idf_escape($_GET["ns"])." RENAME TO ".idf_escape($B),$_,lang(190));else
     
    69837009<p><input name="name" id="name" value="',h($I["name"]),'" autocapitalize="off">
    69847010',script("focus(qs('#name'));"),'<input type="submit" value="',lang(14),'">
    6985 ';if($_GET["ns"]!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$_GET["ns"]))."\n";echo'<input type="hidden" name="token" value="',$ri,'">
     7011';if($_GET["ns"]!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$_GET["ns"]))."\n";echo'<input type="hidden" name="token" value="',$ti,'">
    69867012</form>
    6987 ';}elseif(isset($_GET["call"])){$da=($_GET["name"]?$_GET["name"]:$_GET["call"]);page_header(lang(191).": ".h($da),$n);$Xg=routine($_GET["call"],(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$Jd=array();$Mf=array();foreach($Xg["fields"]as$s=>$o){if(substr($o["inout"],-3)=="OUT")$Mf[$s]="@".idf_escape($o["field"])." AS ".idf_escape($o["field"]);if(!$o["inout"]||substr($o["inout"],0,2)=="IN")$Jd[]=$s;}if(!$n&&$_POST){$bb=array();foreach($Xg["fields"]as$y=>$o){if(in_array($y,$Jd)){$X=process_input($o);if($X===false)$X="''";if(isset($Mf[$y]))$h->query("SET @".idf_escape($o["field"])." = $X");}$bb[]=(isset($Mf[$y])?"@".idf_escape($o["field"]):$X);}$F=(isset($_GET["callf"])?"SELECT":"CALL")." ".table($da)."(".implode(", ",$bb).")";$Gh=microtime(true);$G=$h->multi_query($F);$_a=$h->affected_rows;echo$b->selectQuery($F,$Gh,!$G);if(!$G)echo"<p class='error'>".error()."\n";else{$i=connect();if(is_object($i))$i->select_db(DB);do{$G=$h->store_result();if(is_object($G))select($G,$i);else
    6988 echo"<p class='message'>".lang(192,$_a)."\n";}while($h->next_result());if($Mf)select($h->query("SELECT ".implode(", ",$Mf)));}}echo'
     7013';}elseif(isset($_GET["call"])){$da=($_GET["name"]?$_GET["name"]:$_GET["call"]);page_header(lang(191).": ".h($da),$n);$Zg=routine($_GET["call"],(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$Ld=array();$Of=array();foreach($Zg["fields"]as$s=>$o){if(substr($o["inout"],-3)=="OUT")$Of[$s]="@".idf_escape($o["field"])." AS ".idf_escape($o["field"]);if(!$o["inout"]||substr($o["inout"],0,2)=="IN")$Ld[]=$s;}if(!$n&&$_POST){$bb=array();foreach($Zg["fields"]as$y=>$o){if(in_array($y,$Ld)){$X=process_input($o);if($X===false)$X="''";if(isset($Of[$y]))$h->query("SET @".idf_escape($o["field"])." = $X");}$bb[]=(isset($Of[$y])?"@".idf_escape($o["field"]):$X);}$F=(isset($_GET["callf"])?"SELECT":"CALL")." ".table($da)."(".implode(", ",$bb).")";$Ih=microtime(true);$G=$h->multi_query($F);$_a=$h->affected_rows;echo$b->selectQuery($F,$Ih,!$G);if(!$G)echo"<p class='error'>".error()."\n";else{$i=connect();if(is_object($i))$i->select_db(DB);do{$G=$h->store_result();if(is_object($G))select($G,$i);else
     7014echo"<p class='message'>".lang(192,$_a)." <span class='time'>".@date("H:i:s")."</span>\n";}while($h->next_result());if($Of)select($h->query("SELECT ".implode(", ",$Of)));}}echo'
    69897015<form action="" method="post">
    6990 ';if($Jd){echo"<table cellspacing='0' class='layout'>\n";foreach($Jd
    6991 as$y){$o=$Xg["fields"][$y];$B=$o["field"];echo"<tr><th>".$b->fieldName($o);$Y=$_POST["fields"][$B];if($Y!=""){if($o["type"]=="enum")$Y=+$Y;if($o["type"]=="set")$Y=array_sum($Y);}input($o,$Y,(string)$_POST["function"][$B]);echo"\n";}echo"</table>\n";}echo'<p>
     7016';if($Ld){echo"<table cellspacing='0' class='layout'>\n";foreach($Ld
     7017as$y){$o=$Zg["fields"][$y];$B=$o["field"];echo"<tr><th>".$b->fieldName($o);$Y=$_POST["fields"][$B];if($Y!=""){if($o["type"]=="enum")$Y=+$Y;if($o["type"]=="set")$Y=array_sum($Y);}input($o,$Y,(string)$_POST["function"][$B]);echo"\n";}echo"</table>\n";}echo'<p>
    69927018<input type="submit" value="',lang(191),'">
    6993 <input type="hidden" name="token" value="',$ri,'">
     7019<input type="hidden" name="token" value="',$ti,'">
    69947020</form>
    6995 ';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$B=$_GET["name"];$I=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$Oe=($_POST["drop"]?lang(193):($B!=""?lang(194):lang(195)));$_e=ME."table=".urlencode($a);if(!$_POST["drop"]){$I["source"]=array_filter($I["source"],'strlen');ksort($I["source"]);$ai=array();foreach($I["source"]as$y=>$X)$ai[$y]=$I["target"][$y];$I["target"]=$ai;}if($x=="sqlite")queries_redirect($_e,$Oe,recreate_table($a,$a,array(),array(),array(" $B"=>($_POST["drop"]?"":" ".format_foreign_key($I)))));else{$c="ALTER TABLE ".table($a);$hc="\nDROP ".($x=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($B);if($_POST["drop"])query_redirect($c.$hc,$_e,$Oe);else{query_redirect($c.($B!=""?"$hc,":"")."\nADD".format_foreign_key($I),$_e,$Oe);$n=lang(196)."<br>$n";}}}page_header(lang(197),$n,array("table"=>$a),h($a));if($_POST){ksort($I["source"]);if($_POST["add"])$I["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$I["target"]=array();}elseif($B!=""){$gd=foreign_keys($a);$I=$gd[$B];$I["source"][]="";}else{$I["table"]=$a;$I["source"]=array("");}echo'
     7021';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$B=$_GET["name"];$I=$_POST;if($_POST&&!$n&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$Qe=($_POST["drop"]?lang(193):($B!=""?lang(194):lang(195)));$Be=ME."table=".urlencode($a);if(!$_POST["drop"]){$I["source"]=array_filter($I["source"],'strlen');ksort($I["source"]);$ci=array();foreach($I["source"]as$y=>$X)$ci[$y]=$I["target"][$y];$I["target"]=$ci;}if($x=="sqlite")queries_redirect($Be,$Qe,recreate_table($a,$a,array(),array(),array(" $B"=>($_POST["drop"]?"":" ".format_foreign_key($I)))));else{$c="ALTER TABLE ".table($a);$jc="\nDROP ".($x=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($B);if($_POST["drop"])query_redirect($c.$jc,$Be,$Qe);else{query_redirect($c.($B!=""?"$jc,":"")."\nADD".format_foreign_key($I),$Be,$Qe);$n=lang(196)."<br>$n";}}}page_header(lang(197),$n,array("table"=>$a),h($a));if($_POST){ksort($I["source"]);if($_POST["add"])$I["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$I["target"]=array();}elseif($B!=""){$id=foreign_keys($a);$I=$id[$B];$I["source"][]="";}else{$I["table"]=$a;$I["source"]=array("");}echo'
    69967022<form action="" method="post">
    6997 ';$zh=array_keys(fields($a));if($I["db"]!="")$h->select_db($I["db"]);if($I["ns"]!="")set_schema($I["ns"]);$Gg=array_keys(array_filter(table_status('',true),'fk_support'));$ai=($a===$I["table"]?$zh:array_keys(fields(in_array($I["table"],$Gg)?$I["table"]:reset($Gg))));$uf="this.form['change-js'].value = '1'; this.form.submit();";echo"<p>".lang(198).": ".html_select("table",$Gg,$I["table"],$uf)."\n";if($x=="pgsql")echo
    6998 lang(78).": ".html_select("ns",$b->schemas(),$I["ns"]!=""?$I["ns"]:$_GET["ns"],$uf);elseif($x!="sqlite"){$Tb=array();foreach($b->databases()as$l){if(!information_schema($l))$Tb[]=$l;}echo
    6999 lang(77).": ".html_select("db",$Tb,$I["db"]!=""?$I["db"]:$_GET["db"],$uf);}echo'<input type="hidden" name="change-js" value="">
     7023';$Ah=array_keys(fields($a));if($I["db"]!="")$h->select_db($I["db"]);if($I["ns"]!="")set_schema($I["ns"]);$Ig=array_keys(array_filter(table_status('',true),'fk_support'));$ci=($a===$I["table"]?$Ah:array_keys(fields(in_array($I["table"],$Ig)?$I["table"]:reset($Ig))));$wf="this.form['change-js'].value = '1'; this.form.submit();";echo"<p>".lang(198).": ".html_select("table",$Ig,$I["table"],$wf)."\n";if($x=="pgsql")echo
     7024lang(78).": ".html_select("ns",$b->schemas(),$I["ns"]!=""?$I["ns"]:$_GET["ns"],$wf);elseif($x!="sqlite"){$Ub=array();foreach($b->databases()as$l){if(!information_schema($l))$Ub[]=$l;}echo
     7025lang(77).": ".html_select("db",$Ub,$I["db"]!=""?$I["db"]:$_GET["db"],$wf);}echo'<input type="hidden" name="change-js" value="">
    70007026<noscript><p><input type="submit" name="change" value="',lang(199),'"></noscript>
    70017027<table cellspacing="0">
    70027028<thead><tr><th id="label-source">',lang(134),'<th id="label-target">',lang(135),'</thead>
    7003 ';$ee=0;foreach($I["source"]as$y=>$X){echo"<tr>","<td>".html_select("source[".(+$y)."]",array(-1=>"")+$zh,$X,($ee==count($I["source"])-1?"foreignAddRow.call(this);":1),"label-source"),"<td>".html_select("target[".(+$y)."]",$ai,$I["target"][$y],1,"label-target");$ee++;}echo'</table>
     7029';$ge=0;foreach($I["source"]as$y=>$X){echo"<tr>","<td>".html_select("source[".(+$y)."]",array(-1=>"")+$Ah,$X,($ge==count($I["source"])-1?"foreignAddRow.call(this);":1),"label-source"),"<td>".html_select("target[".(+$y)."]",$ci,$I["target"][$y],1,"label-target");$ge++;}echo'</table>
    70047030<p>
    7005 ',lang(103),': ',html_select("on_delete",array(-1=>"")+explode("|",$tf),$I["on_delete"]),' ',lang(102),': ',html_select("on_update",array(-1=>"")+explode("|",$tf),$I["on_update"]),doc_link(array('sql'=>"innodb-foreign-key-constraints.html",'mariadb'=>"foreign-keys/",'pgsql'=>"sql-createtable.html#SQL-CREATETABLE-REFERENCES",'mssql'=>"ms174979.aspx",'oracle'=>"https://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm#sthref2903",)),'<p>
     7031',lang(103),': ',html_select("on_delete",array(-1=>"")+explode("|",$vf),$I["on_delete"]),' ',lang(102),': ',html_select("on_update",array(-1=>"")+explode("|",$vf),$I["on_update"]),doc_link(array('sql'=>"innodb-foreign-key-constraints.html",'mariadb'=>"foreign-keys/",'pgsql'=>"sql-createtable.html#SQL-CREATETABLE-REFERENCES",'mssql'=>"ms174979.aspx",'oracle'=>"https://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm#sthref2903",)),'<p>
    70067032<input type="submit" value="',lang(14),'">
    70077033<noscript><p><input type="submit" name="add" value="',lang(200),'"></noscript>
    7008 ';if($B!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$B));}echo'<input type="hidden" name="token" value="',$ri,'">
     7034';if($B!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$B));}echo'<input type="hidden" name="token" value="',$ti,'">
    70097035</form>
    7010 ';}elseif(isset($_GET["view"])){$a=$_GET["view"];$I=$_POST;$Jf="VIEW";if($x=="pgsql"&&$a!=""){$O=table_status($a);$Jf=strtoupper($O["Engine"]);}if($_POST&&!$n){$B=trim($I["name"]);$Ha=" AS\n$I[select]";$_e=ME."table=".urlencode($B);$Oe=lang(201);$T=($_POST["materialized"]?"MATERIALIZED VIEW":"VIEW");if(!$_POST["drop"]&&$a==$B&&$x!="sqlite"&&$T=="VIEW"&&$Jf=="VIEW")query_redirect(($x=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($B).$Ha,$_e,$Oe);else{$ci=$B."_adminer_".uniqid();drop_create("DROP $Jf ".table($a),"CREATE $T ".table($B).$Ha,"DROP $T ".table($B),"CREATE $T ".table($ci).$Ha,"DROP $T ".table($ci),($_POST["drop"]?substr(ME,0,-1):$_e),lang(202),$Oe,lang(203),$a,$B);}}if(!$_POST&&$a!=""){$I=view($a);$I["name"]=$a;$I["materialized"]=($Jf!="VIEW");if(!$n)$n=error();}page_header(($a!=""?lang(44):lang(204)),$n,array("table"=>$a),h($a));echo'
     7036';}elseif(isset($_GET["view"])){$a=$_GET["view"];$I=$_POST;$Lf="VIEW";if($x=="pgsql"&&$a!=""){$O=table_status($a);$Lf=strtoupper($O["Engine"]);}if($_POST&&!$n){$B=trim($I["name"]);$Ha=" AS\n$I[select]";$Be=ME."table=".urlencode($B);$Qe=lang(201);$T=($_POST["materialized"]?"MATERIALIZED VIEW":"VIEW");if(!$_POST["drop"]&&$a==$B&&$x!="sqlite"&&$T=="VIEW"&&$Lf=="VIEW")query_redirect(($x=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($B).$Ha,$Be,$Qe);else{$ei=$B."_adminer_".uniqid();drop_create("DROP $Lf ".table($a),"CREATE $T ".table($B).$Ha,"DROP $T ".table($B),"CREATE $T ".table($ei).$Ha,"DROP $T ".table($ei),($_POST["drop"]?substr(ME,0,-1):$Be),lang(202),$Qe,lang(203),$a,$B);}}if(!$_POST&&$a!=""){$I=view($a);$I["name"]=$a;$I["materialized"]=($Lf!="VIEW");if(!$n)$n=error();}page_header(($a!=""?lang(44):lang(204)),$n,array("table"=>$a),h($a));echo'
    70117037<form action="" method="post">
    70127038<p>',lang(183),': <input name="name" value="',h($I["name"]),'" data-maxlength="64" autocapitalize="off">
    70137039',(support("materializedview")?" ".checkbox("materialized",1,$I["materialized"],lang(129)):""),'<p>';textarea("select",$I["select"]);echo'<p>
    70147040<input type="submit" value="',lang(14),'">
    7015 ';if($a!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$a));}echo'<input type="hidden" name="token" value="',$ri,'">
     7041';if($a!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$a));}echo'<input type="hidden" name="token" value="',$ti,'">
    70167042</form>
    7017 ';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$Wd=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$Ih=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$I=$_POST;if($_POST&&!$n){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),lang(205));elseif(in_array($I["INTERVAL_FIELD"],$Wd)&&isset($Ih[$I["STATUS"]])){$ch="\nON SCHEDULE ".($I["INTERVAL_VALUE"]?"EVERY ".q($I["INTERVAL_VALUE"])." $I[INTERVAL_FIELD]".($I["STARTS"]?" STARTS ".q($I["STARTS"]):"").($I["ENDS"]?" ENDS ".q($I["ENDS"]):""):"AT ".q($I["STARTS"]))." ON COMPLETION".($I["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?lang(206):lang(207)),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$ch.($aa!=$I["EVENT_NAME"]?"\nRENAME TO ".idf_escape($I["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($I["EVENT_NAME"]).$ch)."\n".$Ih[$I["STATUS"]]." COMMENT ".q($I["EVENT_COMMENT"]).rtrim(" DO\n$I[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?lang(208).": ".h($aa):lang(209)),$n);if(!$I&&$aa!=""){$J=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$I=reset($J);}echo'
     7043';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$Yd=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$Kh=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$I=$_POST;if($_POST&&!$n){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),lang(205));elseif(in_array($I["INTERVAL_FIELD"],$Yd)&&isset($Kh[$I["STATUS"]])){$eh="\nON SCHEDULE ".($I["INTERVAL_VALUE"]?"EVERY ".q($I["INTERVAL_VALUE"])." $I[INTERVAL_FIELD]".($I["STARTS"]?" STARTS ".q($I["STARTS"]):"").($I["ENDS"]?" ENDS ".q($I["ENDS"]):""):"AT ".q($I["STARTS"]))." ON COMPLETION".($I["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?lang(206):lang(207)),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$eh.($aa!=$I["EVENT_NAME"]?"\nRENAME TO ".idf_escape($I["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($I["EVENT_NAME"]).$eh)."\n".$Kh[$I["STATUS"]]." COMMENT ".q($I["EVENT_COMMENT"]).rtrim(" DO\n$I[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?lang(208).": ".h($aa):lang(209)),$n);if(!$I&&$aa!=""){$J=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$I=reset($J);}echo'
    70187044<form action="" method="post">
    70197045<table cellspacing="0" class="layout">
     
    70217047<tr><th title="datetime">',lang(210),'<td><input name="STARTS" value="',h("$I[EXECUTE_AT]$I[STARTS]"),'">
    70227048<tr><th title="datetime">',lang(211),'<td><input name="ENDS" value="',h($I["ENDS"]),'">
    7023 <tr><th>',lang(212),'<td><input type="number" name="INTERVAL_VALUE" value="',h($I["INTERVAL_VALUE"]),'" class="size"> ',html_select("INTERVAL_FIELD",$Wd,$I["INTERVAL_FIELD"]),'<tr><th>',lang(118),'<td>',html_select("STATUS",$Ih,$I["STATUS"]),'<tr><th>',lang(51),'<td><input name="EVENT_COMMENT" value="',h($I["EVENT_COMMENT"]),'" data-maxlength="64">
     7049<tr><th>',lang(212),'<td><input type="number" name="INTERVAL_VALUE" value="',h($I["INTERVAL_VALUE"]),'" class="size"> ',html_select("INTERVAL_FIELD",$Yd,$I["INTERVAL_FIELD"]),'<tr><th>',lang(118),'<td>',html_select("STATUS",$Kh,$I["STATUS"]),'<tr><th>',lang(51),'<td><input name="EVENT_COMMENT" value="',h($I["EVENT_COMMENT"]),'" data-maxlength="64">
    70247050<tr><th><td>',checkbox("ON_COMPLETION","PRESERVE",$I["ON_COMPLETION"]=="PRESERVE",lang(213)),'</table>
    70257051<p>';textarea("EVENT_DEFINITION",$I["EVENT_DEFINITION"]);echo'<p>
    70267052<input type="submit" value="',lang(14),'">
    7027 ';if($aa!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$aa));}echo'<input type="hidden" name="token" value="',$ri,'">
     7053';if($aa!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$aa));}echo'<input type="hidden" name="token" value="',$ti,'">
    70287054</form>
    7029 ';}elseif(isset($_GET["procedure"])){$da=($_GET["name"]?$_GET["name"]:$_GET["procedure"]);$Xg=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$I=$_POST;$I["fields"]=(array)$I["fields"];if($_POST&&!process_fields($I["fields"])&&!$n){$Gf=routine($_GET["procedure"],$Xg);$ci="$I[name]_adminer_".uniqid();drop_create("DROP $Xg ".routine_id($da,$Gf),create_routine($Xg,$I),"DROP $Xg ".routine_id($I["name"],$I),create_routine($Xg,array("name"=>$ci)+$I),"DROP $Xg ".routine_id($ci,$I),substr(ME,0,-1),lang(214),lang(215),lang(216),$da,$I["name"]);}page_header(($da!=""?(isset($_GET["function"])?lang(217):lang(218)).": ".h($da):(isset($_GET["function"])?lang(219):lang(220))),$n);if(!$_POST&&$da!=""){$I=routine($_GET["procedure"],$Xg);$I["name"]=$da;}$qb=get_vals("SHOW CHARACTER SET");sort($qb);$Yg=routine_languages();echo'
     7055';}elseif(isset($_GET["procedure"])){$da=($_GET["name"]?$_GET["name"]:$_GET["procedure"]);$Zg=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$I=$_POST;$I["fields"]=(array)$I["fields"];if($_POST&&!process_fields($I["fields"])&&!$n){$If=routine($_GET["procedure"],$Zg);$ei="$I[name]_adminer_".uniqid();drop_create("DROP $Zg ".routine_id($da,$If),create_routine($Zg,$I),"DROP $Zg ".routine_id($I["name"],$I),create_routine($Zg,array("name"=>$ei)+$I),"DROP $Zg ".routine_id($ei,$I),substr(ME,0,-1),lang(214),lang(215),lang(216),$da,$I["name"]);}page_header(($da!=""?(isset($_GET["function"])?lang(217):lang(218)).": ".h($da):(isset($_GET["function"])?lang(219):lang(220))),$n);if(!$_POST&&$da!=""){$I=routine($_GET["procedure"],$Zg);$I["name"]=$da;}$qb=get_vals("SHOW CHARACTER SET");sort($qb);$ah=routine_languages();echo'
    70307056<form action="" method="post" id="form">
    70317057<p>',lang(183),': <input name="name" value="',h($I["name"]),'" data-maxlength="64" autocapitalize="off">
    7032 ',($Yg?lang(19).": ".html_select("language",$Yg,$I["language"])."\n":""),'<input type="submit" value="',lang(14),'">
     7058',($ah?lang(19).": ".html_select("language",$ah,$I["language"])."\n":""),'<input type="submit" value="',lang(14),'">
    70337059<div class="scrollable">
    70347060<table cellspacing="0" class="nowrap">
    7035 ';edit_fields($I["fields"],$qb,$Xg);if(isset($_GET["function"])){echo"<tr><td>".lang(221);edit_type("returns",$I["returns"],$qb,array(),($x=="pgsql"?array("void","trigger"):array()));}echo'</table>
    7036 </div>
     7061';edit_fields($I["fields"],$qb,$Zg);if(isset($_GET["function"])){echo"<tr><td>".lang(221);edit_type("returns",$I["returns"],$qb,array(),($x=="pgsql"?array("void","trigger"):array()));}echo'</table>
     7062',script("editFields();"),'</div>
    70377063<p>';textarea("definition",$I["definition"]);echo'<p>
    70387064<input type="submit" value="',lang(14),'">
    7039 ';if($da!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$da));}echo'<input type="hidden" name="token" value="',$ri,'">
     7065';if($da!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$da));}echo'<input type="hidden" name="token" value="',$ti,'">
    70407066</form>
    70417067';}elseif(isset($_GET["sequence"])){$fa=$_GET["sequence"];$I=$_POST;if($_POST&&!$n){$_=substr(ME,0,-1);$B=trim($I["name"]);if($_POST["drop"])query_redirect("DROP SEQUENCE ".idf_escape($fa),$_,lang(222));elseif($fa=="")query_redirect("CREATE SEQUENCE ".idf_escape($B),$_,lang(223));elseif($fa!=$B)query_redirect("ALTER SEQUENCE ".idf_escape($fa)." RENAME TO ".idf_escape($B),$_,lang(224));else
     
    70447070<p><input name="name" value="',h($I["name"]),'" autocapitalize="off">
    70457071<input type="submit" value="',lang(14),'">
    7046 ';if($fa!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$fa))."\n";echo'<input type="hidden" name="token" value="',$ri,'">
     7072';if($fa!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$fa))."\n";echo'<input type="hidden" name="token" value="',$ti,'">
    70477073</form>
    70487074';}elseif(isset($_GET["type"])){$ga=$_GET["type"];$I=$_POST;if($_POST&&!$n){$_=substr(ME,0,-1);if($_POST["drop"])query_redirect("DROP TYPE ".idf_escape($ga),$_,lang(227));else
     
    70507076<form action="" method="post">
    70517077<p>
    7052 ';if($ga!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$ga))."\n";else{echo"<input name='name' value='".h($I['name'])."' autocapitalize='off'>\n";textarea("as",$I["as"]);echo"<p><input type='submit' value='".lang(14)."'>\n";}echo'<input type="hidden" name="token" value="',$ri,'">
     7078';if($ga!="")echo"<input type='submit' name='drop' value='".lang(127)."'>".confirm(lang(175,$ga))."\n";else{echo"<input name='name' value='".h($I['name'])."' autocapitalize='off'>\n";textarea("as",$I["as"]);echo"<p><input type='submit' value='".lang(14)."'>\n";}echo'<input type="hidden" name="token" value="',$ti,'">
    70537079</form>
    7054 ';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$B=$_GET["name"];$Bi=trigger_options();$I=(array)trigger($B)+array("Trigger"=>$a."_bi");if($_POST){if(!$n&&in_array($_POST["Timing"],$Bi["Timing"])&&in_array($_POST["Event"],$Bi["Event"])&&in_array($_POST["Type"],$Bi["Type"])){$sf=" ON ".table($a);$hc="DROP TRIGGER ".idf_escape($B).($x=="pgsql"?$sf:"");$_e=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($hc,$_e,lang(231));else{if($B!="")queries($hc);queries_redirect($_e,($B!=""?lang(232):lang(233)),queries(create_trigger($sf,$_POST)));if($B!="")queries(create_trigger($sf,$I+array("Type"=>reset($Bi["Type"]))));}}$I=$_POST;}page_header(($B!=""?lang(234).": ".h($B):lang(235)),$n,array("table"=>$a));echo'
     7080';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$B=$_GET["name"];$Di=trigger_options();$I=(array)trigger($B)+array("Trigger"=>$a."_bi");if($_POST){if(!$n&&in_array($_POST["Timing"],$Di["Timing"])&&in_array($_POST["Event"],$Di["Event"])&&in_array($_POST["Type"],$Di["Type"])){$uf=" ON ".table($a);$jc="DROP TRIGGER ".idf_escape($B).($x=="pgsql"?$uf:"");$Be=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($jc,$Be,lang(231));else{if($B!="")queries($jc);queries_redirect($Be,($B!=""?lang(232):lang(233)),queries(create_trigger($uf,$_POST)));if($B!="")queries(create_trigger($uf,$I+array("Type"=>reset($Di["Type"]))));}}$I=$_POST;}page_header(($B!=""?lang(234).": ".h($B):lang(235)),$n,array("table"=>$a));echo'
    70557081<form action="" method="post" id="form">
    70567082<table cellspacing="0" class="layout">
    7057 <tr><th>',lang(236),'<td>',html_select("Timing",$Bi["Timing"],$I["Timing"],"triggerChange(/^".preg_quote($a,"/")."_[ba][iud]$/, '".js_escape($a)."', this.form);"),'<tr><th>',lang(237),'<td>',html_select("Event",$Bi["Event"],$I["Event"],"this.form['Timing'].onchange();"),(in_array("UPDATE OF",$Bi["Event"])?" <input name='Of' value='".h($I["Of"])."' class='hidden'>":""),'<tr><th>',lang(50),'<td>',html_select("Type",$Bi["Type"],$I["Type"]),'</table>
     7083<tr><th>',lang(236),'<td>',html_select("Timing",$Di["Timing"],$I["Timing"],"triggerChange(/^".preg_quote($a,"/")."_[ba][iud]$/, '".js_escape($a)."', this.form);"),'<tr><th>',lang(237),'<td>',html_select("Event",$Di["Event"],$I["Event"],"this.form['Timing'].onchange();"),(in_array("UPDATE OF",$Di["Event"])?" <input name='Of' value='".h($I["Of"])."' class='hidden'>":""),'<tr><th>',lang(50),'<td>',html_select("Type",$Di["Type"],$I["Type"]),'</table>
    70587084<p>',lang(183),': <input name="Trigger" value="',h($I["Trigger"]),'" data-maxlength="64" autocapitalize="off">
    70597085',script("qs('#form')['Timing'].onchange();"),'<p>';textarea("Statement",$I["Statement"]);echo'<p>
    70607086<input type="submit" value="',lang(14),'">
    7061 ';if($B!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$B));}echo'<input type="hidden" name="token" value="',$ri,'">
     7087';if($B!=""){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,$B));}echo'<input type="hidden" name="token" value="',$ti,'">
    70627088</form>
    7063 ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$sg=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$Cb)$sg[$Cb][$I["Privilege"]]=$I["Comment"];}$sg["Server Admin"]+=$sg["File access on server"];$sg["Databases"]["Create routine"]=$sg["Procedures"]["Create routine"];unset($sg["Procedures"]["Create routine"]);$sg["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$sg["Columns"][$X]=$sg["Tables"][$X];unset($sg["Server Admin"]["Usage"]);foreach($sg["Tables"]as$y=>$X)unset($sg["Databases"][$y]);$bf=array();if($_POST){foreach($_POST["objects"]as$y=>$X)$bf[$X]=(array)$bf[$X]+(array)$_POST["grants"][$y];}$od=array();$qf="";if(isset($_GET["host"])&&($G=$h->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($I=$G->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$I[0],$A)&&preg_match_all('~ *([^(,]*[^ ,(])( *\([^)]+\))?~',$A[1],$Ge,PREG_SET_ORDER)){foreach($Ge
    7064 as$X){if($X[1]!="USAGE")$od["$A[2]$X[2]"][$X[1]]=true;if(preg_match('~ WITH GRANT OPTION~',$I[0]))$od["$A[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$I[0],$A))$qf=$A[1];}}if($_POST&&!$n){$rf=(isset($_GET["host"])?q($ha)."@".q($_GET["host"]):"''");if($_POST["drop"])query_redirect("DROP USER $rf",ME."privileges=",lang(238));else{$df=q($_POST["user"])."@".q($_POST["host"]);$ag=$_POST["pass"];if($ag!=''&&!$_POST["hashed"]&&!min_version(8)){$ag=$h->result("SELECT PASSWORD(".q($ag).")");$n=!$ag;}$Ib=false;if(!$n){if($rf!=$df){$Ib=queries((min_version(5)?"CREATE USER":"GRANT USAGE ON *.* TO")." $df IDENTIFIED BY ".(min_version(8)?"":"PASSWORD ").q($ag));$n=!$Ib;}elseif($ag!=$qf)queries("SET PASSWORD FOR $df = ".q($ag));}if(!$n){$Ug=array();foreach($bf
    7065 as$lf=>$nd){if(isset($_GET["grant"]))$nd=array_filter($nd);$nd=array_keys($nd);if(isset($_GET["grant"]))$Ug=array_diff(array_keys(array_filter($bf[$lf],'strlen')),$nd);elseif($rf==$df){$of=array_keys((array)$od[$lf]);$Ug=array_diff($of,$nd);$nd=array_diff($nd,$of);unset($od[$lf]);}if(preg_match('~^(.+)\s*(\(.*\))?$~U',$lf,$A)&&(!grant("REVOKE",$Ug,$A[2]," ON $A[1] FROM $df")||!grant("GRANT",$nd,$A[2]," ON $A[1] TO $df"))){$n=true;break;}}}if(!$n&&isset($_GET["host"])){if($rf!=$df)queries("DROP USER $rf");elseif(!isset($_GET["grant"])){foreach($od
    7066 as$lf=>$Ug){if(preg_match('~^(.+)(\(.*\))?$~U',$lf,$A))grant("REVOKE",array_keys($Ug),$A[2]," ON $A[1] FROM $df");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?lang(239):lang(240)),!$n);if($Ib)$h->query("DROP USER $df");}}page_header((isset($_GET["host"])?lang(36).": ".h("$ha@$_GET[host]"):lang(146)),$n,array("privileges"=>array('',lang(72))));if($_POST){$I=$_POST;$od=$bf;}else{$I=$_GET+array("host"=>$h->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$I["pass"]=$qf;if($qf!="")$I["hashed"]=true;$od[(DB==""||$od?"":idf_escape(addcslashes(DB,"%_\\"))).".*"]=array();}echo'<form action="" method="post">
     7089';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$ug=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$Db)$ug[$Db][$I["Privilege"]]=$I["Comment"];}$ug["Server Admin"]+=$ug["File access on server"];$ug["Databases"]["Create routine"]=$ug["Procedures"]["Create routine"];unset($ug["Procedures"]["Create routine"]);$ug["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$ug["Columns"][$X]=$ug["Tables"][$X];unset($ug["Server Admin"]["Usage"]);foreach($ug["Tables"]as$y=>$X)unset($ug["Databases"][$y]);$df=array();if($_POST){foreach($_POST["objects"]as$y=>$X)$df[$X]=(array)$df[$X]+(array)$_POST["grants"][$y];}$qd=array();$sf="";if(isset($_GET["host"])&&($G=$h->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($I=$G->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$I[0],$A)&&preg_match_all('~ *([^(,]*[^ ,(])( *\([^)]+\))?~',$A[1],$Ie,PREG_SET_ORDER)){foreach($Ie
     7090as$X){if($X[1]!="USAGE")$qd["$A[2]$X[2]"][$X[1]]=true;if(preg_match('~ WITH GRANT OPTION~',$I[0]))$qd["$A[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$I[0],$A))$sf=$A[1];}}if($_POST&&!$n){$tf=(isset($_GET["host"])?q($ha)."@".q($_GET["host"]):"''");if($_POST["drop"])query_redirect("DROP USER $tf",ME."privileges=",lang(238));else{$ff=q($_POST["user"])."@".q($_POST["host"]);$cg=$_POST["pass"];if($cg!=''&&!$_POST["hashed"]&&!min_version(8)){$cg=$h->result("SELECT PASSWORD(".q($cg).")");$n=!$cg;}$Jb=false;if(!$n){if($tf!=$ff){$Jb=queries((min_version(5)?"CREATE USER":"GRANT USAGE ON *.* TO")." $ff IDENTIFIED BY ".(min_version(8)?"":"PASSWORD ").q($cg));$n=!$Jb;}elseif($cg!=$sf)queries("SET PASSWORD FOR $ff = ".q($cg));}if(!$n){$Wg=array();foreach($df
     7091as$nf=>$pd){if(isset($_GET["grant"]))$pd=array_filter($pd);$pd=array_keys($pd);if(isset($_GET["grant"]))$Wg=array_diff(array_keys(array_filter($df[$nf],'strlen')),$pd);elseif($tf==$ff){$qf=array_keys((array)$qd[$nf]);$Wg=array_diff($qf,$pd);$pd=array_diff($pd,$qf);unset($qd[$nf]);}if(preg_match('~^(.+)\s*(\(.*\))?$~U',$nf,$A)&&(!grant("REVOKE",$Wg,$A[2]," ON $A[1] FROM $ff")||!grant("GRANT",$pd,$A[2]," ON $A[1] TO $ff"))){$n=true;break;}}}if(!$n&&isset($_GET["host"])){if($tf!=$ff)queries("DROP USER $tf");elseif(!isset($_GET["grant"])){foreach($qd
     7092as$nf=>$Wg){if(preg_match('~^(.+)(\(.*\))?$~U',$nf,$A))grant("REVOKE",array_keys($Wg),$A[2]," ON $A[1] FROM $ff");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?lang(239):lang(240)),!$n);if($Jb)$h->query("DROP USER $ff");}}page_header((isset($_GET["host"])?lang(36).": ".h("$ha@$_GET[host]"):lang(146)),$n,array("privileges"=>array('',lang(72))));if($_POST){$I=$_POST;$qd=$df;}else{$I=$_GET+array("host"=>$h->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$I["pass"]=$sf;if($sf!="")$I["hashed"]=true;$qd[(DB==""||$qd?"":idf_escape(addcslashes(DB,"%_\\"))).".*"]=array();}echo'<form action="" method="post">
    70677093<table cellspacing="0" class="layout">
    70687094<tr><th>',lang(35),'<td><input name="host" data-maxlength="60" value="',h($I["host"]),'" autocapitalize="off">
     
    70727098script("typePassword(qs('#pass'));");echo(min_version(8)?"":checkbox("hashed",1,$I["hashed"],lang(241),"typePassword(this.form['pass'], this.checked);")),'</table>
    70737099
    7074 ';echo"<table cellspacing='0'>\n","<thead><tr><th colspan='2'>".lang(72).doc_link(array('sql'=>"grant.html#priv_level"));$s=0;foreach($od
    7075 as$lf=>$nd){echo'<th>'.($lf!="*.*"?"<input name='objects[$s]' value='".h($lf)."' size='10' autocapitalize='off'>":"<input type='hidden' name='objects[$s]' value='*.*' size='10'>*.*");$s++;}echo"</thead>\n";foreach(array(""=>"","Server Admin"=>lang(35),"Databases"=>lang(38),"Tables"=>lang(131),"Columns"=>lang(49),"Procedures"=>lang(242),)as$Cb=>$Zb){foreach((array)$sg[$Cb]as$rg=>$vb){echo"<tr".odd()."><td".($Zb?">$Zb<td":" colspan='2'").' lang="en" title="'.h($vb).'">'.h($rg);$s=0;foreach($od
    7076 as$lf=>$nd){$B="'grants[$s][".h(strtoupper($rg))."]'";$Y=$nd[strtoupper($rg)];if($Cb=="Server Admin"&&$lf!=(isset($od["*.*"])?"*.*":".*"))echo"<td>";elseif(isset($_GET["grant"]))echo"<td><select name=$B><option><option value='1'".($Y?" selected":"").">".lang(243)."<option value='0'".($Y=="0"?" selected":"").">".lang(244)."</select>";else{echo"<td align='center'><label class='block'>","<input type='checkbox' name=$B value='1'".($Y?" checked":"").($rg=="All privileges"?" id='grants-$s-all'>":">".($rg=="Grant option"?"":script("qsl('input').onclick = function () { if (this.checked) formUncheck('grants-$s-all'); };"))),"</label>";}$s++;}}}echo"</table>\n",'<p>
     7100';echo"<table cellspacing='0'>\n","<thead><tr><th colspan='2'>".lang(72).doc_link(array('sql'=>"grant.html#priv_level"));$s=0;foreach($qd
     7101as$nf=>$pd){echo'<th>'.($nf!="*.*"?"<input name='objects[$s]' value='".h($nf)."' size='10' autocapitalize='off'>":"<input type='hidden' name='objects[$s]' value='*.*' size='10'>*.*");$s++;}echo"</thead>\n";foreach(array(""=>"","Server Admin"=>lang(35),"Databases"=>lang(38),"Tables"=>lang(131),"Columns"=>lang(49),"Procedures"=>lang(242),)as$Db=>$bc){foreach((array)$ug[$Db]as$tg=>$vb){echo"<tr".odd()."><td".($bc?">$bc<td":" colspan='2'").' lang="en" title="'.h($vb).'">'.h($tg);$s=0;foreach($qd
     7102as$nf=>$pd){$B="'grants[$s][".h(strtoupper($tg))."]'";$Y=$pd[strtoupper($tg)];if($Db=="Server Admin"&&$nf!=(isset($qd["*.*"])?"*.*":".*"))echo"<td>";elseif(isset($_GET["grant"]))echo"<td><select name=$B><option><option value='1'".($Y?" selected":"").">".lang(243)."<option value='0'".($Y=="0"?" selected":"").">".lang(244)."</select>";else{echo"<td align='center'><label class='block'>","<input type='checkbox' name=$B value='1'".($Y?" checked":"").($tg=="All privileges"?" id='grants-$s-all'>":">".($tg=="Grant option"?"":script("qsl('input').onclick = function () { if (this.checked) formUncheck('grants-$s-all'); };"))),"</label>";}$s++;}}}echo"</table>\n",'<p>
    70777103<input type="submit" value="',lang(14),'">
    7078 ';if(isset($_GET["host"])){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,"$ha@$_GET[host]"));}echo'<input type="hidden" name="token" value="',$ri,'">
     7104';if(isset($_GET["host"])){echo'<input type="submit" name="drop" value="',lang(127),'">',confirm(lang(175,"$ha@$_GET[host]"));}echo'<input type="hidden" name="token" value="',$ti,'">
    70797105</form>
    7080 ';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$n){$le=0;foreach((array)$_POST["kill"]as$X){if(kill_process($X))$le++;}queries_redirect(ME."processlist=",lang(245,$le),$le||!$_POST["kill"]);}page_header(lang(116),$n);echo'
     7106';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$n){$ne=0;foreach((array)$_POST["kill"]as$X){if(kill_process($X))$ne++;}queries_redirect(ME."processlist=",lang(245,$ne),$ne||!$_POST["kill"]);}page_header(lang(116),$n);echo'
    70817107<form action="" method="post">
    70827108<div class="scrollable">
     
    70877113</div>
    70887114<p>
    7089 ';if(support("kill")){echo($s+1)."/".lang(247,max_connections()),"<p><input type='submit' value='".lang(248)."'>\n";}echo'<input type="hidden" name="token" value="',$ri,'">
     7115';if(support("kill")){echo($s+1)."/".lang(247,max_connections()),"<p><input type='submit' value='".lang(248)."'>\n";}echo'<input type="hidden" name="token" value="',$ti,'">
    70907116</form>
    7091 ',script("tableCheck();");}elseif(isset($_GET["select"])){$a=$_GET["select"];$R=table_status1($a);$w=indexes($a);$p=fields($a);$gd=column_foreign_keys($a);$nf=$R["Oid"];parse_str($_COOKIE["adminer_import"],$za);$Vg=array();$f=array();$gi=null;foreach($p
    7092 as$y=>$o){$B=$b->fieldName($o);if(isset($o["privileges"]["select"])&&$B!=""){$f[$y]=html_entity_decode(strip_tags($B),ENT_QUOTES);if(is_shortable($o))$gi=$b->selectLengthProcess();}$Vg+=$o["privileges"];}list($K,$pd)=$b->selectColumnsProcess($f,$w);$ae=count($pd)<count($K);$Z=$b->selectSearchProcess($p,$w);$Cf=$b->selectOrderProcess($p,$w);$z=$b->selectLimitProcess();if($_GET["val"]&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$Ii=>$I){$Ha=convert_field($p[key($I)]);$K=array($Ha?$Ha:idf_escape(key($I)));$Z[]=where_check($Ii,$p);$H=$m->select($a,$K,$Z,$K);if($H)echo
    7093 reset($H->fetch_row());}exit;}$ng=$Ki=null;foreach($w
    7094 as$v){if($v["type"]=="PRIMARY"){$ng=array_flip($v["columns"]);$Ki=($K?$ng:array());foreach($Ki
    7095 as$y=>$X){if(in_array(idf_escape($y),$K))unset($Ki[$y]);}break;}}if($nf&&!$ng){$ng=$Ki=array($nf=>0);$w[]=array("type"=>"PRIMARY","columns"=>array($nf));}if($_POST&&!$n){$mj=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$hb=array();foreach($_POST["check"]as$eb)$hb[]=where_check($eb,$p);$mj[]="((".implode(") OR (",$hb)."))";}$mj=($mj?"\nWHERE ".implode(" AND ",$mj):"");if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");$ld=($K?implode(", ",$K):"*").convert_fields($f,$p,$K)."\nFROM ".table($a);$rd=($pd&&$ae?"\nGROUP BY ".implode(", ",$pd):"").($Cf?"\nORDER BY ".implode(", ",$Cf):"");if(!is_array($_POST["check"])||$ng)$F="SELECT $ld$mj$rd";else{$Gi=array();foreach($_POST["check"]as$X)$Gi[]="(SELECT".limit($ld,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p).$rd,1).")";$F=implode(" UNION ALL ",$Gi);}$b->dumpData($a,"table",$F);exit;}if(!$b->selectEmailProcess($Z,$gd)){if($_POST["save"]||$_POST["delete"]){$G=true;$_a=0;$N=array();if(!$_POST["delete"]){foreach($f
    7096 as$B=>$X){$X=process_input($p[$B]);if($X!==null&&($_POST["clone"]||$X!==false))$N[idf_escape($B)]=($X!==false?$X:idf_escape($B));}}if($_POST["delete"]||$N){if($_POST["clone"])$F="INTO ".table($a)." (".implode(", ",array_keys($N)).")\nSELECT ".implode(", ",$N)."\nFROM ".table($a);if($_POST["all"]||($ng&&is_array($_POST["check"]))||$ae){$G=($_POST["delete"]?$m->delete($a,$mj):($_POST["clone"]?queries("INSERT $F$mj"):$m->update($a,$N,$mj)));$_a=$h->affected_rows;}else{foreach((array)$_POST["check"]as$X){$ij="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p);$G=($_POST["delete"]?$m->delete($a,$ij,1):($_POST["clone"]?queries("INSERT".limit1($a,$F,$ij)):$m->update($a,$N,$ij,1)));if(!$G)break;$_a+=$h->affected_rows;}}}$Oe=lang(249,$_a);if($_POST["clone"]&&$G&&$_a==1){$re=last_id();if($re)$Oe=lang(168," $re");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$Oe,$G);if(!$_POST["delete"]){edit_form($a,$p,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$n=lang(250);else{$G=true;$_a=0;foreach($_POST["val"]as$Ii=>$I){$N=array();foreach($I
    7097 as$y=>$X){$y=bracket_escape($y,1);$N[idf_escape($y)]=(preg_match('~char|text~',$p[$y]["type"])||$X!=""?$b->processInput($p[$y],$X):"NULL");}$G=$m->update($a,$N," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($Ii,$p),!$ae&&!$ng," ");if(!$G)break;$_a+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(249,$_a),$G);}}elseif(!is_string($Vc=get_file("csv_file",true)))$n=upload_error($Vc);elseif(!preg_match('~~u',$Vc))$n=lang(251);else{cookie("adminer_import","output=".urlencode($za["output"])."&format=".urlencode($_POST["separator"]));$G=true;$sb=array_keys($p);preg_match_all('~(?>"[^"]*"|[^"\r\n]+)+~',$Vc,$Ge);$_a=count($Ge[0]);$m->begin();$L=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$J=array();foreach($Ge[0]as$y=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$L]*)$L~",$X.$L,$He);if(!$y&&!array_diff($He[1],$sb)){$sb=$He[1];$_a--;}else{$N=array();foreach($He[1]as$s=>$ob)$N[idf_escape($sb[$s])]=($ob==""&&$p[$sb[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$ob))));$J[]=$N;}}$G=(!$J||$m->insertUpdate($a,$J,$ng));if($G)$G=$m->commit();queries_redirect(remove_from_uri("page"),lang(252,$_a),$G);$m->rollback();}}}$Sh=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
    7098 page_header(lang(54).": $Sh",$n);$N=null;if(isset($Vg["insert"])||!support("table")){$N="";foreach((array)$_GET["where"]as$X){if($gd[$X["col"]]&&count($gd[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$N.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$N);if(!$f&&support("table"))echo"<p class='error'>".lang(253).($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($K,$f);$b->selectSearchPrint($Z,$f,$w);$b->selectOrderPrint($Cf,$f,$w);$b->selectLimitPrint($z);$b->selectLengthPrint($gi);$b->selectActionPrint($w);echo"</form>\n";$D=$_GET["page"];if($D=="last"){$jd=$h->result(count_rows($a,$Z,$ae,$pd));$D=floor(max(0,$jd-1)/$z);}$hh=$K;$qd=$pd;if(!$hh){$hh[]="*";$Db=convert_fields($f,$p,$K);if($Db)$hh[]=substr($Db,2);}foreach($K
    7099 as$y=>$X){$o=$p[idf_unescape($X)];if($o&&($Ha=convert_field($o)))$hh[$y]="$Ha AS $X";}if(!$ae&&$Ki){foreach($Ki
    7100 as$y=>$X){$hh[]=idf_escape($y);if($qd)$qd[]=idf_escape($y);}}$G=$m->select($a,$hh,$Z,$qd,$Cf,$z,$D,true);if(!$G)echo"<p class='error'>".error()."\n";else{if($x=="mssql"&&$D)$G->seek($z*$D);$uc=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$J=array();while($I=$G->fetch_assoc()){if($D&&$x=="oracle")unset($I["RNUM"]);$J[]=$I;}if($_GET["page"]!="last"&&$z!=""&&$pd&&$ae&&$x=="sql")$jd=$h->result(" SELECT FOUND_ROWS()");if(!$J)echo"<p class='message'>".lang(12)."\n";else{$Ra=$b->backwardKeys($a,$Sh);echo"<div class='scrollable'>","<table id='table' cellspacing='0' class='nowrap checkable'>",script("mixin(qs('#table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown});"),"<thead><tr>".(!$pd&&$K?"":"<td><input type='checkbox' id='all-page' class='jsonly'>".script("qs('#all-page').onclick = partial(formCheck, /check/);","")." <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(254)."</a>");$af=array();$md=array();reset($K);$Bg=1;foreach($J[0]as$y=>$X){if(!isset($Ki[$y])){$X=$_GET["columns"][key($K)];$o=$p[$K?($X?$X["col"]:current($K)):$y];$B=($o?$b->fieldName($o,$Bg):($X["fun"]?"*":$y));if($B!=""){$Bg++;$af[$y]=$B;$e=idf_escape($y);$Dd=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);$Zb="&desc%5B0%5D=1";echo"<th>".script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});",""),'<a href="'.h($Dd.($Cf[0]==$e||$Cf[0]==$y||(!$Cf&&$ae&&$pd[0]==$e)?$Zb:'')).'">';echo
    7101 apply_sql_function($X["fun"],$B)."</a>";echo"<span class='column hidden'>","<a href='".h($Dd.$Zb)."' title='".lang(60)."' class='text'> ↓</a>";if(!$X["fun"]){echo'<a href="#fieldset-search" title="'.lang(57).'" class="text jsonly"> =</a>',script("qsl('a').onclick = partial(selectSearch, '".js_escape($y)."');");}echo"</span>";}$md[$y]=$X["fun"];next($K);}}$xe=array();if($_GET["modify"]){foreach($J
     7117',script("tableCheck();");}elseif(isset($_GET["select"])){$a=$_GET["select"];$R=table_status1($a);$w=indexes($a);$p=fields($a);$id=column_foreign_keys($a);$pf=$R["Oid"];parse_str($_COOKIE["adminer_import"],$za);$Xg=array();$f=array();$ii=null;foreach($p
     7118as$y=>$o){$B=$b->fieldName($o);if(isset($o["privileges"]["select"])&&$B!=""){$f[$y]=html_entity_decode(strip_tags($B),ENT_QUOTES);if(is_shortable($o))$ii=$b->selectLengthProcess();}$Xg+=$o["privileges"];}list($K,$rd)=$b->selectColumnsProcess($f,$w);$ce=count($rd)<count($K);$Z=$b->selectSearchProcess($p,$w);$Ef=$b->selectOrderProcess($p,$w);$z=$b->selectLimitProcess();if($_GET["val"]&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$Ki=>$I){$Ha=convert_field($p[key($I)]);$K=array($Ha?$Ha:idf_escape(key($I)));$Z[]=where_check($Ki,$p);$H=$m->select($a,$K,$Z,$K);if($H)echo
     7119reset($H->fetch_row());}exit;}$pg=$Mi=null;foreach($w
     7120as$v){if($v["type"]=="PRIMARY"){$pg=array_flip($v["columns"]);$Mi=($K?$pg:array());foreach($Mi
     7121as$y=>$X){if(in_array(idf_escape($y),$K))unset($Mi[$y]);}break;}}if($pf&&!$pg){$pg=$Mi=array($pf=>0);$w[]=array("type"=>"PRIMARY","columns"=>array($pf));}if($_POST&&!$n){$oj=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$hb=array();foreach($_POST["check"]as$eb)$hb[]=where_check($eb,$p);$oj[]="((".implode(") OR (",$hb)."))";}$oj=($oj?"\nWHERE ".implode(" AND ",$oj):"");if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");$nd=($K?implode(", ",$K):"*").convert_fields($f,$p,$K)."\nFROM ".table($a);$td=($rd&&$ce?"\nGROUP BY ".implode(", ",$rd):"").($Ef?"\nORDER BY ".implode(", ",$Ef):"");if(!is_array($_POST["check"])||$pg)$F="SELECT $nd$oj$td";else{$Ii=array();foreach($_POST["check"]as$X)$Ii[]="(SELECT".limit($nd,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p).$td,1).")";$F=implode(" UNION ALL ",$Ii);}$b->dumpData($a,"table",$F);exit;}if(!$b->selectEmailProcess($Z,$id)){if($_POST["save"]||$_POST["delete"]){$G=true;$_a=0;$N=array();if(!$_POST["delete"]){foreach($f
     7122as$B=>$X){$X=process_input($p[$B]);if($X!==null&&($_POST["clone"]||$X!==false))$N[idf_escape($B)]=($X!==false?$X:idf_escape($B));}}if($_POST["delete"]||$N){if($_POST["clone"])$F="INTO ".table($a)." (".implode(", ",array_keys($N)).")\nSELECT ".implode(", ",$N)."\nFROM ".table($a);if($_POST["all"]||($pg&&is_array($_POST["check"]))||$ce){$G=($_POST["delete"]?$m->delete($a,$oj):($_POST["clone"]?queries("INSERT $F$oj"):$m->update($a,$N,$oj)));$_a=$h->affected_rows;}else{foreach((array)$_POST["check"]as$X){$kj="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$p);$G=($_POST["delete"]?$m->delete($a,$kj,1):($_POST["clone"]?queries("INSERT".limit1($a,$F,$kj)):$m->update($a,$N,$kj,1)));if(!$G)break;$_a+=$h->affected_rows;}}}$Qe=lang(249,$_a);if($_POST["clone"]&&$G&&$_a==1){$te=last_id();if($te)$Qe=lang(168," $te");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$Qe,$G);if(!$_POST["delete"]){edit_form($a,$p,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$n=lang(250);else{$G=true;$_a=0;foreach($_POST["val"]as$Ki=>$I){$N=array();foreach($I
     7123as$y=>$X){$y=bracket_escape($y,1);$N[idf_escape($y)]=(preg_match('~char|text~',$p[$y]["type"])||$X!=""?$b->processInput($p[$y],$X):"NULL");}$G=$m->update($a,$N," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($Ki,$p),!$ce&&!$pg," ");if(!$G)break;$_a+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(249,$_a),$G);}}elseif(!is_string($Xc=get_file("csv_file",true)))$n=upload_error($Xc);elseif(!preg_match('~~u',$Xc))$n=lang(251);else{cookie("adminer_import","output=".urlencode($za["output"])."&format=".urlencode($_POST["separator"]));$G=true;$sb=array_keys($p);preg_match_all('~(?>"[^"]*"|[^"\r\n]+)+~',$Xc,$Ie);$_a=count($Ie[0]);$m->begin();$L=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$J=array();foreach($Ie[0]as$y=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$L]*)$L~",$X.$L,$Je);if(!$y&&!array_diff($Je[1],$sb)){$sb=$Je[1];$_a--;}else{$N=array();foreach($Je[1]as$s=>$ob)$N[idf_escape($sb[$s])]=($ob==""&&$p[$sb[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$ob))));$J[]=$N;}}$G=(!$J||$m->insertUpdate($a,$J,$pg));if($G)$G=$m->commit();queries_redirect(remove_from_uri("page"),lang(252,$_a),$G);$m->rollback();}}}$Uh=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
     7124page_header(lang(54).": $Uh",$n);$N=null;if(isset($Xg["insert"])||!support("table")){$N="";foreach((array)$_GET["where"]as$X){if($id[$X["col"]]&&count($id[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$N.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$N);if(!$f&&support("table"))echo"<p class='error'>".lang(253).($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($K,$f);$b->selectSearchPrint($Z,$f,$w);$b->selectOrderPrint($Ef,$f,$w);$b->selectLimitPrint($z);$b->selectLengthPrint($ii);$b->selectActionPrint($w);echo"</form>\n";$D=$_GET["page"];if($D=="last"){$ld=$h->result(count_rows($a,$Z,$ce,$rd));$D=floor(max(0,$ld-1)/$z);}$jh=$K;$sd=$rd;if(!$jh){$jh[]="*";$Eb=convert_fields($f,$p,$K);if($Eb)$jh[]=substr($Eb,2);}foreach($K
     7125as$y=>$X){$o=$p[idf_unescape($X)];if($o&&($Ha=convert_field($o)))$jh[$y]="$Ha AS $X";}if(!$ce&&$Mi){foreach($Mi
     7126as$y=>$X){$jh[]=idf_escape($y);if($sd)$sd[]=idf_escape($y);}}$G=$m->select($a,$jh,$Z,$sd,$Ef,$z,$D,true);if(!$G)echo"<p class='error'>".error()."\n";else{if($x=="mssql"&&$D)$G->seek($z*$D);$wc=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$J=array();while($I=$G->fetch_assoc()){if($D&&$x=="oracle")unset($I["RNUM"]);$J[]=$I;}if($_GET["page"]!="last"&&$z!=""&&$rd&&$ce&&$x=="sql")$ld=$h->result(" SELECT FOUND_ROWS()");if(!$J)echo"<p class='message'>".lang(12)."\n";else{$Ra=$b->backwardKeys($a,$Uh);echo"<div class='scrollable'>","<table id='table' cellspacing='0' class='nowrap checkable'>",script("mixin(qs('#table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown});"),"<thead><tr>".(!$rd&&$K?"":"<td><input type='checkbox' id='all-page' class='jsonly'>".script("qs('#all-page').onclick = partial(formCheck, /check/);","")." <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(254)."</a>");$cf=array();$od=array();reset($K);$Dg=1;foreach($J[0]as$y=>$X){if(!isset($Mi[$y])){$X=$_GET["columns"][key($K)];$o=$p[$K?($X?$X["col"]:current($K)):$y];$B=($o?$b->fieldName($o,$Dg):($X["fun"]?"*":$y));if($B!=""){$Dg++;$cf[$y]=$B;$e=idf_escape($y);$Fd=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);$bc="&desc%5B0%5D=1";echo"<th>".script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});",""),'<a href="'.h($Fd.($Ef[0]==$e||$Ef[0]==$y||(!$Ef&&$ce&&$rd[0]==$e)?$bc:'')).'">';echo
     7127apply_sql_function($X["fun"],$B)."</a>";echo"<span class='column hidden'>","<a href='".h($Fd.$bc)."' title='".lang(60)."' class='text'> ↓</a>";if(!$X["fun"]){echo'<a href="#fieldset-search" title="'.lang(57).'" class="text jsonly"> =</a>',script("qsl('a').onclick = partial(selectSearch, '".js_escape($y)."');");}echo"</span>";}$od[$y]=$X["fun"];next($K);}}$ze=array();if($_GET["modify"]){foreach($J
    71027128as$I){foreach($I
    7103 as$y=>$X)$xe[$y]=max($xe[$y],min(40,strlen(utf8_decode($X))));}}echo($Ra?"<th>".lang(255):"")."</thead>\n";if(is_ajax()){if($z%2==1&&$D%2==1)odd();ob_end_clean();}foreach($b->rowDescriptions($J,$gd)as$Ze=>$I){$Hi=unique_array($J[$Ze],$w);if(!$Hi){$Hi=array();foreach($J[$Ze]as$y=>$X){if(!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~',$y))$Hi[$y]=$X;}}$Ii="";foreach($Hi
    7104 as$y=>$X){if(($x=="sql"||$x=="pgsql")&&preg_match('~char|text|enum|set~',$p[$y]["type"])&&strlen($X)>64){$y=(strpos($y,'(')?$y:idf_escape($y));$y="MD5(".($x!='sql'||preg_match("~^utf8~",$p[$y]["collation"])?$y:"CONVERT($y USING ".charset($h).")").")";$X=md5($X);}$Ii.="&".($X!==null?urlencode("where[".bracket_escape($y)."]")."=".urlencode($X):"null%5B%5D=".urlencode($y));}echo"<tr".odd().">".(!$pd&&$K?"":"<td>".checkbox("check[]",substr($Ii,1),in_array(substr($Ii,1),(array)$_POST["check"])).($ae||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$Ii)."' class='edit'>".lang(256)."</a>"));foreach($I
    7105 as$y=>$X){if(isset($af[$y])){$o=$p[$y];$X=$m->value($X,$o);if($X!=""&&(!isset($uc[$y])||$uc[$y]!=""))$uc[$y]=(is_mail($X)?$af[$y]:"");$_="";if(preg_match('~blob|bytea|raw|file~',$o["type"])&&$X!="")$_=ME.'download='.urlencode($a).'&field='.urlencode($y).$Ii;if(!$_&&$X!==null){foreach((array)$gd[$y]as$q){if(count($gd[$y])==1||end($q["source"])==$y){$_="";foreach($q["source"]as$s=>$zh)$_.=where_link($s,$q["target"][$s],$J[$Ze][$zh]);$_=($q["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\1'.urlencode($q["db"]),ME):ME).'select='.urlencode($q["table"]).$_;if($q["ns"])$_=preg_replace('~([?&]ns=)[^&]+~','\1'.urlencode($q["ns"]),$_);if(count($q["source"])==1)break;}}}if($y=="COUNT(*)"){$_=ME."select=".urlencode($a);$s=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$Hi))$_.=where_link($s++,$W["col"],$W["val"],$W["op"]);}foreach($Hi
    7106 as$fe=>$W)$_.=where_link($s++,$fe,$W);}$X=select_value($X,$_,$o,$gi);$t=h("val[$Ii][".bracket_escape($y)."]");$Y=$_POST["val"][$Ii][bracket_escape($y)];$pc=!is_array($I[$y])&&isutf8($X)&&$J[$Ze][$y]==$I[$y]&&!$md[$y];$fi=preg_match('~text|lob~',$o["type"]);echo"<td id='$t'";if(($_GET["modify"]&&$pc)||$Y!==null){$ud=h($Y!==null?$Y:$I[$y]);echo">".($fi?"<textarea name='$t' cols='30' rows='".(substr_count($I[$y],"\n")+1)."'>$ud</textarea>":"<input name='$t' value='$ud' size='$xe[$y]'>");}else{$Be=strpos($X,"<i>…</i>");echo" data-text='".($Be?2:($fi?1:0))."'".($pc?"":" data-warning='".h(lang(257))."'").">$X</td>";}}}if($Ra)echo"<td>";$b->backwardKeysPrint($Ra,$J[$Ze]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n","</div>\n";}if(!is_ajax()){if($J||$D){$Dc=true;if($_GET["page"]!="last"){if($z==""||(count($J)<$z&&($J||!$D)))$jd=($D?$D*$z:0)+count($J);elseif($x!="sql"||!$ae){$jd=($ae?false:found_rows($R,$Z));if($jd<max(1e4,2*($D+1)*$z))$jd=reset(slow_query(count_rows($a,$Z,$ae,$pd)));else$Dc=false;}}$Pf=($z!=""&&($jd===false||$jd>$z||$D));if($Pf){echo(($jd===false?count($J)+1:$jd-$D*$z)>$z?'<p><a href="'.h(remove_from_uri("page")."&page=".($D+1)).'" class="loadmore">'.lang(258).'</a>'.script("qsl('a').onclick = partial(selectLoadMore, ".(+$z).", '".lang(259)."…');",""):''),"\n";}}echo"<div class='footer'><div>\n";if($J||$D){if($Pf){$Je=($jd===false?$D+(count($J)>=$z?2:1):floor(($jd-1)/$z));echo"<fieldset>";if($x!="simpledb"){echo"<legend><a href='".h(remove_from_uri("page"))."'>".lang(260)."</a></legend>",script("qsl('a').onclick = function () { pageClick(this.href, +prompt('".lang(260)."', '".($D+1)."')); return false; };"),pagination(0,$D).($D>5?" …":"");for($s=max(1,$D-4);$s<min($Je,$D+5);$s++)echo
    7107 pagination($s,$D);if($Je>0){echo($D+5<$Je?" …":""),($Dc&&$jd!==false?pagination($Je,$D):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$Je'>".lang(261)."</a>");}}else{echo"<legend>".lang(260)."</legend>",pagination(0,$D).($D>1?" …":""),($D?pagination($D,$D):""),($Je>$D?pagination($D+1,$D).($Je>$D+1?" …":""):"");}echo"</fieldset>\n";}echo"<fieldset>","<legend>".lang(262)."</legend>";$ec=($Dc?"":"~ ").$jd;echo
    7108 checkbox("all",1,0,($jd!==false?($Dc?"":"~ ").lang(150,$jd):""),"var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$ec' : checked); selectCount('selected2', this.checked || !checked ? '$ec' : checked);")."\n","</fieldset>\n";if($b->selectCommandPrint()){echo'<fieldset',($_GET["modify"]?'':' class="jsonly"'),'><legend>',lang(254),'</legend><div>
     7129as$y=>$X)$ze[$y]=max($ze[$y],min(40,strlen(utf8_decode($X))));}}echo($Ra?"<th>".lang(255):"")."</thead>\n";if(is_ajax()){if($z%2==1&&$D%2==1)odd();ob_end_clean();}foreach($b->rowDescriptions($J,$id)as$bf=>$I){$Ji=unique_array($J[$bf],$w);if(!$Ji){$Ji=array();foreach($J[$bf]as$y=>$X){if(!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~',$y))$Ji[$y]=$X;}}$Ki="";foreach($Ji
     7130as$y=>$X){if(($x=="sql"||$x=="pgsql")&&preg_match('~char|text|enum|set~',$p[$y]["type"])&&strlen($X)>64){$y=(strpos($y,'(')?$y:idf_escape($y));$y="MD5(".($x!='sql'||preg_match("~^utf8~",$p[$y]["collation"])?$y:"CONVERT($y USING ".charset($h).")").")";$X=md5($X);}$Ki.="&".($X!==null?urlencode("where[".bracket_escape($y)."]")."=".urlencode($X):"null%5B%5D=".urlencode($y));}echo"<tr".odd().">".(!$rd&&$K?"":"<td>".checkbox("check[]",substr($Ki,1),in_array(substr($Ki,1),(array)$_POST["check"])).($ce||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$Ki)."' class='edit'>".lang(256)."</a>"));foreach($I
     7131as$y=>$X){if(isset($cf[$y])){$o=$p[$y];$X=$m->value($X,$o);if($X!=""&&(!isset($wc[$y])||$wc[$y]!=""))$wc[$y]=(is_mail($X)?$cf[$y]:"");$_="";if(preg_match('~blob|bytea|raw|file~',$o["type"])&&$X!="")$_=ME.'download='.urlencode($a).'&field='.urlencode($y).$Ki;if(!$_&&$X!==null){foreach((array)$id[$y]as$q){if(count($id[$y])==1||end($q["source"])==$y){$_="";foreach($q["source"]as$s=>$Ah)$_.=where_link($s,$q["target"][$s],$J[$bf][$Ah]);$_=($q["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\1'.urlencode($q["db"]),ME):ME).'select='.urlencode($q["table"]).$_;if($q["ns"])$_=preg_replace('~([?&]ns=)[^&]+~','\1'.urlencode($q["ns"]),$_);if(count($q["source"])==1)break;}}}if($y=="COUNT(*)"){$_=ME."select=".urlencode($a);$s=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$Ji))$_.=where_link($s++,$W["col"],$W["val"],$W["op"]);}foreach($Ji
     7132as$he=>$W)$_.=where_link($s++,$he,$W);}$X=select_value($X,$_,$o,$ii);$t=h("val[$Ki][".bracket_escape($y)."]");$Y=$_POST["val"][$Ki][bracket_escape($y)];$rc=!is_array($I[$y])&&isutf8($X)&&$J[$bf][$y]==$I[$y]&&!$od[$y];$hi=preg_match('~text|lob~',$o["type"]);echo"<td id='$t'";if(($_GET["modify"]&&$rc)||$Y!==null){$wd=h($Y!==null?$Y:$I[$y]);echo">".($hi?"<textarea name='$t' cols='30' rows='".(substr_count($I[$y],"\n")+1)."'>$wd</textarea>":"<input name='$t' value='$wd' size='$ze[$y]'>");}else{$De=strpos($X,"<i>…</i>");echo" data-text='".($De?2:($hi?1:0))."'".($rc?"":" data-warning='".h(lang(257))."'").">$X</td>";}}}if($Ra)echo"<td>";$b->backwardKeysPrint($Ra,$J[$bf]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n","</div>\n";}if(!is_ajax()){if($J||$D){$Fc=true;if($_GET["page"]!="last"){if($z==""||(count($J)<$z&&($J||!$D)))$ld=($D?$D*$z:0)+count($J);elseif($x!="sql"||!$ce){$ld=($ce?false:found_rows($R,$Z));if($ld<max(1e4,2*($D+1)*$z))$ld=reset(slow_query(count_rows($a,$Z,$ce,$rd)));else$Fc=false;}}$Rf=($z!=""&&($ld===false||$ld>$z||$D));if($Rf){echo(($ld===false?count($J)+1:$ld-$D*$z)>$z?'<p><a href="'.h(remove_from_uri("page")."&page=".($D+1)).'" class="loadmore">'.lang(258).'</a>'.script("qsl('a').onclick = partial(selectLoadMore, ".(+$z).", '".lang(259)."…');",""):''),"\n";}}echo"<div class='footer'><div>\n";if($J||$D){if($Rf){$Le=($ld===false?$D+(count($J)>=$z?2:1):floor(($ld-1)/$z));echo"<fieldset>";if($x!="simpledb"){echo"<legend><a href='".h(remove_from_uri("page"))."'>".lang(260)."</a></legend>",script("qsl('a').onclick = function () { pageClick(this.href, +prompt('".lang(260)."', '".($D+1)."')); return false; };"),pagination(0,$D).($D>5?" …":"");for($s=max(1,$D-4);$s<min($Le,$D+5);$s++)echo
     7133pagination($s,$D);if($Le>0){echo($D+5<$Le?" …":""),($Fc&&$ld!==false?pagination($Le,$D):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$Le'>".lang(261)."</a>");}}else{echo"<legend>".lang(260)."</legend>",pagination(0,$D).($D>1?" …":""),($D?pagination($D,$D):""),($Le>$D?pagination($D+1,$D).($Le>$D+1?" …":""):"");}echo"</fieldset>\n";}echo"<fieldset>","<legend>".lang(262)."</legend>";$gc=($Fc?"":"~ ").$ld;echo
     7134checkbox("all",1,0,($ld!==false?($Fc?"":"~ ").lang(150,$ld):""),"var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$gc' : checked); selectCount('selected2', this.checked || !checked ? '$gc' : checked);")."\n","</fieldset>\n";if($b->selectCommandPrint()){echo'<fieldset',($_GET["modify"]?'':' class="jsonly"'),'><legend>',lang(254),'</legend><div>
    71097135<input type="submit" value="',lang(14),'"',($_GET["modify"]?'':' title="'.lang(250).'"'),'>
    71107136</div></fieldset>
     
    71137139<input type="submit" name="clone" value="',lang(246),'">
    71147140<input type="submit" name="delete" value="',lang(18),'">',confirm(),'</div></fieldset>
    7115 ';}$hd=$b->dumpFormat();foreach((array)$_GET["columns"]as$e){if($e["fun"]){unset($hd['sql']);break;}}if($hd){print_fieldset("export",lang(74)." <span id='selected2'></span>");$Nf=$b->dumpOutput();echo($Nf?html_select("output",$Nf,$za["output"])." ":""),html_select("format",$hd,$za["format"])," <input type='submit' name='export' value='".lang(74)."'>\n","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($uc,'strlen'),$f);}echo"</div></div>\n";if($b->selectImportPrint()){echo"<div>","<a href='#import'>".lang(73)."</a>",script("qsl('a').onclick = partial(toggle, 'import');",""),"<span id='import' class='hidden'>: ","<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$za["format"],1);echo" <input type='submit' name='import' value='".lang(73)."'>","</span>","</div>";}echo"<input type='hidden' name='token' value='$ri'>\n","</form>\n",(!$pd&&$K?"":script("tableCheck();"));}}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$O=isset($_GET["status"]);page_header($O?lang(118):lang(117));$Zi=($O?show_status():show_variables());if(!$Zi)echo"<p class='message'>".lang(12)."\n";else{echo"<table cellspacing='0'>\n";foreach($Zi
    7116 as$y=>$X){echo"<tr>","<th><code class='jush-".$x.($O?"status":"set")."'>".h($y)."</code>","<td>".h($X);}echo"</table>\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$Ph=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$B=>$R){json_row("Comment-$B",h($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$y)json_row("$y-$B",h($R[$y]));foreach($Ph+array("Auto_increment"=>0,"Rows"=>0)as$y=>$X){if($R[$y]!=""){$X=format_number($R[$y]);json_row("$y-$B",($y=="Rows"&&$X&&$R["Engine"]==($Bh=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($Ph[$y]))$Ph[$y]+=($R["Engine"]!="InnoDB"||$y!="Data_free"?$R[$y]:0);}elseif(array_key_exists($y,$R))json_row("$y-$B");}}}foreach($Ph
    7117 as$y=>$X)json_row("sum-$y",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{$Yh=array_merge((array)$_POST["tables"],(array)$_POST["views"]);if($Yh&&!$n&&!$_POST["search"]){$G=true;$Oe="";if($x=="sql"&&$_POST["tables"]&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$G=truncate_tables($_POST["tables"]);$Oe=lang(263);}elseif($_POST["move"]){$G=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$Oe=lang(264);}elseif($_POST["copy"]){$G=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$Oe=lang(265);}elseif($_POST["drop"]){if($_POST["views"])$G=drop_views($_POST["views"]);if($G&&$_POST["tables"])$G=drop_tables($_POST["tables"]);$Oe=lang(266);}elseif($x!="sql"){$G=($x=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$Oe=lang(267);}elseif(!$_POST["tables"])$Oe=lang(9);elseif($G=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($I=$G->fetch_assoc())$Oe.="<b>".h($I["Table"])."</b>: ".h($I["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$Oe,$G);}page_header(($_GET["ns"]==""?lang(38).": ".h(DB):lang(78).": ".h($_GET["ns"])),$n,true);if($b->homepage()){if($_GET["ns"]!==""){echo"<h3 id='tables-views'>".lang(268)."</h3>\n";$Xh=tables_list();if(!$Xh)echo"<p class='message'>".lang(9)."\n";else{echo"<form action='' method='post'>\n";if(support("table")){echo"<fieldset><legend>".lang(269)." <span id='selected2'></span></legend><div>","<input type='search' name='query' value='".h($_POST["query"])."'>",script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');","")," <input type='submit' name='search' value='".lang(57)."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!=""){$_GET["where"][0]["op"]="LIKE %%";search_tables();}}echo"<div class='scrollable'>\n","<table cellspacing='0' class='nowrap checkable'>\n",script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});"),'<thead><tr class="wrap">','<td><input id="check-all" type="checkbox" class="jsonly">'.script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);",""),'<th>'.lang(131),'<td>'.lang(270).doc_link(array('sql'=>'storage-engines.html')),'<td>'.lang(122).doc_link(array('sql'=>'charset-charsets.html','mariadb'=>'supported-character-sets-and-collations/')),'<td>'.lang(271).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT','oracle'=>'REFRN20286')),'<td>'.lang(272).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT')),'<td>'.lang(273).doc_link(array('sql'=>'show-table-status.html')),'<td>'.lang(52).doc_link(array('sql'=>'example-auto-increment.html','mariadb'=>'auto_increment/')),'<td>'.lang(274).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'catalog-pg-class.html#CATALOG-PG-CLASS','oracle'=>'REFRN20286')),(support("comment")?'<td>'.lang(51).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')):''),"</thead>\n";$S=0;foreach($Xh
    7118 as$B=>$T){$cj=($T!==null&&!preg_match('~table~i',$T));$t=h("Table-".$B);echo'<tr'.odd().'><td>'.checkbox(($cj?"views[]":"tables[]"),$B,in_array($B,$Yh,true),"","","",$t),'<th>'.(support("table")||support("indexes")?"<a href='".h(ME)."table=".urlencode($B)."' title='".lang(43)."' id='$t'>".h($B).'</a>':h($B));if($cj){echo'<td colspan="6"><a href="'.h(ME)."view=".urlencode($B).'" title="'.lang(44).'">'.(preg_match('~materialized~i',$T)?lang(129):lang(130)).'</a>','<td align="right"><a href="'.h(ME)."select=".urlencode($B).'" title="'.lang(42).'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",lang(45)),"Index_length"=>array("indexes",lang(133)),"Data_free"=>array("edit",lang(46)),"Auto_increment"=>array("auto_increment=1&create",lang(45)),"Rows"=>array("select",lang(42)),)as$y=>$_){$t=" id='$y-".h($B)."'";echo($_?"<td align='right'>".(support("table")||$y=="Rows"||(support("indexes")&&$y!="Data_length")?"<a href='".h(ME."$_[0]=").urlencode($B)."'$t title='$_[1]'>?</a>":"<span$t>?</span>"):"<td id='$y-".h($B)."'>");}$S++;}echo(support("comment")?"<td id='Comment-".h($B)."'>":"");}echo"<tr><td><th>".lang(247,count($Xh)),"<td>".h($x=="sql"?$h->result("SELECT @@storage_engine"):""),"<td>".h(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$y)echo"<td align='right' id='sum-$y'>";echo"</table>\n","</div>\n";if(!information_schema(DB)){echo"<div class='footer'><div>\n";$Wi="<input type='submit' value='".lang(275)."'> ".on_help("'VACUUM'");$zf="<input type='submit' name='optimize' value='".lang(276)."'> ".on_help($x=="sql"?"'OPTIMIZE TABLE'":"'VACUUM OPTIMIZE'");echo"<fieldset><legend>".lang(126)." <span id='selected'></span></legend><div>".($x=="sqlite"?$Wi:($x=="pgsql"?$Wi.$zf:($x=="sql"?"<input type='submit' value='".lang(277)."'> ".on_help("'ANALYZE TABLE'").$zf."<input type='submit' name='check' value='".lang(278)."'> ".on_help("'CHECK TABLE'")."<input type='submit' name='repair' value='".lang(279)."'> ".on_help("'REPAIR TABLE'"):"")))."<input type='submit' name='truncate' value='".lang(280)."'> ".on_help($x=="sqlite"?"'DELETE'":"'TRUNCATE".($x=="pgsql"?"'":" TABLE'")).confirm()."<input type='submit' name='drop' value='".lang(127)."'>".on_help("'DROP TABLE'").confirm()."\n";$k=(support("scheme")?$b->schemas():$b->databases());if(count($k)!=1&&$x!="sqlite"){$l=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".lang(281).": ",($k?html_select("target",$k,$l):'<input name="target" value="'.h($l).'" autocapitalize="off">')," <input type='submit' name='move' value='".lang(282)."'>",(support("copy")?" <input type='submit' name='copy' value='".lang(283)."'> ".checkbox("overwrite",1,$_POST["overwrite"],lang(284)):""),"\n";}echo"<input type='hidden' name='all' value=''>";echo
    7119 script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/));".(support("table")?" selectCount('selected2', formChecked(this, /^tables\[/) || $S);":"")." }"),"<input type='hidden' name='token' value='$ri'>\n","</div></fieldset>\n","</div></div>\n";}echo"</form>\n",script("tableCheck();");}echo'<p class="links"><a href="'.h(ME).'create=">'.lang(75)."</a>\n",(support("view")?'<a href="'.h(ME).'view=">'.lang(204)."</a>\n":"");if(support("routine")){echo"<h3 id='routines'>".lang(143)."</h3>\n";$Zg=routines();if($Zg){echo"<table cellspacing='0'>\n",'<thead><tr><th>'.lang(183).'<td>'.lang(50).'<td>'.lang(221)."<td></thead>\n";odd('');foreach($Zg
    7120 as$I){$B=($I["SPECIFIC_NAME"]==$I["ROUTINE_NAME"]?"":"&name=".urlencode($I["ROUTINE_NAME"]));echo'<tr'.odd().'>','<th><a href="'.h(ME.($I["ROUTINE_TYPE"]!="PROCEDURE"?'callf=':'call=').urlencode($I["SPECIFIC_NAME"]).$B).'">'.h($I["ROUTINE_NAME"]).'</a>','<td>'.h($I["ROUTINE_TYPE"]),'<td>'.h($I["DTD_IDENTIFIER"]),'<td><a href="'.h(ME.($I["ROUTINE_TYPE"]!="PROCEDURE"?'function=':'procedure=').urlencode($I["SPECIFIC_NAME"]).$B).'">'.lang(136)."</a>";}echo"</table>\n";}echo'<p class="links">'.(support("procedure")?'<a href="'.h(ME).'procedure=">'.lang(220).'</a>':'').'<a href="'.h(ME).'function=">'.lang(219)."</a>\n";}if(support("sequence")){echo"<h3 id='sequences'>".lang(285)."</h3>\n";$nh=get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema() ORDER BY sequence_name");if($nh){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(183)."</thead>\n";odd('');foreach($nh
    7121 as$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(226)."</a>\n";}if(support("type")){echo"<h3 id='user-types'>".lang(26)."</h3>\n";$Ui=types();if($Ui){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(183)."</thead>\n";odd('');foreach($Ui
     7141';}$jd=$b->dumpFormat();foreach((array)$_GET["columns"]as$e){if($e["fun"]){unset($jd['sql']);break;}}if($jd){print_fieldset("export",lang(74)." <span id='selected2'></span>");$Pf=$b->dumpOutput();echo($Pf?html_select("output",$Pf,$za["output"])." ":""),html_select("format",$jd,$za["format"])," <input type='submit' name='export' value='".lang(74)."'>\n","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($wc,'strlen'),$f);}echo"</div></div>\n";if($b->selectImportPrint()){echo"<div>","<a href='#import'>".lang(73)."</a>",script("qsl('a').onclick = partial(toggle, 'import');",""),"<span id='import' class='hidden'>: ","<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$za["format"],1);echo" <input type='submit' name='import' value='".lang(73)."'>","</span>","</div>";}echo"<input type='hidden' name='token' value='$ti'>\n","</form>\n",(!$rd&&$K?"":script("tableCheck();"));}}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$O=isset($_GET["status"]);page_header($O?lang(118):lang(117));$bj=($O?show_status():show_variables());if(!$bj)echo"<p class='message'>".lang(12)."\n";else{echo"<table cellspacing='0'>\n";foreach($bj
     7142as$y=>$X){echo"<tr>","<th><code class='jush-".$x.($O?"status":"set")."'>".h($y)."</code>","<td>".h($X);}echo"</table>\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$Rh=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$B=>$R){json_row("Comment-$B",h($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$y)json_row("$y-$B",h($R[$y]));foreach($Rh+array("Auto_increment"=>0,"Rows"=>0)as$y=>$X){if($R[$y]!=""){$X=format_number($R[$y]);json_row("$y-$B",($y=="Rows"&&$X&&$R["Engine"]==($Dh=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($Rh[$y]))$Rh[$y]+=($R["Engine"]!="InnoDB"||$y!="Data_free"?$R[$y]:0);}elseif(array_key_exists($y,$R))json_row("$y-$B");}}}foreach($Rh
     7143as$y=>$X)json_row("sum-$y",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{$ai=array_merge((array)$_POST["tables"],(array)$_POST["views"]);if($ai&&!$n&&!$_POST["search"]){$G=true;$Qe="";if($x=="sql"&&$_POST["tables"]&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$G=truncate_tables($_POST["tables"]);$Qe=lang(263);}elseif($_POST["move"]){$G=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$Qe=lang(264);}elseif($_POST["copy"]){$G=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$Qe=lang(265);}elseif($_POST["drop"]){if($_POST["views"])$G=drop_views($_POST["views"]);if($G&&$_POST["tables"])$G=drop_tables($_POST["tables"]);$Qe=lang(266);}elseif($x!="sql"){$G=($x=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$Qe=lang(267);}elseif(!$_POST["tables"])$Qe=lang(9);elseif($G=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($I=$G->fetch_assoc())$Qe.="<b>".h($I["Table"])."</b>: ".h($I["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$Qe,$G);}page_header(($_GET["ns"]==""?lang(38).": ".h(DB):lang(78).": ".h($_GET["ns"])),$n,true);if($b->homepage()){if($_GET["ns"]!==""){echo"<h3 id='tables-views'>".lang(268)."</h3>\n";$Zh=tables_list();if(!$Zh)echo"<p class='message'>".lang(9)."\n";else{echo"<form action='' method='post'>\n";if(support("table")){echo"<fieldset><legend>".lang(269)." <span id='selected2'></span></legend><div>","<input type='search' name='query' value='".h($_POST["query"])."'>",script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');","")," <input type='submit' name='search' value='".lang(57)."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!=""){$_GET["where"][0]["op"]="LIKE %%";search_tables();}}echo"<div class='scrollable'>\n","<table cellspacing='0' class='nowrap checkable'>\n",script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});"),'<thead><tr class="wrap">','<td><input id="check-all" type="checkbox" class="jsonly">'.script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);",""),'<th>'.lang(131),'<td>'.lang(270).doc_link(array('sql'=>'storage-engines.html')),'<td>'.lang(122).doc_link(array('sql'=>'charset-charsets.html','mariadb'=>'supported-character-sets-and-collations/')),'<td>'.lang(271).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT','oracle'=>'REFRN20286')),'<td>'.lang(272).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT')),'<td>'.lang(273).doc_link(array('sql'=>'show-table-status.html')),'<td>'.lang(52).doc_link(array('sql'=>'example-auto-increment.html','mariadb'=>'auto_increment/')),'<td>'.lang(274).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'catalog-pg-class.html#CATALOG-PG-CLASS','oracle'=>'REFRN20286')),(support("comment")?'<td>'.lang(51).doc_link(array('sql'=>'show-table-status.html','pgsql'=>'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')):''),"</thead>\n";$S=0;foreach($Zh
     7144as$B=>$T){$ej=($T!==null&&!preg_match('~table~i',$T));$t=h("Table-".$B);echo'<tr'.odd().'><td>'.checkbox(($ej?"views[]":"tables[]"),$B,in_array($B,$ai,true),"","","",$t),'<th>'.(support("table")||support("indexes")?"<a href='".h(ME)."table=".urlencode($B)."' title='".lang(43)."' id='$t'>".h($B).'</a>':h($B));if($ej){echo'<td colspan="6"><a href="'.h(ME)."view=".urlencode($B).'" title="'.lang(44).'">'.(preg_match('~materialized~i',$T)?lang(129):lang(130)).'</a>','<td align="right"><a href="'.h(ME)."select=".urlencode($B).'" title="'.lang(42).'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",lang(45)),"Index_length"=>array("indexes",lang(133)),"Data_free"=>array("edit",lang(46)),"Auto_increment"=>array("auto_increment=1&create",lang(45)),"Rows"=>array("select",lang(42)),)as$y=>$_){$t=" id='$y-".h($B)."'";echo($_?"<td align='right'>".(support("table")||$y=="Rows"||(support("indexes")&&$y!="Data_length")?"<a href='".h(ME."$_[0]=").urlencode($B)."'$t title='$_[1]'>?</a>":"<span$t>?</span>"):"<td id='$y-".h($B)."'>");}$S++;}echo(support("comment")?"<td id='Comment-".h($B)."'>":"");}echo"<tr><td><th>".lang(247,count($Zh)),"<td>".h($x=="sql"?$h->result("SELECT @@storage_engine"):""),"<td>".h(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$y)echo"<td align='right' id='sum-$y'>";echo"</table>\n","</div>\n";if(!information_schema(DB)){echo"<div class='footer'><div>\n";$Yi="<input type='submit' value='".lang(275)."'> ".on_help("'VACUUM'");$Af="<input type='submit' name='optimize' value='".lang(276)."'> ".on_help($x=="sql"?"'OPTIMIZE TABLE'":"'VACUUM OPTIMIZE'");echo"<fieldset><legend>".lang(126)." <span id='selected'></span></legend><div>".($x=="sqlite"?$Yi:($x=="pgsql"?$Yi.$Af:($x=="sql"?"<input type='submit' value='".lang(277)."'> ".on_help("'ANALYZE TABLE'").$Af."<input type='submit' name='check' value='".lang(278)."'> ".on_help("'CHECK TABLE'")."<input type='submit' name='repair' value='".lang(279)."'> ".on_help("'REPAIR TABLE'"):"")))."<input type='submit' name='truncate' value='".lang(280)."'> ".on_help($x=="sqlite"?"'DELETE'":"'TRUNCATE".($x=="pgsql"?"'":" TABLE'")).confirm()."<input type='submit' name='drop' value='".lang(127)."'>".on_help("'DROP TABLE'").confirm()."\n";$k=(support("scheme")?$b->schemas():$b->databases());if(count($k)!=1&&$x!="sqlite"){$l=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".lang(281).": ",($k?html_select("target",$k,$l):'<input name="target" value="'.h($l).'" autocapitalize="off">')," <input type='submit' name='move' value='".lang(282)."'>",(support("copy")?" <input type='submit' name='copy' value='".lang(283)."'> ".checkbox("overwrite",1,$_POST["overwrite"],lang(284)):""),"\n";}echo"<input type='hidden' name='all' value=''>";echo
     7145script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/));".(support("table")?" selectCount('selected2', formChecked(this, /^tables\[/) || $S);":"")." }"),"<input type='hidden' name='token' value='$ti'>\n","</div></fieldset>\n","</div></div>\n";}echo"</form>\n",script("tableCheck();");}echo'<p class="links"><a href="'.h(ME).'create=">'.lang(75)."</a>\n",(support("view")?'<a href="'.h(ME).'view=">'.lang(204)."</a>\n":"");if(support("routine")){echo"<h3 id='routines'>".lang(143)."</h3>\n";$bh=routines();if($bh){echo"<table cellspacing='0'>\n",'<thead><tr><th>'.lang(183).'<td>'.lang(50).'<td>'.lang(221)."<td></thead>\n";odd('');foreach($bh
     7146as$I){$B=($I["SPECIFIC_NAME"]==$I["ROUTINE_NAME"]?"":"&name=".urlencode($I["ROUTINE_NAME"]));echo'<tr'.odd().'>','<th><a href="'.h(ME.($I["ROUTINE_TYPE"]!="PROCEDURE"?'callf=':'call=').urlencode($I["SPECIFIC_NAME"]).$B).'">'.h($I["ROUTINE_NAME"]).'</a>','<td>'.h($I["ROUTINE_TYPE"]),'<td>'.h($I["DTD_IDENTIFIER"]),'<td><a href="'.h(ME.($I["ROUTINE_TYPE"]!="PROCEDURE"?'function=':'procedure=').urlencode($I["SPECIFIC_NAME"]).$B).'">'.lang(136)."</a>";}echo"</table>\n";}echo'<p class="links">'.(support("procedure")?'<a href="'.h(ME).'procedure=">'.lang(220).'</a>':'').'<a href="'.h(ME).'function=">'.lang(219)."</a>\n";}if(support("sequence")){echo"<h3 id='sequences'>".lang(285)."</h3>\n";$ph=get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema() ORDER BY sequence_name");if($ph){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(183)."</thead>\n";odd('');foreach($ph
     7147as$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(226)."</a>\n";}if(support("type")){echo"<h3 id='user-types'>".lang(26)."</h3>\n";$Wi=types();if($Wi){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(183)."</thead>\n";odd('');foreach($Wi
    71227148as$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(230)."</a>\n";}if(support("event")){echo"<h3 id='events'>".lang(144)."</h3>\n";$J=get_rows("SHOW EVENTS");if($J){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(183)."<td>".lang(286)."<td>".lang(210)."<td>".lang(211)."<td></thead>\n";foreach($J
    7123 as$I){echo"<tr>","<th>".h($I["Name"]),"<td>".($I["Execute at"]?lang(287)."<td>".$I["Execute at"]:lang(212)." ".$I["Interval value"]." ".$I["Interval field"]."<td>$I[Starts]"),"<td>$I[Ends]",'<td><a href="'.h(ME).'event='.urlencode($I["Name"]).'">'.lang(136).'</a>';}echo"</table>\n";$Bc=$h->result("SELECT @@event_scheduler");if($Bc&&$Bc!="ON")echo"<p class='error'><code class='jush-sqlset'>event_scheduler</code>: ".h($Bc)."\n";}echo'<p class="links"><a href="'.h(ME).'event=">'.lang(209)."</a>\n";}if($Xh)echo
     7149as$I){echo"<tr>","<th>".h($I["Name"]),"<td>".($I["Execute at"]?lang(287)."<td>".$I["Execute at"]:lang(212)." ".$I["Interval value"]." ".$I["Interval field"]."<td>$I[Starts]"),"<td>$I[Ends]",'<td><a href="'.h(ME).'event='.urlencode($I["Name"]).'">'.lang(136).'</a>';}echo"</table>\n";$Dc=$h->result("SELECT @@event_scheduler");if($Dc&&$Dc!="ON")echo"<p class='error'><code class='jush-sqlset'>event_scheduler</code>: ".h($Dc)."\n";}echo'<p class="links"><a href="'.h(ME).'event=">'.lang(209)."</a>\n";}if($Zh)echo
    71247150script("ajaxSetHtml('".js_escape(ME)."script=db');");}}}page_footer();
  • _plugins_/adminer/paquet.xml

    r120039 r120903  
    22        prefix="adminer"
    33        categorie="outil"
    4         version="4.7.5.1"
     4        version="4.7.6.0"
    55        etat="stable"
    66        compatibilite="[2.0.0;3.3.*]"
  • _plugins_/adminer/plugin.xml

    r120039 r120903  
    33        <slogan>Utiliser Adminer pour explorer la base SPIP</slogan>
    44        <auteur>Jakub Vrana ( https://www.vrana.cz ), mis en plugin par Fil</auteur>
    5         <version>4.7.5.1</version>
     5        <version>4.7.6.0</version>
    66        <etat>stable</etat>
    77        <prefix>adminer</prefix>
Note: See TracChangeset for help on using the changeset viewer.