About 30,635 results: "php urlencode"
Page 1 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On











  1. where($Fa);}function
  2. where_link($s,$Na,$Y,$vd="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($Na)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$vd:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
  3. set_session($y,$X){$_SESSION[$y][DRIVER][SERVER][$_GET["username"]]=$X;}function
  4. auth_url($pb,$O,$If,$i=null){global$qb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($qb))."|username|".($i!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($pb!="server"||$O!=""?urlencode($pb)."=".urlencode($O)."&":"")."username=".urlencode($If).($i!=""?"&db=".urlencode($i):"").($B[2]?"&$B[2]":"");}function
  5. selectLinks($We,$P=""){echo'<p class="tabs">';$Oc=array("select"=>'Select data',"table"=>'Show structure');if(is_view($We))$Oc["view"]='Alter view';else$Oc["create"]='Alter table';if($P!==null)$Oc["edit"]='New item';foreach($Oc
  6. as$y=>$X)echo" <a href='".h(ME)."$y=".urlencode($We["Name"]).($y=="edit"?$P:"")."'".bold(isset($_GET[$y])).">$X</a>";echo"\n";}function
  7. backwardKeysPrint($xa,$K){}function
  8. selectQuery($H){global$x;return"<p><a href='".h(remove_from_uri("page"))."&amp;page=last' title='".'Last page'."'>&gt;&gt;</a> <code class='jush-$x'>".h(str_replace("\n"," ",$H))."</code> <a href='".h(ME)."sql=".urlencode($H)."'>".'Edit'."</a></p>\n";}function
  9. <div id="content">
  10. ';if($Ba!==null){$_=substr(preg_replace('~(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$qb[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~(db|ns)=[^&]*&~','',ME),0,-1);$O=(SERVER!=""?h(SERVER):'Server');if($Ba===false)echo"$O\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$O</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ba)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ba)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ba
  11. as$y=>$X){$lb=(is_array($X)?$X[1]:$X);if($lb!="")echo'<a href="'.h(ME."$y=").urlencode(is_array($X)?$X[0]:$X).'">'.h($lb).'</a> &raquo; ';}}echo"$kf\n";}}echo"<h2>$mf</h2>\n";restart_session();$Gf=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$cd=$_SESSION["messages"][$Gf];if($cd){echo"<div class='message'>".implode("</div>\n<div class='message'>",$cd)."</div>\n";unset($_SESSION["messages"][$Gf]);}$h=&get_session("dbs");if(DB!=""&&$h&&!in_array(DB,$h,true))$h=null;if($j)echo"<div class='error'>$j</div>\n";define("PAGE_HEADER",1);}function
  12. connect_error(){global$b,$f,$U,$j,$qb;$h=array();if(DB!="")page_header('Database'.": ".h(DB),'Invalid database.',true);else{if($_POST["db"]&&!$j)queries_redirect(substr(ME,0,-1),'Databases have been dropped.',drop_databases($_POST["db"]));page_header('Select database',$j,false);echo"<p><a href='".h(ME)."database='>".'Create new database'."</a>\n";foreach(array('privileges'=>'Privileges','processlist'=>'Process list','variables'=>'Variables','status'=>'Status',)as$y=>$X){if(support($y))echo"<a href='".h(ME)."$y='>$X</a>\n";}echo"<p>".sprintf('%s version: %s through PHP extension %s',$qb[DRIVER],"<b>$f->server_info</b>","<b>$f->extension</b>")."\n","<p>".sprintf('Logged as: %s',"<b>".h(logged_user())."</b>")."\n";if($_GET["refresh"])set_session("dbs",null);$h=$b->databases();if($h){$Be=support("scheme");$d=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n","<thead><tr><td>&nbsp;<th>".'Database'."<td>".'Collation'."<td>".'Tables'."</thead>\n";foreach($h
  13. as$i){$ve=h(ME)."db=".urlencode($i);echo"<tr".odd()."><td>".checkbox("db[]",$i,in_array($i,(array)$_POST["db"])),"<th><a href='$ve'>".h($i)."</a>","<td><a href='$ve".($Be?"&amp;ns=":"")."&amp;database=' title='".'Alter database'."'>".nbsp(db_collation($i,$d))."</a>","<td align='right'><a href='$ve&amp;schema=' id='tables-".h($i)."' title='".'Database schema'."'>?</a>","\n";}echo"</table>\n","<script type='text/javascript'>tableCheck();</script>\n","<p><input type='submit' name='drop' value='".'Drop'."'".confirm("formChecked(this, /db/)").">\n","<input type='hidden' name='token' value='$U'>\n","<a href='".h(ME)."refresh=1'>".'Refresh'."</a>\n","</form>\n";}}page_footer("db");if($h)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=connect');</script>\n";}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(!(DB!=""?$f->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")){if(DB!="")set_session("dbs",null);connect_error();exit;}function
  14. select($I,$g=null,$oc="",$Bd=array()){$Oc=array();$v=array();$e=array();$_a=array();$yf=array();$J=array();odd('');for($s=0;$K=$I->fetch_row();$s++){if(!$s){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($w=0;$w<count($K);$w++){$k=$I->fetch_field();$D=$k->name;$Ad=$k->orgtable;$_d=$k->orgname;$J[$k->table]=$Ad;if($oc)$Oc[$w]=($D=="table"?"table=":($D=="possible_keys"?"indexes=":null));elseif($Ad!=""){if(!isset($v[$Ad])){$v[$Ad]=array();foreach(indexes($Ad,$g)as$u){if($u["type"]=="PRIMARY"){$v[$Ad]=array_flip($u["columns"]);break;}}$e[$Ad]=$v[$Ad];}if(isset($e[$Ad][$_d])){unset($e[$Ad][$_d]);$v[$Ad][$_d]=$w;$Oc[$w]=$Ad;}}if($k->charsetnr==63)$_a[$w]=true;$yf[$w]=$k->type;$D=h($D);echo"<th".($Ad!=""||$k->name!=$_d?" title='".h(($Ad!=""?"$Ad.":"").$_d)."'":"").">".($oc?"<a href='$oc".strtolower($D)."' target='_blank' rel='noreferrer'>$D</a>":$D);}echo"</thead>\n";}echo"<tr".odd().">";foreach($K
  15. as$y=>$X){if($X===null)$X="<i>NULL</i>";elseif($_a[$y]&&!is_utf8($X))$X="<i>".lang(array('%d byte','%d bytes'),strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($yf[$y]==254)$X="<code>$X</code>";}if(isset($Oc[$y])&&!$e[$Oc[$y]]){if($oc){$S=$K[array_search("table=",$Oc)];$_=$Oc[$y].urlencode($Bd[$S]!=""?$Bd[$S]:$S);}else{$_="edit=".urlencode($Oc[$y]);foreach($v[$Oc[$y]]as$Ja=>$w)$_.="&where".urlencode("[".bracket_escape($Ja)."]")."=".urlencode($K[$w]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>":"<p class='message'>".'No rows.')."\n";return$J;}function

  1. q($mc);}return$b->processInput($m,$Y,$p);}function
  2. search_tables(){global$b,$h;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$vc=false;foreach(table_status()as$P=>$Q){$A=$b->tableName($Q);if(isset($Q["Engine"])&&$A!=""&&(!$_POST["tables"]||in_array($P,$_POST["tables"]))){$G=$h->query("SELECT".limit("1 FROM ".table($P)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($P),array())),1));if(!$G||$G->fetch_row()){if(!$vc){echo"<ul>\n";$vc=true;}echo"<li>".($G?"<a href='".h(ME."select=".urlencode($P)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$A</a>\n":"$A: <span class='error'>".error()."</span>\n");}}}echo($vc?"</ul>":"<p class='message'>".lang(6))."\n";}function
  3. unconvert_field($m,$H){if(ereg("binary",$m["type"]))$H="unhex($H)";if(ereg("geometry|point|linestring|polygon",$m["type"]))$H="GeomFromText($H)";return$H;}function
  4. support($lc){global$h;return!ereg("scheme|sequence|type".($h->server_info<5.1?"|event|partitioning".($h->server_info<5?"|view|routine|trigger":""):""),$lc);}$v="sql";$U=array();$Df=array();foreach(array(lang(13)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(14)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(15)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(19)=>array("enum"=>65535,"set"=>64),lang(16)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(18)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$w=>$X){$U+=$X;$Df[$w]=array_keys($X);}$ug=array("unsigned","zerofill","unsigned zerofill");$be=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","");$_c=array("char_length","date","from_unixtime","lower","round","sec_to_time","time_to_sec","upper");$Ec=array("avg","count","count distinct","group_concat","max","min","sum");$Kb=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array("(^|[^o])int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ia="3.6.1";class
  5. selectLinks($Kf,$M=""){echo'<p class="tabs">';$qd=array("select"=>lang(27),"table"=>lang(28));if(is_view($Kf))$qd["view"]=lang(29);else$qd["create"]=lang(30);if($M!==null)$qd["edit"]=lang(31);foreach($qd
  6. as$w=>$X)echo" <a href='".h(ME)."$w=".urlencode($Kf["Name"]).($w=="edit"?$M:"")."'".bold(isset($_GET[$w])).">$X</a>";echo"\n";}function
  7. backwardKeysPrint($Fa,$I){}function
  8. selectQuery($F){global$v;return"<p><a href='".h(remove_from_uri("page"))."&amp;page=last' title='".lang(32)."'>&gt;&gt;</a> <code class='jush-$v'>".h(str_replace("\n"," ",$F))."</code> <a href='".h(ME)."sql=".urlencode($F)."'>".lang(33)."</a></p>\n";}function
  9. <p class="logout">
  10. ';if(DB==""||!$Id){echo"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])).">".lang(46)."</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(54)."</a>\n";}echo'<input type="submit" name="logout" value="',lang(55),'" id="logout">
  11. tablesPrint($R){echo"<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";foreach($R
  12. as$P=>$T){echo'<a href="'.h(ME).'select='.urlencode($P).'"'.bold($_GET["select"]==$P).">".lang(59)."</a> ",'<a href="'.h(ME).'table='.urlencode($P).'"'.bold($_GET["table"]==$P)." title='".lang(28)."'>".$this->tableName(array("Name"=>$P))."</a><br>\n";}}}$b=(function_exists('adminer_object')?adminer_object():new
  13. as$m){echo"<tr".odd()."><th>".h($m["field"]),"<td title='".h($m["collation"])."'>".h($m["full_type"]).($m["null"]?" <i>NULL</i>":"").($m["auto_increment"]?" <i>".lang(94)."</i>":""),(isset($m["default"])?" [<b>".h($m["default"])."</b>]":""),(support("comment")?"<td>".nbsp($m["comment"]):""),"\n";}echo"</table>\n";if(!is_view($Q)){echo"<h3>".lang(104)."</h3>\n";$u=indexes($a);if($u){echo"<table cellspacing='0'>\n";foreach($u
  14. as$A=>$t){ksort($t["columns"]);$Je=array();foreach($t["columns"]as$w=>$X)$Je[]="<i>".h($X)."</i>".($t["lengths"][$w]?"(".$t["lengths"][$w].")":"");echo"<tr title='".h($A)."'><th>$t[type]<td>".implode(", ",$Je)."\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(105)."</a>\n";if(fk_support($Q)){echo"<h3>".lang(86)."</h3>\n";$tc=foreign_keys($a);if($tc){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(106)."<td>".lang(107)."<td>".lang(88)."<td>".lang(108).($v!="sqlite"?"<td>&nbsp;":"")."</thead>\n";foreach($tc
  15. as$A=>$o){echo"<tr title='".h($A)."'>","<th><i>".implode("</i>, <i>",array_map('h',$o["source"]))."</i>","<td><a href='".h($o["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($o["db"]),ME):($o["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($o["ns"]),ME):ME))."table=".urlencode($o["table"])."'>".($o["db"]!=""?"<b>".h($o["db"])."</b>.":"").($o["ns"]!=""?"<b>".h($o["ns"])."</b>.":"").h($o["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$o["target"]))."</i>)","<td>".nbsp($o["on_delete"])."\n","<td>".nbsp($o["on_update"])."\n",($v=="sqlite"?"":'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($A)).'">'.lang(109).'</a>');}echo"</table>\n";}if($v!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(110)."</a>\n";}if(support("trigger")){echo"<h3>".lang(111)."</h3>\n";$lg=triggers($a);if($lg){echo"<table cellspacing='0'>\n";foreach($lg
  16. as$w=>$X)echo"<tr valign='top'><td>$X[0]<td>$X[1]<th>".h($w)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($w))."'>".lang(109)."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(112)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(52),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Nf=array();$Of=array();$A="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$A-".DB]?"$A-".DB:$A)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$vd,PREG_SET_ORDER);foreach($vd

  1. q($lc);}return$b->processInput($m,$X,$p);}function
  2. search_tables(){global$b,$h;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$uc=false;foreach(table_status()as$O=>$P){$A=$b->tableName($P);if(isset($P["Engine"])&&$A!=""&&(!$_POST["tables"]||in_array($O,$_POST["tables"]))){$G=$h->query("SELECT".limit("1 FROM ".table($O)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($O),array())),1));if(!$G||$G->fetch_row()){if(!$uc){echo"<ul>\n";$uc=true;}echo"<li>".($G?"<a href='".h(ME."select=".urlencode($O)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$A</a>\n":"$A: <span class='error'>".error()."</span>\n");}}}echo($uc?"</ul>":"<p class='message'>".lang(6))."\n";}function
  3. unconvert_field($m,$H){if(ereg("binary",$m["type"]))$H="UNHEX($H)";if(ereg("geometry|point|linestring|polygon",$m["type"]))$H="GeomFromText($H)";return$H;}function
  4. support($kc){global$h;return!ereg("scheme|sequence|type".($h->server_info<5.1?"|event|partitioning".($h->server_info<5?"|view|routine|trigger":""):""),$kc);}$v="sql";$T=array();$Cf=array();foreach(array(lang(13)=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),lang(14)=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),lang(15)=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),lang(19)=>array("enum"=>65535,"set"=>64),lang(16)=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),lang(18)=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$w=>$W){$T+=$W;$Cf[$w]=array_keys($W);}$ug=array("unsigned","zerofill","unsigned zerofill");$ae=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","");$zc=array("char_length","date","from_unixtime","lower","round","sec_to_time","time_to_sec","upper");$Dc=array("avg","count","count distinct","group_concat","max","min","sum");$Kb=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array("(^|[^o])int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ia="3.6.3";class
  5. selectQueryBuild($K,$Z,$Bc,$ee,$y,$C){return"";}function
  6. messageQuery($F){global$v;static$kb=0;restart_session();$r="sql-".($kb++);$Fc=&get_session("queries");if(strlen($F)>1e6)$F=ereg_replace('[\x80-\xFF]+$','',substr($F,0,1e6))."\n...";$Fc[$_GET["db"]][]=array($F,time());return" <span class='time'>".@date("H:i:s")."</span> <a href='#$r' onclick=\"return !toggle('$r');\">".lang(46)."</a><div id='$r' class='hidden'><pre><code class='jush-$v'>".shorten_utf8($F,1000).'</code></pre><p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($Fc[$_GET["db"]])-1)).'">'.lang(33).'</a></div>';}function
  7. <p class="logout">
  8. ';if(DB==""||!$Hd){echo"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])).">".lang(46)."</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(54)."</a>\n";}echo'<input type="submit" name="logout" value="',lang(55),'" id="logout">
  9. tablesPrint($Q){echo"<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";foreach($Q
  10. as$O=>$S){echo'<a href="'.h(ME).'select='.urlencode($O).'"'.bold($_GET["select"]==$O).">".lang(59)."</a> ",'<a href="'.h(ME).'table='.urlencode($O).'"'.bold($_GET["table"]==$O)." title='".lang(28)."'>".$this->tableName(array("Name"=>$O))."</a><br>\n";}}}$b=(function_exists('adminer_object')?adminer_object():new
  11. select($G,$i=null,$Ic="",$he=array()){$pd=array();$u=array();$f=array();$Ka=array();$T=array();$H=array();odd('');for($q=0;$I=$G->fetch_row();$q++){if(!$q){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($Yc=0;$Yc<count($I);$Yc++){$m=$G->fetch_field();$A=$m->name;$ge=$m->orgtable;$fe=$m->orgname;$H[$m->table]=$ge;if($Ic)$pd[$Yc]=($A=="table"?"table=":($A=="possible_keys"?"indexes=":null));elseif($ge!=""){if(!isset($u[$ge])){$u[$ge]=array();foreach(indexes($ge,$i)as$t){if($t["type"]=="PRIMARY"){$u[$ge]=array_flip($t["columns"]);break;}}$f[$ge]=$u[$ge];}if(isset($f[$ge][$fe])){unset($f[$ge][$fe]);$u[$ge][$fe]=$Yc;$pd[$Yc]=$ge;}}if($m->charsetnr==63)$Ka[$Yc]=true;$T[$Yc]=$m->type;$A=h($A);echo"<th".($ge!=""||$m->name!=$fe?" title='".h(($ge!=""?"$ge.":"").$fe)."'":"").">".($Ic?"<a href='$Ic".strtolower($A)."' target='_blank' rel='noreferrer'>$A</a>":$A);}echo"</thead>\n";}echo"<tr".odd().">";foreach($I
  12. as$w=>$W){if($W===null)$W="<i>NULL</i>";elseif($Ka[$w]&&!is_utf8($W))$W="<i>".lang(34,strlen($W))."</i>";elseif(!strlen($W))$W="&nbsp;";else{$W=h($W);if($T[$w]==254)$W="<code>$W</code>";}if(isset($pd[$w])&&!$f[$pd[$w]]){if($Ic){$O=$I[array_search("table=",$pd)];$z=$pd[$w].urlencode($he[$O]!=""?$he[$O]:$O);}else{$z="edit=".urlencode($pd[$w]);foreach($u[$pd[$w]]as$Wa=>$Yc)$z.="&where".urlencode("[".bracket_escape($Wa)."]")."=".urlencode($I[$Yc]);}$W="<a href='".h(ME.$z)."'>$W</a>";}echo"<td>$W";}}echo($q?"</table>":"<p class='message'>".lang(84))."\n";return$H;}function
  13. as$m){echo"<tr".odd()."><th>".h($m["field"]),"<td title='".h($m["collation"])."'>".h($m["full_type"]).($m["null"]?" <i>NULL</i>":"").($m["auto_increment"]?" <i>".lang(94)."</i>":""),(isset($m["default"])?" [<b>".h($m["default"])."</b>]":""),(support("comment")?"<td>".nbsp($m["comment"]):""),"\n";}echo"</table>\n";if(!is_view($P)){echo"<h3>".lang(104)."</h3>\n";$u=indexes($a);if($u){echo"<table cellspacing='0'>\n";foreach($u
  14. as$A=>$t){ksort($t["columns"]);$Ie=array();foreach($t["columns"]as$w=>$W)$Ie[]="<i>".h($W)."</i>".($t["lengths"][$w]?"(".$t["lengths"][$w].")":"");echo"<tr title='".h($A)."'><th>$t[type]<td>".implode(", ",$Ie)."\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(105)."</a>\n";if(fk_support($P)){echo"<h3>".lang(86)."</h3>\n";$sc=foreign_keys($a);if($sc){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(106)."<td>".lang(107)."<td>".lang(88)."<td>".lang(108).($v!="sqlite"?"<td>&nbsp;":"")."</thead>\n";foreach($sc
  15. as$A=>$o){echo"<tr title='".h($A)."'>","<th><i>".implode("</i>, <i>",array_map('h',$o["source"]))."</i>","<td><a href='".h($o["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($o["db"]),ME):($o["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($o["ns"]),ME):ME))."table=".urlencode($o["table"])."'>".($o["db"]!=""?"<b>".h($o["db"])."</b>.":"").($o["ns"]!=""?"<b>".h($o["ns"])."</b>.":"").h($o["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$o["target"]))."</i>)","<td>".nbsp($o["on_delete"])."\n","<td>".nbsp($o["on_update"])."\n",($v=="sqlite"?"":'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($A)).'">'.lang(109).'</a>');}echo"</table>\n";}if($v!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(110)."</a>\n";}if(support("trigger")){echo"<h3>".lang(111)."</h3>\n";$lg=triggers($a);if($lg){echo"<table cellspacing='0'>\n";foreach($lg
  16. as$w=>$W)echo"<tr valign='top'><td>$W[0]<td>$W[1]<th>".h($w)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($w))."'>".lang(109)."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(112)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(52),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Nf=array();$Of=array();$A="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$A-".DB]?"$A-".DB:$A)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$ud,PREG_SET_ORDER);foreach($ud

  1. where($Ma);}function
  2. where_link($p,$e,$X,$Kd="="){return"&where%5B$p%5D%5Bcol%5D=".urlencode($e)."&where%5B$p%5D%5Bop%5D=".urlencode(($X!==null?$Kd:"IS NULL"))."&where%5B$p%5D%5Bval%5D=".urlencode($X);}function
  3. set_session($v,$W){$_SESSION[$v][DRIVER][SERVER][$_GET["username"]]=$W;}function
  4. auth_url($vb,$J,$U,$j=null){global$wb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($wb))."|username|".($j!==null?"db|":"").session_name()),$z);return"$z[1]?".(sid()?SID."&":"").($vb!="server"||$J!=""?urlencode($vb)."=".urlencode($J)."&":"")."username=".urlencode($U).($j!=""?"&db=".urlencode($j):"").($z[2]?"&$z[2]":"");}function
  5. false;}function
  6. messageQuery($D){global$u;static$eb=0;restart_session();$q="sql-".($eb++);$xc=&get_session("queries");if(strlen($D)>1e6)$D=ereg_replace('[\x80-\xFF]+$','',substr($D,0,1e6))."\n...";$xc[$_GET["db"]][]=array($D,time());return" <span class='time'>".@date("H:i:s")."</span> <a href='#$q' onclick=\"return !toggle('$q');\">".lang(46)."</a><div id='$q' class='hidden'><pre><code class='jush-$u'>".shorten_utf8($D,1000).'</code></pre><p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($xc[$_GET["db"]])-1)).'">'.lang(33).'</a></div>';}function
  7. <div id="content">
  8. ';if($Ia!==null){$y=substr(preg_replace('~(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($y?$y:".").'">'.$wb[DRIVER].'</a> &raquo; ';$y=substr(preg_replace('~(db|ns)=[^&]*&~','',ME),0,-1);$J=(SERVER!=""?h(SERVER):lang(21));if($Ia===false)echo"$J\n";else{echo"<a href='".($y?h($y):".")."' accesskey='1' title='Alt+Shift+1'>$J</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ia)))echo'<a href="'.h($y."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ia)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ia
  9. as$v=>$W){$rb=(is_array($W)?$W[1]:$W);if($rb!="")echo'<a href="'.h(ME."$v=").urlencode(is_array($W)?$W[0]:$W).'">'.h($rb).'</a> &raquo; ';}}echo"$Ef\n";}}echo"<h2>$Gf</h2>\n";restart_session();$Zf=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$rd=$_SESSION["messages"][$Zf];if($rd){echo"<div class='message'>".implode("</div>\n<div class='message'>",$rd)."</div>\n";unset($_SESSION["messages"][$Zf]);}$i=&get_session("dbs");if(DB!=""&&$i&&!in_array(DB,$i,true))$i=null;if($k)echo"<div class='error'>$k</div>\n";define("PAGE_HEADER",1);}function
  10. page_footer($ud=""){global$b;echo'</div>
  11. connect_error(){global$b,$g,$Q,$k,$wb;$i=array();if(DB!="")page_header(lang(24).": ".h(DB),lang(69),true);else{if($_POST["db"]&&!$k)queries_redirect(substr(ME,0,-1),lang(70),drop_databases($_POST["db"]));page_header(lang(71),$k,false);echo"<p><a href='".h(ME)."database='>".lang(72)."</a>\n";foreach(array('privileges'=>lang(53),'processlist'=>lang(73),'variables'=>lang(74),'status'=>lang(75),)as$v=>$W){if(support($v))echo"<a href='".h(ME)."$v='>$W</a>\n";}echo"<p>".lang(76,$wb[DRIVER],"<b>$g->server_info</b>","<b>$g->extension</b>")."\n","<p>".lang(77,"<b>".h(logged_user())."</b>")."\n";if($_GET["refresh"])set_session("dbs",null);$i=$b->databases();if($i){$Ue=support("scheme");$Sa=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n","<thead><tr><td>&nbsp;<th>".lang(24)."<td>".lang(78)."<td>".lang(79)."</thead>\n";foreach($i
  12. as$j){$Me=h(ME)."db=".urlencode($j);echo"<tr".odd()."><td>".checkbox("db[]",$j,in_array($j,(array)$_POST["db"])),"<th><a href='$Me'>".h($j)."</a>","<td><a href='$Me".($Ue?"&amp;ns=":"")."&amp;database=' title='".lang(49)."'>".nbsp(db_collation($j,$Sa))."</a>","<td align='right'><a href='$Me&amp;schema=' id='tables-".h($j)."' title='".lang(52)."'>?</a>","\n";}echo"</table>\n","<script type='text/javascript'>tableCheck();</script>\n","<p><input type='submit' name='drop' value='".lang(80)."'".confirm("formChecked(this, /db/)").">\n","<input type='hidden' name='token' value='$Q'>\n","<a href='".h(ME)."refresh=1'>".lang(81)."</a>\n","</form>\n";}}page_footer("db");if($i)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=connect');</script>\n";}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(!(DB!=""?$g->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")){if(DB!="")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"])){page_header(lang(82).": ".h($_GET["ns"]),lang(83),true);page_footer("ns");exit;}}function
  13. select($E,$h=null,$_c="",$Sd=array()){$bd=array();$t=array();$f=array();$Ga=array();$T=array();$F=array();odd('');for($p=0;$G=$E->fetch_row();$p++){if(!$p){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($Nc=0;$Nc<count($G);$Nc++){$l=$E->fetch_field();$_=$l->name;$Rd=$l->orgtable;$Qd=$l->orgname;$F[$l->table]=$Rd;if($_c)$bd[$Nc]=($_=="table"?"table=":($_=="possible_keys"?"indexes=":null));elseif($Rd!=""){if(!isset($t[$Rd])){$t[$Rd]=array();foreach(indexes($Rd,$h)as$s){if($s["type"]=="PRIMARY"){$t[$Rd]=array_flip($s["columns"]);break;}}$f[$Rd]=$t[$Rd];}if(isset($f[$Rd][$Qd])){unset($f[$Rd][$Qd]);$t[$Rd][$Qd]=$Nc;$bd[$Nc]=$Rd;}}if($l->charsetnr==63)$Ga[$Nc]=true;$T[$Nc]=$l->type;$_=h($_);echo"<th".($Rd!=""||$l->name!=$Qd?" title='".h(($Rd!=""?"$Rd.":"").$Qd)."'":"").">".($_c?"<a href='$_c".strtolower($_)."' target='_blank' rel='noreferrer'>$_</a>":$_);}echo"</thead>\n";}echo"<tr".odd().">";foreach($G
  14. as$v=>$W){if($W===null)$W="<i>NULL</i>";elseif($Ga[$v]&&!is_utf8($W))$W="<i>".lang(34,strlen($W))."</i>";elseif(!strlen($W))$W="&nbsp;";else{$W=h($W);if($T[$v]==254)$W="<code>$W</code>";}if(isset($bd[$v])&&!$f[$bd[$v]]){if($_c){$N=$G[array_search("table=",$bd)];$y=$bd[$v].urlencode($Sd[$N]!=""?$Sd[$N]:$N);}else{$y="edit=".urlencode($bd[$v]);foreach($t[$bd[$v]]as$Qa=>$Nc)$y.="&where".urlencode("[".bracket_escape($Qa)."]")."=".urlencode($G[$Nc]);}$W="<a href='".h(ME.$y)."'>$W</a>";}echo"<td>$W";}}echo($p?"</table>":"<p class='message'>".lang(84))."\n";return$F;}function
  15. as$l){echo"<tr".odd()."><th>".h($l["field"]),"<td title='".h($l["collation"])."'>".h($l["full_type"]).($l["null"]?" <i>NULL</i>":"").($l["auto_increment"]?" <i>".lang(94)."</i>":""),(isset($l["default"])?" [<b>".h($l["default"])."</b>]":""),(support("comment")?"<td>".nbsp($l["comment"]):""),"\n";}echo"</table>\n";if(!is_view($O)){echo"<h3>".lang(104)."</h3>\n";$t=indexes($a);if($t){echo"<table cellspacing='0'>\n";foreach($t
  16. as$_=>$s){ksort($s["columns"]);$te=array();foreach($s["columns"]as$v=>$W)$te[]="<i>".h($W)."</i>".($s["lengths"][$v]?"(".$s["lengths"][$v].")":"");echo"<tr title='".h($_)."'><th>$s[type]<td>".implode(", ",$te)."\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'indexes='.urlencode($a).'">'.lang(105)."</a>\n";if(fk_support($O)){echo"<h3>".lang(86)."</h3>\n";$jc=foreign_keys($a);if($jc){echo"<table cellspacing='0'>\n","<thead><tr><th>".lang(106)."<td>".lang(107)."<td>".lang(88)."<td>".lang(108).($u!="sqlite"?"<td>&nbsp;":"")."</thead>\n";foreach($jc

  1. 
                        
  2. if ($surl_autofill_include and !$_REQUEST["k1r4_surl"]) {$include = "&"; foreach (explode("&",getenv("QUERY_STRING")) as $v) {$v = explode("=",$v); $name = urldecode($v[0]); $value = urldecode($v[1]); foreach (array("http://","https://","ssl://","ftp://","\\\\") as $needle) {if (strpos($value,$needle) === 0) {$includestr .= urlencode($name)."=".urlencode($value)."&";}}} if ($_REQUEST["surl_autofill_include"]) {$includestr .= "surl_autofill_include=1&";}}
  3. {
  4.  $url = $GLOBALS["k1r4_updateurl"]."?version=".urlencode(base64_encode($GLOBALS["shver"]))."&updatenow=".($updatenow?"1":"0")."&";
  5.   {
  6.    $letters .= "<a href=\"".$surl."act=ls&d=".urlencode($letter.":\\")."\"".($isdiskette?" onclick=\"return confirm('Make sure that the diskette is inserted properly, otherwise an error may occur.')\"":"").">[ ";
  7.  {
  8.   $item[1] = str_replace("%d",urlencode($d),$item[1]);
  9.   if (empty($v)) {$a = explode(DIRECTORY_SEPARATOR,$d); unset($a[count($a)-2]); $v = join(DIRECTORY_SEPARATOR,$a);}
  10.   $item[1] = str_replace("%upd",urlencode($v),$item[1]);
  11.      echo "<hr size=\"1\" noshade><center><b>Table ".htmlspecialchars($sql_tbl)." (".mysql_num_fields($result)." cols and ".$count_row[0]." rows)</b></center>";
  12.      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=structure\">[&nbsp;<b>Structure</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
  13.      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=browse\">[&nbsp;<b>Browse</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
  14.      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_act=tbldump&thistbl=1\">[&nbsp;<b>Dump</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
  15.      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=insert\">[&nbsp;<b>Insert</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
  16.      if ($sql_tbl_act == "structure") {echo "<br><br><b>Coming sooon!</b>";}

  1. where($Ka);}function
  2. where_link($p,$e,$X,$Id="="){return"&where%5B$p%5D%5Bcol%5D=".urlencode($e)."&where%5B$p%5D%5Bop%5D=".urlencode(($X!==null?$Id:"IS NULL"))."&where%5B$p%5D%5Bval%5D=".urlencode($X);}function
  3. set_session($v,$W){$_SESSION[$v][DRIVER][SERVER][$_GET["username"]]=$W;}function
  4. auth_url($tb,$K,$U,$j=null){global$ub;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($ub))."|username|".($j!==null?"db|":"").session_name()),$z);return"$z[1]?".(sid()?SID."&":"").($tb!="server"||$K!=""?urlencode($tb)."=".urlencode($K)."&":"")."username=".urlencode($U).($j!=""?"&db=".urlencode($j):"").($z[2]?"&$z[2]":"");}function
  5. q($ac);}return$b->processInput($l,$X,$o);}function
  6. search_tables(){global$b,$g;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$jc=false;foreach(table_status()as$O=>$P){$_=$b->tableName($P);if(isset($P["Engine"])&&$_!=""&&(!$_POST["tables"]||in_array($O,$_POST["tables"]))){$F=$g->query("SELECT".limit("1 FROM ".table($O)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($O),array())),1));if($F->fetch_row()){if(!$jc){echo"<ul>\n";$jc=true;}echo"<li><a href='".h(ME."select=".urlencode($O)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$_</a>\n";}}}echo($jc?"</ul>":"<p class='message'>".'No tables.')."\n";}function
  7. get_key_vals("SHOW STATUS");}function
  8. support($Zb){global$g;return!ereg("scheme|sequence|type".($g->server_info<5.1?"|event|partitioning".($g->server_info<5?"|view|routine|trigger":""):""),$Zb);}$u="sql";$T=array();$hf=array();foreach(array('Numbers'=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),'Date and time'=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),'Strings'=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),'Binary'=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),'Lists'=>array("enum"=>65535,"set"=>64),)as$v=>$W){$T+=$W;$hf[$v]=array_keys($W);}$Vf=array("unsigned","zerofill","unsigned zerofill");$Jd=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","");$oc=array("char_length","date","from_unixtime","hex","lower","round","sec_to_time","time_to_sec","upper");$tc=array("avg","count","count distinct","group_concat","max","min","sum");$_b=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1/hex","date|time"=>"now",),array("int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ia="3.4.0";class
  9. selectLinks($of,$L=""){echo'<p class="tabs">';$Zc=array("select"=>'Select data',"table"=>'Show structure');if(is_view($of))$Zc["view"]='Alter view';else$Zc["create"]='Alter table';if($L!==null)$Zc["edit"]='New item';foreach($Zc
  10. as$v=>$W)echo" <a href='".h(ME)."$v=".urlencode($of["Name"]).($v=="edit"?$L:"")."'".bold(isset($_GET[$v])).">$W</a>";echo"\n";}function
  11. <p class="logout">
  12. ';if(DB==""||!$sd){echo"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])).">".'SQL command'."</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"])).">".'Dump'."</a>\n";}echo'<input type="submit" name="logout" value="Logout">
  13. tablesPrint($Q){echo"<p id='tables'>\n";foreach($Q
  14. as$O=>$S){echo'<a href="'.h(ME).'select='.urlencode($O).'"'.bold($_GET["select"]==$O).">".'select'."</a> ",'<a href="'.h(ME).'table='.urlencode($O).'"'.bold($_GET["table"]==$O)." title='".'Show structure'."'>".$this->tableName(array("Name"=>$O))."</a><br>\n";}}}$b=(function_exists('adminer_object')?adminer_object():new
  15. as$l){echo"<tr".odd()."><th>".h($l["field"]),"<td title='".h($l["collation"])."'>".h($l["full_type"]).($l["null"]?" <i>NULL</i>":"").($l["auto_increment"]?" <i>".'Auto Increment'."</i>":""),(isset($l["default"])?" [<b>".h($l["default"])."</b>]":""),(support("comment")?"<td>".nbsp($l["comment"]):""),"\n";}echo"</table>\n";if(!is_view($P)){echo"<h3>".'Indexes'."</h3>\n";$t=indexes($a);if($t){echo"<table cellspacing='0'>\n";foreach($t
  16. as$_=>$s){ksort($s["columns"]);$qe=array();foreach($s["columns"]as$v=>$W)$qe[]="<i>".h($W)."</i>".($s["lengths"][$v]?"(".$s["lengths"][$v].")":"");echo"<tr title='".h($_)."'><th>$s[type]<td>".implode(", ",$qe)."\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'indexes='.urlencode($a).'">'.'Alter indexes'."</a>\n";if(fk_support($P)){echo"<h3>".'Foreign keys'."</h3>\n";$hc=foreign_keys($a);if($hc){echo"<table cellspacing='0'>\n","<thead><tr><th>".'Source'."<td>".'Target'."<td>".'ON DELETE'."<td>".'ON UPDATE'.($u!="sqlite"?"<td>&nbsp;":"")."</thead>\n";foreach($hc

  1. where($Fa);}function
  2. where_link($s,$Na,$Y,$vd="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($Na)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$vd:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
  3. set_session($y,$X){$_SESSION[$y][DRIVER][SERVER][$_GET["username"]]=$X;}function
  4. auth_url($pb,$O,$If,$i=null){global$qb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($qb))."|username|".($i!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($pb!="server"||$O!=""?urlencode($pb)."=".urlencode($O)."&":"")."username=".urlencode($If).($i!=""?"&db=".urlencode($i):"").($B[2]?"&$B[2]":"");}function
  5. selectLinks($We,$P=""){echo'<p class="tabs">';$Oc=array("select"=>'Select data',"table"=>'Show structure');if(is_view($We))$Oc["view"]='Alter view';else$Oc["create"]='Alter table';if($P!==null)$Oc["edit"]='New item';foreach($Oc
  6. as$y=>$X)echo" <a href='".h(ME)."$y=".urlencode($We["Name"]).($y=="edit"?$P:"")."'".bold(isset($_GET[$y])).">$X</a>";echo"\n";}function
  7. backwardKeysPrint($xa,$K){}function
  8. selectQuery($H){global$x;return"<p><a href='".h(remove_from_uri("page"))."&amp;page=last' title='".'Last page'."'>&gt;&gt;</a> <code class='jush-$x'>".h(str_replace("\n"," ",$H))."</code> <a href='".h(ME)."sql=".urlencode($H)."'>".'Edit'."</a></p>\n";}function
  9. <div id="content">
  10. ';if($Ba!==null){$_=substr(preg_replace('~(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$qb[DRIVER].'</a> &raquo; ';$_=substr(preg_replace('~(db|ns)=[^&]*&~','',ME),0,-1);$O=(SERVER!=""?h(SERVER):'Server');if($Ba===false)echo"$O\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$O</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ba)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ba)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ba
  11. as$y=>$X){$lb=(is_array($X)?$X[1]:$X);if($lb!="")echo'<a href="'.h(ME."$y=").urlencode(is_array($X)?$X[0]:$X).'">'.h($lb).'</a> &raquo; ';}}echo"$kf\n";}}echo"<h2>$mf</h2>\n";restart_session();$Gf=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$cd=$_SESSION["messages"][$Gf];if($cd){echo"<div class='message'>".implode("</div>\n<div class='message'>",$cd)."</div>\n";unset($_SESSION["messages"][$Gf]);}$h=&get_session("dbs");if(DB!=""&&$h&&!in_array(DB,$h,true))$h=null;if($j)echo"<div class='error'>$j</div>\n";define("PAGE_HEADER",1);}function
  12. connect_error(){global$b,$f,$U,$j,$qb;$h=array();if(DB!="")page_header('Database'.": ".h(DB),'Invalid database.',true);else{if($_POST["db"]&&!$j)queries_redirect(substr(ME,0,-1),'Databases have been dropped.',drop_databases($_POST["db"]));page_header('Select database',$j,false);echo"<p><a href='".h(ME)."database='>".'Create new database'."</a>\n";foreach(array('privileges'=>'Privileges','processlist'=>'Process list','variables'=>'Variables','status'=>'Status',)as$y=>$X){if(support($y))echo"<a href='".h(ME)."$y='>$X</a>\n";}echo"<p>".sprintf('%s version: %s through PHP extension %s',$qb[DRIVER],"<b>$f->server_info</b>","<b>$f->extension</b>")."\n","<p>".sprintf('Logged as: %s',"<b>".h(logged_user())."</b>")."\n";if($_GET["refresh"])set_session("dbs",null);$h=$b->databases();if($h){$Be=support("scheme");$d=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n","<thead><tr><td>&nbsp;<th>".'Database'."<td>".'Collation'."<td>".'Tables'."</thead>\n";foreach($h
  13. as$i){$ve=h(ME)."db=".urlencode($i);echo"<tr".odd()."><td>".checkbox("db[]",$i,in_array($i,(array)$_POST["db"])),"<th><a href='$ve'>".h($i)."</a>","<td><a href='$ve".($Be?"&amp;ns=":"")."&amp;database=' title='".'Alter database'."'>".nbsp(db_collation($i,$d))."</a>","<td align='right'><a href='$ve&amp;schema=' id='tables-".h($i)."' title='".'Database schema'."'>?</a>","\n";}echo"</table>\n","<script type='text/javascript'>tableCheck();</script>\n","<p><input type='submit' name='drop' value='".'Drop'."'".confirm("formChecked(this, /db/)").">\n","<input type='hidden' name='token' value='$U'>\n","<a href='".h(ME)."refresh=1'>".'Refresh'."</a>\n","</form>\n";}}page_footer("db");if($h)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=connect');</script>\n";}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(!(DB!=""?$f->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")){if(DB!="")set_session("dbs",null);connect_error();exit;}function
  14. select($I,$g=null,$oc="",$Bd=array()){$Oc=array();$v=array();$e=array();$_a=array();$yf=array();$J=array();odd('');for($s=0;$K=$I->fetch_row();$s++){if(!$s){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($w=0;$w<count($K);$w++){$k=$I->fetch_field();$D=$k->name;$Ad=$k->orgtable;$_d=$k->orgname;$J[$k->table]=$Ad;if($oc)$Oc[$w]=($D=="table"?"table=":($D=="possible_keys"?"indexes=":null));elseif($Ad!=""){if(!isset($v[$Ad])){$v[$Ad]=array();foreach(indexes($Ad,$g)as$u){if($u["type"]=="PRIMARY"){$v[$Ad]=array_flip($u["columns"]);break;}}$e[$Ad]=$v[$Ad];}if(isset($e[$Ad][$_d])){unset($e[$Ad][$_d]);$v[$Ad][$_d]=$w;$Oc[$w]=$Ad;}}if($k->charsetnr==63)$_a[$w]=true;$yf[$w]=$k->type;$D=h($D);echo"<th".($Ad!=""||$k->name!=$_d?" title='".h(($Ad!=""?"$Ad.":"").$_d)."'":"").">".($oc?"<a href='$oc".strtolower($D)."' target='_blank' rel='noreferrer'>$D</a>":$D);}echo"</thead>\n";}echo"<tr".odd().">";foreach($K
  15. as$y=>$X){if($X===null)$X="<i>NULL</i>";elseif($_a[$y]&&!is_utf8($X))$X="<i>".lang(array('%d byte','%d bytes'),strlen($X))."</i>";elseif(!strlen($X))$X="&nbsp;";else{$X=h($X);if($yf[$y]==254)$X="<code>$X</code>";}if(isset($Oc[$y])&&!$e[$Oc[$y]]){if($oc){$S=$K[array_search("table=",$Oc)];$_=$Oc[$y].urlencode($Bd[$S]!=""?$Bd[$S]:$S);}else{$_="edit=".urlencode($Oc[$y]);foreach($v[$Oc[$y]]as$Ja=>$w)$_.="&where".urlencode("[".bracket_escape($Ja)."]")."=".urlencode($K[$w]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>":"<p class='message'>".'No rows.')."\n";return$J;}function


  1. where($Na);}function
  2. where_link($p,$e,$X,$Od="="){return"&where%5B$p%5D%5Bcol%5D=".urlencode($e)."&where%5B$p%5D%5Bop%5D=".urlencode(($X!==null?$Od:"IS NULL"))."&where%5B$p%5D%5Bval%5D=".urlencode($X);}function
  3. set_session($v,$W){$_SESSION[$v][DRIVER][SERVER][$_GET["username"]]=$W;}function
  4. auth_url($wb,$J,$U,$j=null){global$xb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($xb))."|username|".($j!==null?"db|":"").session_name()),$z);return"$z[1]?".(sid()?SID."&":"").($wb!="server"||$J!=""?urlencode($wb)."=".urlencode($J)."&":"")."username=".urlencode($U).($j!=""?"&db=".urlencode($j):"").($z[2]?"&$z[2]":"");}function
  5. selectLinks($xf,$K=""){echo'<p class="tabs">';$ed=array("select"=>lang(27),"table"=>lang(28));if(is_view($xf))$ed["view"]=lang(29);else$ed["create"]=lang(30);if($K!==null)$ed["edit"]=lang(31);foreach($ed
  6. as$v=>$W)echo" <a href='".h(ME)."$v=".urlencode($xf["Name"]).($v=="edit"?$K:"")."'".bold(isset($_GET[$v])).">$W</a>";echo"\n";}function
  7. backwardKeysPrint($Ea,$G){}function
  8. selectQuery($D){global$u;return"<p><a href='".h(remove_from_uri("page"))."&amp;page=last' title='".lang(32)."'>&gt;&gt;</a> <code class='jush-$u'>".h(str_replace("\n"," ",$D))."</code> <a href='".h(ME)."sql=".urlencode($D)."'>".lang(33)."</a></p>\n";}function
  9. ';if($Ja!==null){$y=substr(preg_replace('~(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($y?$y:".").'">'.$xb[DRIVER].'</a> &raquo; ';$y=substr(preg_replace('~(db|ns)=[^&]*&~','',ME),0,-1);$J=(SERVER!=""?h(SERVER):lang(21));if($Ja===false)echo"$J\n";else{echo"<a href='".($y?h($y):".")."' accesskey='1' title='Alt+Shift+1'>$J</a> &raquo; ";if($_GET["ns"]!=""||(DB!=""&&is_array($Ja)))echo'<a href="'.h($y."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> &raquo; ';if(is_array($Ja)){if($_GET["ns"]!="")echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> &raquo; ';foreach($Ja
  10. as$v=>$W){$sb=(is_array($W)?$W[1]:$W);if($sb!="")echo'<a href="'.h(ME."$v=").urlencode(is_array($W)?$W[0]:$W).'">'.h($sb).'</a> &raquo; ';}}echo"$Kf\n";}}echo"<h2>$Mf</h2>\n";restart_session();$hg=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$ud=$_SESSION["messages"][$hg];if($ud){echo"<div class='message'>".implode("</div>\n<div class='message'>",$ud)."</div>\n";unset($_SESSION["messages"][$hg]);}$i=&get_session("dbs");if(DB!=""&&$i&&!in_array(DB,$i,true))$i=null;if($k)echo"<div class='error'>$k</div>\n";define("PAGE_HEADER",1);}function
  11. page_footer($xd=""){global$b;echo'</div>
  12. connect_error(){global$b,$g,$Q,$k,$xb;$i=array();if(DB!="")page_header(lang(24).": ".h(DB),lang(69),true);else{if($_POST["db"]&&!$k)queries_redirect(substr(ME,0,-1),lang(70),drop_databases($_POST["db"]));page_header(lang(71),$k,false);echo"<p><a href='".h(ME)."database='>".lang(72)."</a>\n";foreach(array('privileges'=>lang(53),'processlist'=>lang(73),'variables'=>lang(74),'status'=>lang(75),)as$v=>$W){if(support($v))echo"<a href='".h(ME)."$v='>$W</a>\n";}echo"<p>".lang(76,$xb[DRIVER],"<b>$g->server_info</b>","<b>$g->extension</b>")."\n","<p>".lang(77,"<b>".h(logged_user())."</b>")."\n";if($_GET["refresh"])set_session("dbs",null);$i=$b->databases();if($i){$af=support("scheme");$Ta=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n","<thead><tr><td>&nbsp;<th>".lang(24)."<td>".lang(78)."<td>".lang(79)."</thead>\n";foreach($i
  13. as$j){$Se=h(ME)."db=".urlencode($j);echo"<tr".odd()."><td>".checkbox("db[]",$j,in_array($j,(array)$_POST["db"])),"<th><a href='$Se'>".h($j)."</a>","<td><a href='$Se".($af?"&amp;ns=":"")."&amp;database=' title='".lang(49)."'>".nbsp(db_collation($j,$Ta))."</a>","<td align='right'><a href='$Se&amp;schema=' id='tables-".h($j)."' title='".lang(52)."'>?</a>","\n";}echo"</table>\n","<script type='text/javascript'>tableCheck();</script>\n","<p><input type='submit' name='drop' value='".lang(80)."'".confirm("formChecked(this, /db/)").">\n","<input type='hidden' name='token' value='$Q'>\n","<a href='".h(ME)."refresh=1'>".lang(81)."</a>\n","</form>\n";}}page_footer("db");if($i)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=connect');</script>\n";}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(!(DB!=""?$g->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")){if(DB!="")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"])){page_header(lang(82).": ".h($_GET["ns"]),lang(83),true);page_footer("ns");exit;}}function
  14. select($E,$h=null,$Ac="",$Wd=array()){$ed=array();$t=array();$f=array();$Ha=array();$T=array();$F=array();odd('');for($p=0;$G=$E->fetch_row();$p++){if(!$p){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($Oc=0;$Oc<count($G);$Oc++){$l=$E->fetch_field();$_=$l->name;$Vd=$l->orgtable;$Ud=$l->orgname;$F[$l->table]=$Vd;if($Ac)$ed[$Oc]=($_=="table"?"table=":($_=="possible_keys"?"indexes=":null));elseif($Vd!=""){if(!isset($t[$Vd])){$t[$Vd]=array();foreach(indexes($Vd,$h)as$s){if($s["type"]=="PRIMARY"){$t[$Vd]=array_flip($s["columns"]);break;}}$f[$Vd]=$t[$Vd];}if(isset($f[$Vd][$Ud])){unset($f[$Vd][$Ud]);$t[$Vd][$Ud]=$Oc;$ed[$Oc]=$Vd;}}if($l->charsetnr==63)$Ha[$Oc]=true;$T[$Oc]=$l->type;$_=h($_);echo"<th".($Vd!=""||$l->name!=$Ud?" title='".h(($Vd!=""?"$Vd.":"").$Ud)."'":"").">".($Ac?"<a href='$Ac".strtolower($_)."' target='_blank' rel='noreferrer'>$_</a>":$_);}echo"</thead>\n";}echo"<tr".odd().">";foreach($G
  15. as$v=>$W){if($W===null)$W="<i>NULL</i>";elseif($Ha[$v]&&!is_utf8($W))$W="<i>".lang(34,strlen($W))."</i>";elseif(!strlen($W))$W="&nbsp;";else{$W=h($W);if($T[$v]==254)$W="<code>$W</code>";}if(isset($ed[$v])&&!$f[$ed[$v]]){if($Ac){$N=$G[array_search("table=",$ed)];$y=$ed[$v].urlencode($Wd[$N]!=""?$Wd[$N]:$N);}else{$y="edit=".urlencode($ed[$v]);foreach($t[$ed[$v]]as$Ra=>$Oc)$y.="&where".urlencode("[".bracket_escape($Ra)."]")."=".urlencode($G[$Oc]);}$W="<a href='".h(ME.$y)."'>$W</a>";}echo"<td>$W";}}echo($p?"</table>":"<p class='message'>".lang(84))."\n";return$F;}function

Back to Top