document.body.className+=' js';function toggle(id){var el=document.getElementById(id);el.className=(el.className=='hidden'?'':'hidden');return true;} function cookie(assign,days,params){var date=new Date();date.setDate(date.getDate()+days);document.cookie=assign+'; expires='+date+(params||'');} function verifyVersion(protocol){cookie('adminer_version=0',1);var script=document.createElement('script');script.src=protocol+'://www.adminer.org/version.php';document.body.appendChild(script);} function formCheck(el,name){var elems=el.form.elements;for(var i=0;i",$v);}function checkbox($g,$o,$qb,$Ac="",$Mc=""){static$Y=0;$Y++;$b="";return($Ac!=""?"":$b);}function optionlist($Ga,$Pd=null,$Oc=false){$b="";foreach($Ga as$pa=>$r){if(is_array($r)){$b.='';}foreach((is_array($r)?$r:array($pa=>$r))as$d=>$a){$b.=''.h($a);}if(is_array($r)){$b.='';}}return$b;}function html_select($g,$Ga,$o="",$Ta=true){if($Ta){return"";}$b="";foreach($Ga as$d=>$a){$b.="";}return$b;}function confirm($Ic=""){return" onclick=\"return confirm('".lang(0).($Ic?" (' + $Ic + ')":"")."');\"";}function js_escape($v){return addcslashes($v,"\r\n'\\/");}function ini_bool($Id){$a=ini_get($Id);return(eregi('^(on|true|yes)$',$a)||(int)$a);}function q($v){global$e;return$e->quote($v);}function get_vals($j,$u=0){global$e;$b=array();$i=$e->query($j);if(is_object($i)){while($c=$i->fetch_row()){$b[]=$c[$u];}}return$b;}function get_key_vals($j,$L=null){global$e;if(!is_object($L)){$L=$e;}$b=array();$i=$L->query($j);while($c=$i->fetch_row()){$b[$c[0]]=$c[1];}return$b;}function get_rows($j,$L=null,$p="

"){global$e;if(!is_object($L)){$L=$e;}$b=array();$i=$L->query($j);if(is_object($i)){while($c=$i->fetch_assoc()){$b[]=$c;}}elseif(!$i&&$p&&(headers_sent()||ob_get_level())){echo$p.error()."\n";}return$b;}function unique_array($c,$V){foreach($V as$S){if(ereg("PRIMARY|UNIQUE",$S["type"])){$b=array();foreach($S["columns"]as$d){if(!isset($c[$d])){continue 2;}$b[$d]=$c[$d];}return$b;}}$b=array();foreach($c as$d=>$a){if(!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~',$d)){$b[$d]=$a;}}return$b;}function where($l){global$_a;$b=array();foreach((array)$l["where"]as$d=>$a){$b[]=idf_escape(bracket_escape($d,1)).(ereg('\\.',$a)||$_a=="mssql"?" LIKE ".exact_value(addcslashes($a,"%_")):" = ".exact_value($a));}foreach((array)$l["null"]as$d){$b[]=idf_escape($d)." IS NULL";}return implode(" AND ",$b);}function where_check($a){parse_str($a,$ld);remove_slashes(array(&$ld));return where($ld);}function where_link($q,$u,$o,$Hd="="){return"&where%5B$q%5D%5Bcol%5D=".urlencode($u)."&where%5B$q%5D%5Bop%5D=".urlencode($Hd)."&where%5B$q%5D%5Bval%5D=".urlencode($o);}function cookie($g,$o){global$db;$tb=array($g,(ereg("\n",$o)?"":$o),time()+2592000,preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$db);if(version_compare(PHP_VERSION,'5.2.0')>=0){$tb[]=true;}return call_user_func_array('setcookie',$tb);}function restart_session(){if(!ini_bool("session.use_cookies")){session_start();}}function&get_session($d){return$_SESSION[$d][DRIVER][SERVER][$_GET["username"]];}function set_session($d,$a){$_SESSION[$d][DRIVER][SERVER][$_GET["username"]]=$a;}function auth_url($Eb,$D,$C){global$xa;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($xa))."|username|".session_name()),$k);return"$k[1]?".(SID&&!$_COOKIE?SID."&":"").($Eb!="server"||$D!=""?urlencode($Eb)."=".urlencode($D)."&":"")."username=".urlencode($C).($k[2]?"&$k[2]":"");}function redirect($fa,$qa=null){if(isset($qa)){restart_session();$_SESSION["messages"][]=$qa;}if(isset($fa)){header("Location: ".($fa!=""?$fa:"."));exit;}}function query_redirect($j,$fa,$qa,$Cb=true,$Cd=true,$pd=false){global$e,$p,$m;if($Cd){$pd=!$e->query($j);}$sc="";if($j){$sc=$m->messageQuery($j);}if($pd){$p=error().$sc;return false;}if($Cb){redirect($fa,$qa.$sc);}return true;}function queries($j=null){global$e;static$Fa=array();if(!isset($j)){return implode(";\n",$Fa);}$Fa[]=$j;return$e->query($j);}function apply_queries($j,$B,$sd='table'){foreach($B as$h){if(!queries("$j ".$sd($h))){return false;}}return true;}function queries_redirect($fa,$qa,$Cb){return query_redirect(queries(),$fa,$qa,$Cb,false,!$Cb);}function remove_from_uri($Da=""){return substr(preg_replace("~(?<=[?&])($Da".(SID?"":"|".session_name()).")=[^&]*&~",'',"$_SERVER[REQUEST_URI]&"),0,-1);}function pagination($P,$qd){return" ".($P==$qd?$P+1:''.($P+1)."");}function get_file($d,$ad=false){$aa=$_FILES[$d];if(!$aa||$aa["error"]){return$aa["error"];}return file_get_contents($ad&&ereg('\\.gz$',$aa["name"])?"compress.zlib://$aa[tmp_name]":($ad&&ereg('\\.bz2$',$aa["name"])?"compress.bzip2://$aa[tmp_name]":$aa["tmp_name"]));}function upload_error($p){$ed=($p==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):null);return($p?lang(1).($ed?" ".lang(2,$ed):""):lang(3));}function odd($b=' class="odd"'){static$q=0;if(!$b){$q=-1;}return($q++% 2?$b:'');}function is_utf8($a){return(preg_match('~~u',$a)&&!preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~',$a));}function shorten_utf8($v,$ua=80,$Bd=""){if(!preg_match("(^([\t\r\n -\x{FFFF}]{0,$ua})($)?)u",$v,$k)){preg_match("(^([\t\r\n -~]{0,$ua})($)?)",$v,$k);}return h($k[1]).$Bd.(isset($k[2])?"":"...");}function friendly_url($a){return preg_replace('~[^a-z0-9_]~i','-',$a);}function hidden_fields($Ma,$zd=array()){while(list($d,$a)=each($Ma)){if(is_array($a)){foreach($a as$pa=>$r){$Ma[$d."[$pa]"]=$r;}}elseif(!in_array($d,$zd)){echo'';}}}function hidden_fields_get(){echo(SID&&!$_COOKIE?'':''),(SERVER!==null?'':""),'';}function column_foreign_keys($h){global$m;$b=array();foreach($m->foreignKeys($h)as$K){foreach($K["source"]as$a){$b[$a][]=$K;}}return$b;}function enum_input($E,$la,$f,$o){preg_match_all("~'((?:[^']|'')*)'~",$f["length"],$ba);$b="";foreach($ba[1]as$q=>$a){$a=stripcslashes(str_replace("''","'",$a));$qb=(is_int($o)?$o==$q+1:(is_array($o)?in_array($q+1,$o):$o===$a));$b.=" ';}return$b;}function input($f,$o,$N){global$X,$m,$_a;$g=h(bracket_escape($f["field"]));echo"";$ja=(isset($_GET["select"])?array("orig"=>lang(4)):array())+$m->editFunctions($f);$la=" name='fields[$g]'";if($f["type"]=="enum"){echo nbsp($ja[""])."".$m->editInput($_GET["edit"],$f,$la,$o);}else{$Ua=0;foreach($ja as$d=>$a){if($d===""||!$a){break;}$Ua++;}$Ta=($Ua?" onchange=\"var f = this.form['function[".js_escape($g)."]']; if ($Ua > f.selectedIndex) f.selectedIndex = $Ua;\"":"");$la.=$Ta;echo(count($ja)>1?html_select("function[$g]",$ja,!isset($N)||in_array($N,$ja)||isset($ja[$N])?$N:""):nbsp(reset($ja))).'';$cd=$m->editInput($_GET["edit"],$f,$la,$o);if($cd!=""){echo$cd;}elseif($f["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$f["length"],$ba);foreach($ba[1]as$q=>$a){$a=stripcslashes(str_replace("''","'",$a));$qb=(is_int($o)?($o>>$q)&1:in_array($a,explode(",",$o),true));echo" ';}}elseif(ereg('blob|bytea|raw|file',$f["type"])&&ini_bool("file_uploads")){echo"";}elseif(ereg('text|lob',$f["type"])){echo"';}else{$dc=(!ereg('int',$f["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$f["length"],$k)?((ereg("binary",$f["type"])?2:1)*$k[1]+($k[3]?1:0)+($k[2]&&!$f["unsigned"]?1:0)):($X[$f["type"]]?$X[$f["type"]]+($f["unsigned"]?0:1):0));echo"20?" size='40'":"")."$la>";}}}function process_input($f){global$m;$A=bracket_escape($f["field"]);$N=$_POST["function"][$A];$o=$_POST["fields"][$A];if($f["type"]=="enum"){if($o==-1){return false;}if($o==""){return"NULL";}return+$o;}if($f["auto_increment"]&&$o==""){return null;}if($N=="orig"){return false;}if($N=="NULL"){return"NULL";}if($f["type"]=="set"){return array_sum((array)$o);}if(ereg('blob|bytea|raw|file',$f["type"])&&ini_bool("file_uploads")){$aa=get_file("fields-$A");if(!is_string($aa)){return false;}return q($aa);}return$m->processInput($f,$o,$N);}function search_tables(){global$m,$e;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$Yb=false;foreach(table_status()as$h=>$F){$g=$m->tableName($F);if(isset($F["Engine"])&&$g!=""&&(!$_POST["tables"]||in_array($h,$_POST["tables"]))){$i=$e->query("SELECT".limit("1 FROM ".table($h)," WHERE ".implode(" AND ",$m->selectSearchProcess(fields($h),array())),1));if($i->fetch_row()){if(!$Yb){echo"

":"

".lang(5))."\n";}function dump_csv($c){foreach($c as$d=>$a){if(preg_match("~[\"\n,;\t]~",$a)||$a===""){$c[$d]='"'.str_replace('"','""',$a).'"';}}echo implode(($_POST["format"]=="csv"?",":($_POST["format"]=="tsv"?"\t":";")),$c)."\n";}function apply_sql_function($N,$u){return($N?($N=="unixepoch"?"DATETIME($u, '$N')":($N=="count distinct"?"COUNT(DISTINCT ":strtoupper("$N("))."$u)"):$u);}function password_file(){$Sb=ini_get("upload_tmp_dir");if(!$Sb){if(function_exists('sys_get_temp_dir')){$Sb=sys_get_temp_dir();}else{$R=@tempnam("","");if(!$R){return false;}$Sb=dirname($R);unlink($R);}}$R="$Sb/adminer.key";$b=@file_get_contents($R);if($b){return$b;}$fc=@fopen($R,"w");if($fc){$b=md5(uniqid(mt_rand(),true));fwrite($fc,$b);fclose($fc);}return$b;}function is_mail($hb){$fd='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$xb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$da="$fd+(\\.$fd+)*@($xb?\\.)+$xb";return preg_match("(^$da(,\\s*$da)*\$)i",$hb);}function is_url($v){$xb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return(preg_match("~^(https?)://($xb?\\.)+$xb(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$v,$k)?strtolower($k[1]):"");}function print_fieldset($Y,$wd,$vd=false){echo"

$wd
\n";}print_fieldset("import",lang(77),!$y);echo" ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$hc["format"],1);echo" \n","\n";$m->selectEmailPrint(array_filter($Tb,'strlen'),$J);echo"\n";}}}else{page_header(lang(45),"",false);echo"
\n","

".lang(79).": \n";if($_POST["query"]!=""){search_tables();}echo"\n",'\n";foreach(table_status()as$h=>$c){$g=$m->tableName($c);if(isset($c["Engine"])&&$g!=""){echo'
'.lang(80).''.lang(81)."
'.checkbox("tables[]",$h,in_array($h,(array)$_POST["tables"],true),"","formUncheck('check-all');"),''.h($g).'';$a=number_format($c["Rows"],0,'.',lang(82));echo"".($c["Engine"]=="InnoDB"&&$a?"~ $a":$a)."";}}echo"
\n","

\n";}page_footer();