About 25,972 results: "php preg_match_all"
Page 8 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On




  1. 		$this->timer_start();
  2. 		preg_match_all("'<channel( .*?)?>(.*?)<title>(.*?)</title>(.+?)</channel>'si",$content,$rss_title);
  3. 		preg_match_all("'<channel( .*?)?>(.*?)<link>(.*?)</link>(.+?)</channel>'si",$content,$rss_link);
  4. 		preg_match_all("'<channel( .*?)?>(.*?)<description>(.*?)</description>(.*?)</channel>'si",$content,$rss_description);
  5. 		preg_match_all("'<channel( .*?)?>(.*?)<lastBuildDate>(.*?)</lastBuildDate>(.*?)</channel>'si",$content,$rss_lastBuildDate);
  6. 		preg_match_all("'<channel( .*?)?>(.*?)<docs>(.*?)</docs>(.*?)</channel>'si",$content,$rss_docs);
  7. 		preg_match_all("'<channel( .*?)?>(.*?)<managingEditor>(.*?)</managingEditor>(.*?)</channel>'si",$content,$rss_managingEditor);
  8. 		preg_match_all("'<channel( .*?)?>(.*?)<webMaster>(.*?)</webMaster>(.*?)</channel>'si",$content,$rss_webMaster);
  9. 		preg_match_all("'<channel( .*?)?>(.*?)<language>(.*?)</language>(.*?)</channel>'si",$content,$rss_language);
  10. 		preg_match_all("'<image>(.*?)<title>(.*?)</title>(.*?)</image>'si",$content,$rss_image_title);
  11. 		preg_match_all("'<image>(.*?)<url>(.*?)</url>(.*?)</image>'si",$content,$rss_image_url);
  12. 		preg_match_all("'<image>(.*?)<link>(.*?)</link>(.*?)</image>'si",$content,$rss_image_link);
  13. 		preg_match_all("'<item( .*?)?>(.*?)<title>(<!\[CDATA\[)?(.+?)(\]\]>)?</title>(.*?)</item>'si",$content,$rss_item_titles);
  14. 		preg_match_all("'<item( .*?)?>(.*?)<link>(<!\[CDATA\[)?(.+?.*?)(\]\]>)?</link>(.*?)</item>'si",$content,$rss_item_links);
  15. 		preg_match_all("'<item( .*?)?>(.*?)<description>(.*?)</description>(.*?)</item>'si",$content,$rss_item_descriptions);




  1. column_foreign_keys($h){global$o;$c=array();foreach($o->foreignKeys($h)as$A){foreach($A["source"]as$b){$c[$b][]=$A;}}return$c;}function
  2. enum_input($z,$Ra,$e,$q,$hc=null){global$o;preg_match_all("~'((?:[^']|'')*)'~",$e["length"],$oa);$c=(isset($hc)?"<label><input type='$z'$Ra value='$hc'".((is_array($q)?in_array($hc,$q):$q===0)?" checked":"")."><i>".lang(4)."</i></label>":"");foreach($oa[1]as$l=>$b){$b=stripcslashes(str_replace("''","'",$b));$ab=(is_int($q)?$q==$l+1:(is_array($q)?in_array($l+1,$q):$q===$b));$c.=" <label><input type='$z'$Ra value='".($l+1)."'".($ab?' checked':'').'>'.h($o->editVal($b,$e)).'</label>';}return$c;}function
  3. nbsp($da[""])."<td>".$o->editInput($_GET["edit"],$e,$Ra,$q);}else{$Ba=0;foreach($da
  4. as$d=>$b){if($d===""||!$b){break;}$Ba++;}$Qb=($Ba?" onchange=\"var f = this.form['function[".js_escape($f)."]']; if ($Ba > f.selectedIndex) f.selectedIndex = $Ba;\"":"");$Ra.=$Qb;echo(count($da)>1?html_select("function[$f]",$da,!isset($K)||in_array($K,$da)||isset($da[$K])?$K:"","functionChange(this);"):nbsp(reset($da))).'<td>';$Ae=$o->editInput($_GET["edit"],$e,$Ra,$q);if($Ae!=""){echo$Ae;}elseif($e["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$e["length"],$oa);foreach($oa[1]as$l=>$b){$b=stripcslashes(str_replace("''","'",$b));$ab=(is_int($q)?($q>>$l)&1:in_array($b,explode(",",$q),true));echo" <label><input type='checkbox' name='fields[$f][$l]' value='".(1<<$l)."'".($ab?' checked':'')."$Qb>".h($o->editVal($b,$e)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$e["type"])&&ini_bool("file_uploads")){echo"<input type='file' name='fields-$f'$Qb>";}elseif(ereg('text|lob',$e["type"])){echo"<textarea ".($v!="sqlite"||ereg("\n",$q)?"cols='50' rows='12'":"cols='30' rows='1' style='height: 1.2em;'")."$Ra>".h($q).'</textarea>';}else{$nd=(!ereg('int',$e["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$e["length"],$k)?((ereg("binary",$e["type"])?2:1)*$k[1]+($k[3]?1:0)+($k[2]&&!$e["unsigned"]?1:0)):($R[$e["type"]]?$R[$e["type"]]+($e["unsigned"]?0:1):0));echo"<input value='".h($q)."'".($nd?" maxlength='$nd'":"").(ereg('char|binary',$e["type"])&&$nd>20?" size='40'":"")."$Ra>";}}}function
  5. switch_lang(){global$ua,$Lb;echo"<form action=''>\n<div id='lang'>";hidden_fields($_GET,array('lang'));echo
  6. lang(7).": ".html_select("lang",$Lb,$ua,"var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;")," <input type='submit' value='".lang(8)."' class='hidden'>\n","</div>\n</form>\n";}if(isset($_GET["lang"])){$_COOKIE["adminer_lang"]=$_GET["lang"];$_SESSION["lang"]=$_GET["lang"];}$ua="en";if(isset($Lb[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ua=$_COOKIE["adminer_lang"];}elseif(isset($Lb[$_SESSION["lang"]])){$ua=$_SESSION["lang"];}else{$cd=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$oa,PREG_SET_ORDER);foreach($oa
  7. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  8. routine($f,$z){global$g,$Gb,$jc,$R;$kf=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Ce="((".implode("|",array_merge(array_keys($R),$kf)).")(?:\\s*\\(((?:[^'\")]*|$Gb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ba="\\s*(".($z=="FUNCTION"?"":implode("|",$jc)).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ce";$la=$g->result("SHOW CREATE $z ".idf_escape($f),2);preg_match("~\\(((?:$ba\\s*,?)*)\\)".($z=="FUNCTION"?"\\s*RETURNS\\s+$Ce":"")."\\s*(.*)~is",$la,$k);$p=array();preg_match_all("~$ba\\s*,?~is",$k[1],$oa,PREG_SET_ORDER);foreach($oa
  9. <td><input name="',$d,'[length]" value="',h($e["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$d"."[collation]'".(ereg('(char|text|enum|set)$',$e["type"])?"":" class='hidden'").'><option value="">('.lang(85).')'.optionlist($Z,$e["collation"]).'</select>',($ob?"<select name='$d"."[unsigned]'".(!$e["type"]||ereg('(int|float|double|decimal)$',$e["type"])?"":" class='hidden'").'><option>'.optionlist($ob,$e["unsigned"]).'</select>':''),($ha?"<select name='$d"."[on_delete]'".(ereg("`",$e["type"])?"":" class='hidden'")."><option value=''>(".lang(86).")".optionlist($fb,$e["on_delete"])."</select> ":" ");}function
  10. process_length($W){global$Gb;return(preg_match("~^\\s*(?:$Gb)(?:\\s*,\\s*(?:$Gb))*\\s*\$~",$W)&&preg_match_all("~$Gb~",$W,$oa)?implode(",",$oa[0]):preg_replace('~[^0-9,+-]~','',$W));}function
  11. as$f=>$A){$w=($A["db"]!=""?"<b>".h($A["db"])."</b>.":"").h($A["table"]);echo"<tr>","<th><i>".implode("</i>, <i>",array_map('h',$A["source"]))."</i>","<td><a href='".h($A["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($A["db"]),ME):ME)."table=".urlencode($A["table"])."'>$w</a>","(<i>".implode("</i>, <i>",array_map('h',$A["target"]))."</i>)","<td>$A[on_delete]\n","<td>$A[on_update]\n";if($v!="sqlite"){echo'<td><a href="'.h(ME.'foreign='.urlencode($m).'&name='.urlencode($f)).'">'.lang(107).'</a>';}}echo"</table>\n";}if($v!="sqlite"){echo'<p><a href="'.h(ME).'foreign='.urlencode($m).'">'.lang(108)."</a>\n";}}if(support("trigger")){echo"<h3>".lang(109)."</h3>\n";$Mc=triggers($m);if($Mc){echo"<table cellspacing='0'>\n";foreach($Mc
  12. as$d=>$b){echo"<tr valign='top'><td>$b[0]<td>$b[1]<th>".h($d)."<td><a href='".h(ME.'trigger='.urlencode($m).'&name='.urlencode($d))."'>".lang(107)."</a>\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($m).'">'.lang(110)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(111),"",array(),DB);$sb=array();$ve=array();$f="adminer_schema";$hf=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$f-".DB]?"$f-".DB:$f)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$hf,$oa,PREG_SET_ORDER);foreach($oa
  13. </form>
  14. ';}elseif(isset($_GET["user"])){$Fd=$_GET["user"];$sa=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$a){foreach(explode(",",($a["Privilege"]=="Grant option"?"":$a["Context"]))as$Gc){$sa[$Gc][$a["Privilege"]]=$a["Comment"];}}$sa["Server Admin"]+=$sa["File access on server"];$sa["Databases"]["Create routine"]=$sa["Procedures"]["Create routine"];unset($sa["Procedures"]["Create routine"]);$sa["Columns"]=array();foreach(array("Select","Insert","Update","References")as$b){$sa["Columns"][$b]=$sa["Tables"][$b];}unset($sa["Server Admin"]["Usage"]);foreach($sa["Tables"]as$d=>$b){unset($sa["Databases"][$d]);}$nc=array();if($_POST){foreach($_POST["objects"]as$d=>$b){$nc[$b]=(array)$nc[$b]+(array)$_POST["grants"][$d];}}$nb=array();$Xc="";if(isset($_GET["host"])&&($i=$g->query("SHOW GRANTS FOR ".q($Fd)."@".q($_GET["host"])))){while($a=$i->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$a[0],$k)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$k[1],$oa,PREG_SET_ORDER)){foreach($oa
  15. as$f=>$b){$b=process_input($p[$f]);if($b!==null){if($_POST["clone"]){$r[idf_escape($f)]=($b!==false?$b:idf_escape($f));}elseif($b!==false){$r[]=idf_escape($f)." = $b";}}}$j.=($_POST["clone"]?" (".implode(", ",array_keys($r)).")\nSELECT ".implode(", ",$r)."\nFROM ".table($m):" SET\n".implode(",\n",$r));}if($_POST["delete"]||$r){$id="UPDATE";if($_POST["delete"]){$id="DELETE";$j="FROM $j";}if($_POST["clone"]){$id="INSERT";$j="INTO $j";}if($_POST["all"]||($ad===array()&&$_POST["check"])||count($pa)<count($Q)){$i=queries($id." $j".($_POST["all"]?($s?"\nWHERE ".implode(" AND ",$s):""):"\nWHERE $ne"));$wb=$g->affected_rows;}else{foreach((array)$_POST["check"]as$b){$i=queries($id.limit1($j,"\nWHERE ".where_check($b)));if(!$i){break;}$wb+=$g->affected_rows;}}}queries_redirect(remove_from_uri("page"),lang(225,$wb),$i);}elseif(!$_POST["import"]){if(!$_POST["val"]){$n=lang(226);}else{$i=true;$wb=0;foreach($_POST["val"]as$gb=>$a){$r=array();foreach($a
  16. as$d=>$b){$d=bracket_escape($d,1);$r[]=idf_escape($d)." = ".(ereg('char|text',$p[$d]["type"])||$b!=""?$o->processInput($p[$d],$b):"NULL");}$j=table($m)." SET ".implode(", ",$r);$bc=" WHERE ".where_check($gb).($s?" AND ".implode(" AND ",$s):"");$i=queries("UPDATE".(count($pa)<count($Q)?" $j$bc":limit1($j,$bc)));if(!$i){break;}$wb+=$g->affected_rows;}queries_redirect(remove_from_uri(),lang(225,$wb),$i);}}elseif(is_string($Ia=get_file("csv_file",true))){$i=true;$mb=array_keys($p);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$Ia,$oa);$wb=count($oa[0]);begin();$Wa=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($oa[0]as$d=>$b){preg_match_all("~((\"[^\"]*\")+|[^$Wa]*)$Wa~",$b.$Wa,$Gd);if(!$d&&!array_diff($Gd[1],$mb)){$mb=$Gd[1];$wb--;}else{$r=array();foreach($Gd[1]as$l=>$Pc){$r[idf_escape($mb[$l])]=($Pc==""&&$p[$mb[$l]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Pc))));}$i=insert_update($m,$r,$Qa);if(!$i){break;}}}if($i){queries("COMMIT");}queries_redirect(remove_from_uri("page"),lang(227,$wb),$i);queries("ROLLBACK");}else{$n=upload_error($Ia);}}}$Ea=$o->tableName($D);page_header(lang(33).": $Ea",$n);session_write_close();$r=null;if(isset($Td["insert"])){$r="";foreach((array)$_GET["where"]as$b){if(count($ha[$b["col"]])==1&&($b["op"]=="="||(!$b["op"]&&!ereg('[_%]',$b["val"])))){$r.="&set".urlencode("[".bracket_escape($b["col"])."]")."=".urlencode($b["val"]);}}}$o->selectLinks($D,$r);if(!$B){echo"<p class='error'>".lang(228).($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($m).'">',"</div>\n";$o->selectColumnsPrint($Q,$B);$o->selectSearchPrint($s,$B,$J);$o->selectOrderPrint($Xa,$B,$J);$o->selectLimitPrint($O);$o->selectLengthPrint($Db);$o->selectActionPrint($Db);echo"</form>\n";$ca=$_GET["page"];if($ca=="last"){$Ya=$g->result("SELECT COUNT(*) FROM ".table($m).($s?" WHERE ".implode(" AND ",$s):""));$ca=floor(max(0,$Ya-1)/$O);}$j="SELECT".limit((+$O&&$pa&&count($pa)<count($Q)&&$v=="sql"?"SQL_CALC_FOUND_ROWS ":"").$Yb,($s?"\nWHERE ".implode(" AND ",$s):"").$Ld,($O!=""?+$O:null),($ca?$O*$ca:0),"\n");echo$o->selectQuery($j);$i=$g->query($j);if(!$i){echo"<p class='error'>".error()."\n";}else{if($v=="mssql"){$i->seek($O*$ca);}$Hc=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$H=array();while($a=$i->fetch_assoc()){$H[]=$a;}if($_GET["page"]!="last"){$Ya=(+$O&&$pa&&count($pa)<count($Q)?($v=="sql"?$g->result(" SELECT FOUND_ROWS()"):$g->result("SELECT COUNT(*) FROM ($j) x")):count($H));}if(!$H){echo"<p class='message'>".lang(82)."\n";}else{$Bd=$o->backwardKeys($m,$Ea);echo"<table cellspacing='0' class='nowrap' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$pa&&$Q?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(119)."</a>");$Cd=array();$da=array();reset($Q);$ke=1;foreach($H[0]as$d=>$b){if($D["Oid"]!="t"||$d!="oid"){$b=$_GET["columns"][key($Q)];$e=$p[$Q?$b["col"]:$d];$f=($e?$o->fieldName($e,$ke):"*");if($f!=""){$ke++;$Cd[$d]=$f;$C=idf_escape($d);echo'<th><a href="'.h(remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($d).($Xa[0]==$C||$Xa[0]==$d||(!$Xa&&$pa[0]==$C)?'&desc%5B0%5D=1':'')).'">'.apply_sql_function($b["fun"],$f)."</a>";}$da[$d]=$b["fun"];next($Q);}}$ec=array();if($_GET["modify"]){foreach($H


  1. column_foreign_keys($P){global$b;$I=array();foreach($b->foreignKeys($P)as$p){foreach($p["source"]as$X)$I[$X][]=$p;}return$I;}function
  2. enum_input($T,$_a,$n,$Y,$Pb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$yd);$I=($Pb!==null?"<label><input type='$T'$_a value='$Pb'".((is_array($Y)?in_array($Pb,$Y):$Y===0)?" checked":"")."><i>".lang(5)."</i></label>":"");foreach($yd[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$Pa=(is_int($Y)?$Y==$r+1:(is_array($Y)?in_array($r+1,$Y):$Y===$X));$I.=" <label><input type='$T'$_a value='".($r+1)."'".($Pa?' checked':'').'>'.h($b->editVal($X,$n)).'</label>';}return$I;}function
  3. nbsp($Ac[""])."<td>".$b->editInput($_GET["edit"],$n,$_a,$Y);else{$pc=0;foreach($Ac
  4. as$x=>$X){if($x===""||!$X)break;$pc++;}$ee=($pc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($n["field"])))."]']; if ($pc > f.selectedIndex) f.selectedIndex = $pc;\"":"");$_a.=$ee;echo(count($Ac)>1?html_select("function[$B]",$Ac,$q===null||in_array($q,$Ac)||isset($Ac[$q])?$q:"","functionChange(this);"):nbsp(reset($Ac))).'<td>';$Uc=$b->editInput($_GET["edit"],$n,$_a,$Y);if($Uc!="")echo$Uc;elseif($n["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$yd);foreach($yd[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$Pa=(is_int($Y)?($Y>>$r)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$B][$r]' value='".(1<<$r)."'".($Pa?' checked':'')."$ee>".h($b->editVal($X,$n)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$n["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$B'$ee>";elseif(($eg=ereg('text|lob',$n["type"]))||ereg("\n",$Y)){if($eg&&$w!="sqlite")$_a.=" cols='50' rows='12'";else{$K=min(12,substr_count($Y,"\n")+1);$_a.=" cols='30' rows='$K'".($K==1?" style='height: 1.2em;'":"");}echo"<textarea$_a>".h($Y).'</textarea>';}else{$Ed=(!ereg('int',$n["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$n["length"],$A)?((ereg("binary",$n["type"])?2:1)*$A[1]+($A[3]?1:0)+($A[2]&&!$n["unsigned"]?1:0)):($U[$n["type"]]?$U[$n["type"]]+($n["unsigned"]?0:1):0));if($i->server_info>=5.6&&ereg('time',$n["type"]))$Ed+=7;echo"<input".(ereg('int',$n["type"])?" type='number'":"")." value='".h($Y)."'".($Ed?" maxlength='$Ed'":"").(ereg('char|binary',$n["type"])&&$Ed>20?" size='40'":"")."$_a>";}}}function
  5. indexes($P,$j=null){$I=array();foreach(get_rows("SHOW INDEX FROM ".table($P),$j)as$J){$I[$J["Key_name"]]["type"]=($J["Key_name"]=="PRIMARY"?"PRIMARY":($J["Index_type"]=="FULLTEXT"?"FULLTEXT":($J["Non_unique"]?"INDEX":"UNIQUE")));$I[$J["Key_name"]]["columns"][]=$J["Column_name"];$I[$J["Key_name"]]["lengths"][]=$J["Sub_part"];}return$I;}function
  6. foreign_keys($P){global$i,$de;static$Ee='`(?:[^`]|``)+`';$I=array();$kb=$i->result("SHOW CREATE TABLE ".table($P),1);if($kb){preg_match_all("~CONSTRAINT ($Ee) FOREIGN KEY \\(((?:$Ee,? ?)+)\\) REFERENCES ($Ee)(?:\\.($Ee))? \\(((?:$Ee,? ?)+)\\)(?: ON DELETE ($de))?(?: ON UPDATE ($de))?~",$kb,$yd,PREG_SET_ORDER);foreach($yd
  7. as$A){preg_match_all("~$Ee~",$A[2],$Ef);preg_match_all("~$Ee~",$A[5],$ag);$I[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',$Ef[0]),"target"=>array_map('idf_unescape',$ag[0]),"on_delete"=>($A[6]?$A[6]:"RESTRICT"),"on_update"=>($A[7]?$A[7]:"RESTRICT"),);}}return$I;}function
  8. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  9. routine($B,$T){global$i,$Tb,$Tc,$U;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$zg="((".implode("|",array_merge(array_keys($U),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Tb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$Ee="\\s*(".($T=="FUNCTION"?"":$Tc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$zg";$jb=$i->result("SHOW CREATE $T ".idf_escape($B),2);preg_match("~\\(((?:$Ee\\s*,?)*)\\)\\s*".($T=="FUNCTION"?"RETURNS\\s+$zg\\s+":"")."(.*)~is",$jb,$A);$o=array();preg_match_all("~$Ee\\s*,?~is",$A[1],$yd,PREG_SET_ORDER);foreach($yd
  10. <td><input name="',$x,'[length]" value="',h($n["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">';echo"<select name='$x"."[collation]'".(ereg('(char|text|enum|set)$',$n["type"])?"":" class='hidden'").'><option value="">('.lang(88).')'.optionlist($Wa,$n["collation"]).'</select>',($Fg?"<select name='$x"."[unsigned]'".(!$n["type"]||ereg('((^|[^o])int|float|double|decimal)$',$n["type"])?"":" class='hidden'").'><option>'.optionlist($Fg,$n["unsigned"]).'</select>':''),(isset($n['on_update'])?"<select name='$x"."[on_update]'".($n["type"]=="timestamp"?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(89).")","CURRENT_TIMESTAMP"),$n["on_update"]).'</select>':''),($tc?"<select name='$x"."[on_delete]'".(ereg("`",$n["type"])?"":" class='hidden'")."><option value=''>(".lang(90).")".optionlist(explode("|",$de),$n["on_delete"])."</select> ":" ");}function
  11. process_length($rd){global$Tb;return(preg_match("~^\\s*(?:$Tb)(?:\\s*,\\s*(?:$Tb))*\\s*\$~",$rd)&&preg_match_all("~$Tb~",$rd,$yd)?implode(",",$yd[0]):preg_replace('~[^0-9,+-]~','',$rd));}function
  12. as$B=>$p){echo"<tr title='".h($B)."'>","<th><i>".implode("</i>, <i>",array_map('h',$p["source"]))."</i>","<td><a href='".h($p["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($p["db"]),ME):($p["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($p["ns"]),ME):ME))."table=".urlencode($p["table"])."'>".($p["db"]!=""?"<b>".h($p["db"])."</b>.":"").($p["ns"]!=""?"<b>".h($p["ns"])."</b>.":"").h($p["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$p["target"]))."</i>)","<td>".nbsp($p["on_delete"])."\n","<td>".nbsp($p["on_update"])."\n",($w=="sqlite"?"":'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($B)).'">'.lang(110).'</a>');}echo"</table>\n";}if($w!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(111)."</a>\n";}if(support("trigger")){echo"<h3 id='triggers'>".lang(112)."</h3>\n";$xg=triggers($a);if($xg){echo"<table cellspacing='0'>\n";foreach($xg
  13. as$x=>$X)echo"<tr valign='top'><td>$X[0]<td>$X[1]<th>".h($x)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($x))."'>".lang(110)."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(113)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(53),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Vf=array();$Wf=array();$B="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$B-".DB]?"$B-".DB:$B)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$yd,PREG_SET_ORDER);foreach($yd
  14. as$B=>$X){$X=process_input($o[$B]);if($X!==null){if($_POST["clone"])$N[idf_escape($B)]=($X!==false?$X:idf_escape($B));elseif($X!==false)$N[]=idf_escape($B)." = $X";}}$G.=($_POST["clone"]?" (".implode(", ",array_keys($N)).")\nSELECT ".implode(", ",$N)."\nFROM ".table($a):" SET\n".implode(",\n",$N));}if($_POST["delete"]||$N){$Ya="UPDATE";if($_POST["delete"]){$Ya="DELETE";$G="FROM $G";}if($_POST["clone"]){$Ya="INSERT";$G="INTO $G";}if($_POST["all"]||($Eg===array()&&$_POST["check"])||$Xc){$H=queries("$Ya $G$Vg");$sa=$i->affected_rows;}else{foreach((array)$_POST["check"]as$X){$H=queries($Ya.limit1($G,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$o)));if(!$H)break;$sa+=$i->affected_rows;}}}$Fd=lang(226,$sa);if($_POST["clone"]&&$H&&$sa==1){$md=last_id();if($md)$Fd=lang(139," $md");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$Fd,$H);}elseif(!$_POST["import"]){if(!$_POST["val"])$m=lang(227);else{$H=true;$sa=0;foreach($_POST["val"]as$Cg=>$J){$N=array();foreach($J
  15. as$x=>$X){$x=bracket_escape($x,1);$N[]=idf_escape($x)." = ".(ereg('char|text',$o[$x]["type"])||$X!=""?$b->processInput($o[$x],$X):"NULL");}$G=table($a)." SET ".implode(", ",$N);$Ug=" WHERE ".where_check($Cg,$o).($Z?" AND ".implode(" AND ",$Z):"");$H=queries("UPDATE".($Xc?" $G$Ug":limit1($G,$Ug)));if(!$H)break;$sa+=$i->affected_rows;}queries_redirect(remove_from_uri(),lang(226,$sa),$H);}}elseif(is_string($mc=get_file("csv_file",true))){cookie("adminer_import","output=".urlencode($ra["output"])."&format=".urlencode($_POST["separator"]));$H=true;$Xa=array_keys($o);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$mc,$yd);$sa=count($yd[0]);begin();$zf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($yd[0]as$x=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$zf]*)$zf~",$X.$zf,$zd);if(!$x&&!array_diff($zd[1],$Xa)){$Xa=$zd[1];$sa--;}else{$N=array();foreach($zd[1]as$r=>$Ua)$N[idf_escape($Xa[$r])]=($Ua==""&&$o[$Xa[$r]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ua))));$H=insert_update($a,$N,$Ne);if(!$H)break;}}if($H)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(228,$sa),$H);queries("ROLLBACK");}else$m=upload_error($mc);}}$Tf=$b->tableName($Q);if(is_ajax())ob_start();page_header(lang(36).": $Tf",$m);$N=null;if(isset($mf["insert"])){$N="";foreach((array)$_GET["where"]as$X){if(count($tc[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!ereg('[_%]',$X["val"]))))$N.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($Q,$N);if(!$g)echo"<p class='error'>".lang(229).($o?".":": ".error())."\n";else{echo"<form action='' id='form'>\n","<div style='display: none;'>";hidden_fields_get();echo(DB!=""?'<input type="hidden" name="db" value="'.h(DB).'">'.(isset($_GET["ns"])?'<input type="hidden" name="ns" value="'.h($_GET["ns"]).'">':""):"");echo'<input type="hidden" name="select" value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($L,$g);$b->selectSearchPrint($Z,$g,$v);$b->selectOrderPrint($le,$g,$v);$b->selectLimitPrint($y);$b->selectLengthPrint($fg);$b->selectActionPrint($v);echo"</form>\n";$D=$_GET["page"];if($D=="last"){$wc=$i->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$D=floor(max(0,$wc-1)/$y);}$G=$b->selectQueryBuild($L,$Z,$Dc,$le,$y,$D);if(!$G)$G="SELECT".limit((+$y&&$Dc&&$Xc&&$w=="sql"?"SQL_CALC_FOUND_ROWS ":"").$yc,($Z?"\nWHERE ".implode(" AND ",$Z):"").$Ec,($y!=""?+$y:null),($D?$y*$D:0),"\n");echo$b->selectQuery($G);$H=$i->query($G);if(!$H)echo"<p class='error'>".error()."\n";else{if($w=="mssql"&&$D)$H->seek($y*$D);$Ob=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$K=array();while($J=$H->fetch_assoc()){if($D&&$w=="oracle")unset($J["RNUM"]);$K[]=$J;}if($_GET["page"]!="last")$wc=(+$y&&$Dc&&$Xc?($w=="sql"?$i->result(" SELECT FOUND_ROWS()"):$i->result("SELECT COUNT(*) FROM ($G) x")):count($K));if(!$K)echo"<p class='message'>".lang(86)."\n";else{$Ea=$b->backwardKeys($a,$Tf);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Dc&&$L?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(230)."</a>");$Qd=array();$Ac=array();reset($L);$Ye=1;foreach($K[0]as$x=>$X){if($x!=$Xd){$X=$_GET["columns"][key($L)];$n=$o[$L?($X?$X["col"]:current($L)):$x];$B=($n?$b->fieldName($n,$Ye):"*");if($B!=""){$Ye++;$Qd[$x]=$B;$f=idf_escape($x);$Lc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($x);$wb="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($Lc.($le[0]==$f||$le[0]==$x||(!$le&&$Xc&&$Dc[0]==$f)?$wb:'')).'">';echo(!$L||$X?apply_sql_function($X["fun"],$B):h(current($L)))."</a>";echo"<span class='column hidden'>","<a href='".h($Lc.$wb)."' title='".lang(42)."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($x)).'\'); return false;" title="'.lang(39).'" class="text jsonly"> =</a>';echo"</span>";}$Ac[$x]=$X["fun"];next($L);}}$sd=array();if($_GET["modify"]){foreach($K

  1. vsprintf($uc,$ya);}function
  2. switch_lang(){global$ca,$hd,$S;echo"<form action='' method='post'>\n<div id='lang'>",lang(8).": ".html_select("lang",$hd,$ca,"this.form.submit();")," <input type='submit' value='".lang(9)."' class='hidden'>\n","<input type='hidden' name='token' value='$S'>\n","</div>\n</form>\n";}if(isset($_POST["lang"])&&$_SESSION["token"]==$_POST["token"]){cookie("adminer_lang",$_POST["lang"]);$_SESSION["lang"]=$_POST["lang"];$_SESSION["translations"]=array();redirect(remove_from_uri());}$ca="en";if(isset($hd[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($hd[$_SESSION["lang"]]))$ca=$_SESSION["lang"];else{$pa=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$vd,PREG_SET_ORDER);foreach($vd
  3. indexes($P,$i=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($P),$i)as$I){$H[$I["Key_name"]]["type"]=($I["Key_name"]=="PRIMARY"?"PRIMARY":($I["Index_type"]=="FULLTEXT"?"FULLTEXT":($I["Non_unique"]?"INDEX":"UNIQUE")));$H[$I["Key_name"]]["columns"][]=$I["Column_name"];$H[$I["Key_name"]]["lengths"][]=$I["Sub_part"];}return$H;}function
  4. foreign_keys($P){global$h,$Xd;static$ze='`(?:[^`]|``)+`';$H=array();$mb=$h->result("SHOW CREATE TABLE ".table($P),1);if($mb){preg_match_all("~CONSTRAINT ($ze) FOREIGN KEY \\(((?:$ze,? ?)+)\\) REFERENCES ($ze)(?:\\.($ze))? \\(((?:$ze,? ?)+)\\)(?: ON DELETE ($Xd))?(?: ON UPDATE ($Xd))?~",$mb,$vd,PREG_SET_ORDER);foreach($vd
  5. as$_){preg_match_all("~$ze~",$_[2],$xf);preg_match_all("~$ze~",$_[5],$Sf);$H[idf_unescape($_[1])]=array("db"=>idf_unescape($_[4]!=""?$_[3]:$_[4]),"table"=>idf_unescape($_[4]!=""?$_[4]:$_[3]),"source"=>array_map('idf_unescape',$xf[0]),"target"=>array_map('idf_unescape',$Sf[0]),"on_delete"=>($_[6]?$_[6]:"RESTRICT"),"on_update"=>($_[7]?$_[7]:"RESTRICT"),);}}return$H;}function
  6. view($A){global$h;return
  7. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  8. routine($A,$T){global$h,$Ub,$Rc,$U;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$ng="((".implode("|",array_merge(array_keys($U),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Ub)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ze="\\s*(".($T=="FUNCTION"?"":$Rc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$ng";$lb=$h->result("SHOW CREATE $T ".idf_escape($A),2);preg_match("~\\(((?:$ze\\s*,?)*)\\)\\s*".($T=="FUNCTION"?"RETURNS\\s+$ng\\s+":"")."(.*)~is",$lb,$_);$n=array();preg_match_all("~$ze\\s*,?~is",$_[1],$vd,PREG_SET_ORDER);foreach($vd
  9. <td><input name="',$w,'[length]" value="',h($m["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$w"."[collation]'".(ereg('(char|text|enum|set)$',$m["type"])?"":" class='hidden'").'><option value="">('.lang(87).')'.optionlist($Ya,$m["collation"]).'</select>',($ug?"<select name='$w"."[unsigned]'".(!$m["type"]||ereg('(int|float|double|decimal)$',$m["type"])?"":" class='hidden'").'><option>'.optionlist($ug,$m["unsigned"]).'</select>':''),($tc?"<select name='$w"."[on_delete]'".(ereg("`",$m["type"])?"":" class='hidden'")."><option value=''>(".lang(88).")".optionlist(explode("|",$Xd),$m["on_delete"])."</select> ":" ");}function
  10. process_length($x){global$Ub;return(preg_match("~^\\s*(?:$Ub)(?:\\s*,\\s*(?:$Ub))*\\s*\$~",$x)&&preg_match_all("~$Ub~",$x,$vd)?implode(",",$vd[0]):preg_replace('~[^0-9,+-]~','',$x));}function
  11. 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
  12. 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
  13. </form>
  14. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Me=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$ib)$Me[$ib][$I["Privilege"]]=$I["Comment"];}$Me["Server Admin"]+=$Me["File access on server"];$Me["Databases"]["Create routine"]=$Me["Procedures"]["Create routine"];unset($Me["Procedures"]["Create routine"]);$Me["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$Me["Columns"][$X]=$Me["Tables"][$X];unset($Me["Server Admin"]["Usage"]);foreach($Me["Tables"]as$w=>$X)unset($Me["Databases"][$w]);$Nd=array();if($_POST){foreach($_POST["objects"]as$w=>$X)$Nd[$X]=(array)$Nd[$X]+(array)$_POST["grants"][$w];}$Bc=array();$Ud="";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],$_)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$_[1],$vd,PREG_SET_ORDER)){foreach($vd
  15. as$A=>$X){$X=process_input($n[$A]);if($X!==null){if($_POST["clone"])$M[idf_escape($A)]=($X!==false?$X:idf_escape($A));elseif($X!==false)$M[]=idf_escape($A)." = $X";}}$F.=($_POST["clone"]?" (".implode(", ",array_keys($M)).")\nSELECT ".implode(", ",$M)."\nFROM ".table($a):" SET\n".implode(",\n",$M));}if($_POST["delete"]||$M){$ab="UPDATE";if($_POST["delete"]){$ab="DELETE";$F="FROM $F";}if($_POST["clone"]){$ab="INSERT";$F="INTO $F";}if($_POST["all"]||($tg===array()&&$_POST["check"])||$Vc){$G=queries("$ab $F".($_POST["all"]?($Z?"\nWHERE ".implode(" AND ",$Z):""):"\nWHERE $Ig"));$sa=$h->affected_rows;}else{foreach((array)$_POST["check"]as$X){$G=queries($ab.limit1($F,"\nWHERE ".where_check($X)));if(!$G)break;$sa+=$h->affected_rows;}}}$Bd=lang(225,$sa);if($_POST["clone"]&&$G&&$sa==1){$jd=last_id();if($jd)$Bd=lang(139," $jd");}queries_redirect(remove_from_uri("page"),$Bd,$G);}elseif(!$_POST["import"]){if(!$_POST["val"])$l=lang(226);else{$G=true;$sa=0;foreach($_POST["val"]as$rg=>$I){$M=array();foreach($I
  16. as$w=>$X){$w=bracket_escape($w,1);$M[]=idf_escape($w)." = ".(ereg('char|text',$n[$w]["type"])||$X!=""?$b->processInput($n[$w],$X):"NULL");}$F=table($a)." SET ".implode(", ",$M);$Hg=" WHERE ".where_check($rg).($Z?" AND ".implode(" AND ",$Z):"");$G=queries("UPDATE".($Vc?" $F$Hg":limit1($F,$Hg)));if(!$G)break;$sa+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(225,$sa),$G);}}elseif(is_string($mc=get_file("csv_file",true))){cookie("adminer_import","output=".urlencode($ra["output"])."&format=".urlencode($_POST["separator"]));$G=true;$Za=array_keys($n);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$mc,$vd);$sa=count($vd[0]);begin();$sf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($vd[0]as$w=>$X){preg_match_all("~((\"[^\"]*\")+|[^$sf]*)$sf~",$X.$sf,$wd);if(!$w&&!array_diff($wd[1],$Za)){$Za=$wd[1];$sa--;}else{$M=array();foreach($wd[1]as$q=>$Wa)$M[idf_escape($Za[$q])]=($Wa==""&&$n[$Za[$q]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Wa))));$G=insert_update($a,$M,$He);if(!$G)break;}}if($G)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(227,$sa),$G);queries("ROLLBACK");}else$l=upload_error($mc);}}$Lf=$b->tableName($Q);if(is_ajax())ob_start();page_header(lang(35).": $Lf",$l);$M=null;if(isset($ff["insert"])){$M="";foreach((array)$_GET["where"]as$X){if(count($tc[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!ereg('[_%]',$X["val"]))))$M.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($Q,$M);if(!$f)echo"<p class='error'>".lang(228).($n?".":": ".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,$u);$b->selectOrderPrint($fe,$f,$u);$b->selectLimitPrint($y);$b->selectLengthPrint($Vf);$b->selectActionPrint($u);echo"</form>\n";$C=$_GET["page"];if($C=="last"){$wc=$h->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$C=floor(max(0,$wc-1)/$y);}$F=$b->selectQueryBuild($K,$Z,$Cc,$fe,$y,$C);if(!$F)$F="SELECT".limit((+$y&&$Cc&&$Vc&&$v=="sql"?"SQL_CALC_FOUND_ROWS ":"").$yc,($Z?"\nWHERE ".implode(" AND ",$Z):"").$Dc,($y!=""?+$y:null),($C?$y*$C:0),"\n");echo$b->selectQuery($F);$G=$h->query($F);if(!$G)echo"<p class='error'>".error()."\n";else{if($v=="mssql")$G->seek($y*$C);$Pb=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$J=array();while($I=$G->fetch_assoc()){if($C&&$v=="oracle")unset($I["RNUM"]);$J[]=$I;}if($_GET["page"]!="last")$wc=(+$y&&$Cc&&$Vc?($v=="sql"?$h->result(" SELECT FOUND_ROWS()"):$h->result("SELECT COUNT(*) FROM ($F) x")):count($J));if(!$J)echo"<p class='message'>".lang(84)."\n";else{$Ga=$b->backwardKeys($a,$Lf);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Cc&&$K?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(229)."</a>");$Md=array();$_c=array();reset($K);$Re=1;foreach($J[0]as$w=>$X){if($w!=$Sd){$X=$_GET["columns"][key($K)];$m=$n[$K?($X?$X["col"]:current($K)):$w];$A=($m?$b->fieldName($m,$Re):"*");if($A!=""){$Re++;$Md[$w]=$A;$e=idf_escape($w);$Jc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($w);$yb="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($Jc.($fe[0]==$e||$fe[0]==$w||(!$fe&&$Vc&&$Cc[0]==$e)?$yb:'')).'">';echo(!$K||$X?apply_sql_function($X["fun"],$A):h(current($K)))."</a>";echo"<span class='column hidden'>","<a href='".h($Jc.$yb)."' title='".lang(41)."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($w)).'\'); return false;" title="'.lang(38).'" class="text jsonly"> =</a>';echo"</span>";}$_c[$w]=$X["fun"];next($K);}}$od=array();if($_GET["modify"]){foreach($J

  1. 				preg_match('/<B>Previous series<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/', $links, $matches);
  2. 				preg_match_all('/<TR><td width=15% VALIGN=TOP >(.*?)<\/td><td width=85% ><A HREF="SeriesDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/', $matches[1], $pseries, PREG_SET_ORDER);
  3. 				preg_match('/<B>Subsequent series<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  4. 				preg_match_all('/<TR><td width=15% VALIGN=TOP >(.*?)<\/td><td width=85% ><A HREF="SeriesDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $sseries, PREG_SET_ORDER);
  5. 				preg_match('/<B>Controlling series<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  6. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="SeriesDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $cseries, PREG_SET_ORDER);
  7. 				preg_match('/<B>Controlled series<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  8. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="SeriesDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $conseries, PREG_SET_ORDER);
  9. 				preg_match('/<B>Organisation controlling<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  10. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="OrganisationDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $orgs, PREG_SET_ORDER);
  11. 				preg_match('/<B>Superior agency<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  12. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="AgencyDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $sagencies, PREG_SET_ORDER);
  13. 				preg_match('/<B>Controlled agency<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  14. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="AgencyDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $cagencies, PREG_SET_ORDER);
  15. 				preg_match('/<B>Agencies associated with person<\/B><BR><TABLE width=100% >(.+?)<\/TABLE>/i', $links, $matches);
  16. 				preg_match_all('/<TR><td width=30% VALIGN=TOP >(.*?)<\/td><td width=70% ><A HREF="AgencyDetail.asp\?M=1\&B=.+?">(.+?)<\/a>, (.+?)<\/td><\/TR>/i', $matches[1], $agencies, PREG_SET_ORDER);




  1. column_foreign_keys($S){global$b;$J=array();foreach($b->foreignKeys($S)as$m){foreach($m["source"]as$X)$J[$X][]=$m;}return$J;}function
  2. enum_input($V,$ta,$k,$Y,$Ab=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$Rc);$J=($Ab!==null?"<label><input type='$V'$ta value='$Ab'".((is_array($Y)?in_array($Ab,$Y):$Y===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($Rc[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ga=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$J.=" <label><input type='$V'$ta value='".($s+1)."'".($Ga?' checked':'').'>'.h($b->editVal($X,$k)).'</label>';}return$J;}function
  3. nbsp($q[""])."<td>".$b->editInput($_GET["edit"],$k,$ta,$Y);else{$Xb=0;foreach($q
  4. as$y=>$X){if($y===""||!$X)break;$Xb++;}$td=($Xb?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($k["field"])))."]']; if ($Xb > f.selectedIndex) f.selectedIndex = $Xb;\"":"");$ta.=$td;echo(count($q)>1?html_select("function[$D]",$q,$p===null||in_array($p,$q)||isset($q[$p])?$p:"","functionChange(this);"):nbsp(reset($q))).'<td>';$wc=$b->editInput($_GET["edit"],$k,$ta,$Y);if($wc!="")echo$wc;elseif($k["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$Rc);foreach($Rc[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ga=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$D][$s]' value='".(1<<$s)."'".($Ga?' checked':'')."$td>".h($b->editVal($X,$k)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$k["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$D'$td>";elseif(ereg('text|lob',$k["type"]))echo"<textarea ".($x!="sqlite"||ereg("\n",$Y)?"cols='50' rows='12'":"cols='30' rows='1' style='height: 1.2em;'")."$ta>".h($Y).'</textarea>';else{$Xc=(!ereg('int',$k["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$k["length"],$B)?((ereg("binary",$k["type"])?2:1)*$B[1]+($B[3]?1:0)+($B[2]&&!$k["unsigned"]?1:0)):($yf[$k["type"]]?$yf[$k["type"]]+($k["unsigned"]?0:1):0));echo"<input value='".h($Y)."'".($Xc?" maxlength='$Xc'":"").(ereg('char|binary',$k["type"])&&$Xc>20?" size='40'":"")."$ta>";}}}function
  5. indexes($S,$g=null){$J=array();foreach(get_rows("SHOW INDEX FROM ".table($S),$g)as$K){$J[$K["Key_name"]]["type"]=($K["Key_name"]=="PRIMARY"?"PRIMARY":($K["Index_type"]=="FULLTEXT"?"FULLTEXT":($K["Non_unique"]?"INDEX":"UNIQUE")));$J[$K["Key_name"]]["columns"][]=$K["Column_name"];$J[$K["Key_name"]]["lengths"][]=$K["Sub_part"];}return$J;}function
  6. foreign_keys($S){global$f,$sd;static$F='`(?:[^`]|``)+`';$J=array();$ab=$f->result("SHOW CREATE TABLE ".table($S),1);if($ab){preg_match_all("~CONSTRAINT ($F) FOREIGN KEY \\(((?:$F,? ?)+)\\) REFERENCES ($F)(?:\\.($F))? \\(((?:$F,? ?)+)\\)(?: ON DELETE ($sd))?(?: ON UPDATE ($sd))?~",$ab,$Rc,PREG_SET_ORDER);foreach($Rc
  7. as$B){preg_match_all("~$F~",$B[2],$Ie);preg_match_all("~$F~",$B[5],$ef);$J[idf_unescape($B[1])]=array("db"=>idf_unescape($B[4]!=""?$B[3]:$B[4]),"table"=>idf_unescape($B[4]!=""?$B[4]:$B[3]),"source"=>array_map('idf_unescape',$Ie[0]),"target"=>array_map('idf_unescape',$ef[0]),"on_delete"=>($B[6]?$B[6]:"RESTRICT"),"on_update"=>($B[7]?$B[7]:"RESTRICT"),);}}return$J;}function
  8. view($D){global$f;return
  9. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  10. routine($D,$V){global$f,$Eb,$vc,$yf;$pa=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$xf="((".implode("|",array_merge(array_keys($yf),$pa)).")\\b(?:\\s*\\(((?:[^'\")]*|$Eb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$F="\\s*(".($V=="FUNCTION"?"":$vc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$xf";$Za=$f->result("SHOW CREATE $V ".idf_escape($D),2);preg_match("~\\(((?:$F\\s*,?)*)\\)\\s*".($V=="FUNCTION"?"RETURNS\\s+$xf\\s+":"")."(.*)~is",$Za,$B);$l=array();preg_match_all("~$F\\s*,?~is",$B[1],$Rc,PREG_SET_ORDER);foreach($Rc
  11. <td><input name="',$y,'[length]" value="',h($k["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$y"."[collation]'".(ereg('(char|text|enum|set)$',$k["type"])?"":" class='hidden'").'><option value="">('.'collation'.')'.optionlist($d,$k["collation"]).'</select>',($Ef?"<select name='$y"."[unsigned]'".(!$k["type"]||ereg('(int|float|double|decimal)$',$k["type"])?"":" class='hidden'").'><option>'.optionlist($Ef,$k["unsigned"]).'</select>':''),($n?"<select name='$y"."[on_delete]'".(ereg("`",$k["type"])?"":" class='hidden'")."><option value=''>(".'ON DELETE'.")".optionlist(explode("|",$sd),$k["on_delete"])."</select> ":" ");}function
  12. process_length($Lc){global$Eb;return(preg_match("~^\\s*(?:$Eb)(?:\\s*,\\s*(?:$Eb))*\\s*\$~",$Lc)&&preg_match_all("~$Eb~",$Lc,$Rc)?implode(",",$Rc[0]):preg_replace('~[^0-9,+-]~','',$Lc));}function
  13. as$D=>$m){echo"<tr title='".h($D)."'>","<th><i>".implode("</i>, <i>",array_map('h',$m["source"]))."</i>","<td><a href='".h($m["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($m["db"]),ME):($m["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($m["ns"]),ME):ME))."table=".urlencode($m["table"])."'>".($m["db"]!=""?"<b>".h($m["db"])."</b>.":"").($m["ns"]!=""?"<b>".h($m["ns"])."</b>.":"").h($m["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$m["target"]))."</i>)","<td>".nbsp($m["on_delete"])."\n","<td>".nbsp($m["on_update"])."\n";if($x!="sqlite")echo'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($D)).'">'.'Alter'.'</a>';}echo"</table>\n";}if($x!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.'Add foreign key'."</a>\n";}if(support("trigger")){echo"<h3>".'Triggers'."</h3>\n";$vf=triggers($a);if($vf){echo"<table cellspacing='0'>\n";foreach($vf
  14. as$y=>$X)echo"<tr valign='top'><td>$X[0]<td>$X[1]<th>".h($y)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($y))."'>".'Alter'."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.'Add trigger'."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header('Database schema',"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Ye=array();$Ze=array();$D="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$D-".DB]?"$D-".DB:$D)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$Rc,PREG_SET_ORDER);foreach($Rc
  15. </form>
  16. ';}elseif(isset($_GET["user"])){$fa=$_GET["user"];$ee=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$K){foreach(explode(",",($K["Privilege"]=="Grant option"?"":$K["Context"]))as$Wa)$ee[$Wa][$K["Privilege"]]=$K["Comment"];}$ee["Server Admin"]+=$ee["File access on server"];$ee["Databases"]["Create routine"]=$ee["Procedures"]["Create routine"];unset($ee["Procedures"]["Create routine"]);$ee["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$ee["Columns"][$X]=$ee["Tables"][$X];unset($ee["Server Admin"]["Usage"]);foreach($ee["Tables"]as$y=>$X)unset($ee["Databases"][$y]);$id=array();if($_POST){foreach($_POST["objects"]as$y=>$X)$id[$X]=(array)$id[$X]+(array)$_POST["grants"][$y];}$gc=array();$pd="";if(isset($_GET["host"])&&($I=$f->query("SHOW GRANTS FOR ".q($fa)."@".q($_GET["host"])))){while($K=$I->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$K[0],$B)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$B[1],$Rc,PREG_SET_ORDER)){foreach($Rc


  1. // options
  2. $t->is(preg_match_all('/<option /', select_year_tag('year', 2006, array('year_start' => 2005, 'year_end' => 2007)), $matches), 3, 'select_year_tag() takes a "year_start" and a "year_end" options');
  3. $t->like(select_second_tag('second', null, array(), array('id' => 'foo')), '<select name="second" id="foo">', 'select_second_tag() takes an array of attribute options as its fourth argument');
  4. $t->is(preg_match_all("/<option value=\"/", select_second_tag('second', null, array('second_step' => 10)), $matches), 6, 'select_second_tag() can take an "second_step" option');
  5. $t->like(select_minute_tag('minute', null, array(), array('id' => 'foo')), '<select name="minute" id="foo">', 'select_minute_tag() takes an array of attribute options as its fourth argument');
  6. $t->is(preg_match_all("/<option value=\"/", select_minute_tag('minute', null, array('minute_step' => 10)), $matches), 6, 'select_minute_tag() can take an "minute_step" option');
  7. $t->like(select_hour_tag('hour', null, array(), array('id' => 'foo')), '<select name="hour" id="foo">', 'select_hour_tag() takes an array of attribute options as its fourth argument');
  8. $t->is(preg_match_all("/<option value=\"/", select_hour_tag('hour'), $matches), 24, 'select_hour_tag() can take an "12hour_time" option');
  9. $t->is(preg_match_all("/<option value=\"/", select_hour_tag('hour', null, array('12hour_time' => true)), $matches), 12, 'select_hour_tag() can take an "12hour_time" option');
  10. 
                        
  11. $t->like(select_number_tag('number', null, array(), array('id' => 'foo')), '<select name="number" id="foo">', 'select_number_tag() takes an array of attribute options as its fourth argument');
  12. $t->is(preg_match_all('/<option/', select_number_tag('number', 3, array('increment' => 4)), $matches), 4, 'select_number_tag() can take an "increment" option');
  13. }
  14. $t->is(preg_match_all('/<option/', select_number_tag('number', 40, array('start' => 38, 'end' => 40)), $matches), 3, 'select_number_tag() can take a "start" and "end" options');


Back to Top