About 24,928 results: "php preg_match_all"
Page 9 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On


  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. column_foreign_keys($O){global$b;$H=array();foreach($b->foreignKeys($O)as$n){foreach($n["source"]as$W)$H[$W][]=$n;}return$H;}function
  2. enum_input($S,$ya,$l,$X,$Rb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$_d);$H=($Rb!==null?"<label><input type='$S'$ya value='$Rb'".((is_array($X)?in_array($Rb,$X):$X===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($_d[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Oa=(is_int($X)?$X==$p+1:(is_array($X)?in_array($p+1,$X):$X===$W));$H.=" <label><input type='$S'$ya value='".($p+1)."'".($Oa?' checked':'').'>'.h($b->editVal($W,$l)).'</label>';}return$H;}function
  3. nbsp($Cc[""])."<td>".$b->editInput($_GET["edit"],$l,$ya,$X);else{$rc=0;foreach($Cc
  4. as$v=>$W){if($v===""||!$W)break;$rc++;}$fe=($rc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($l["field"])))."]']; if ($rc > f.selectedIndex) f.selectedIndex = $rc;\"":"");$ya.=$fe;echo(count($Cc)>1?html_select("function[$A]",$Cc,$o===null||in_array($o,$Cc)||isset($Cc[$o])?$o:"","functionChange(this);"):nbsp(reset($Cc))).'<td>';$Yc=$b->editInput($_GET["edit"],$l,$ya,$X);if($Yc!="")echo$Yc;elseif($l["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$_d);foreach($_d[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Oa=(is_int($X)?($X>>$p)&1:in_array($W,explode(",",$X),true));echo" <label><input type='checkbox' name='fields[$A][$p]' value='".(1<<$p)."'".($Oa?' checked':'')."$fe>".h($b->editVal($W,$l)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$l["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$A'$fe>";elseif(($gg=ereg('text|lob',$l["type"]))||ereg("\n",$X)){if($gg&&$u!="sqlite")$ya.=" cols='50' rows='12'";else{$J=min(12,substr_count($X,"\n")+1);$ya.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$ya>".h($X).'</textarea>';}else{$Gd=(!ereg('int',$l["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$l["length"],$z)?((ereg("binary",$l["type"])?2:1)*$z[1]+($z[3]?1:0)+($z[2]&&!$l["unsigned"]?1:0)):($T[$l["type"]]?$T[$l["type"]]+($l["unsigned"]?0:1):0));if($u=='sql'&&$g->server_info>=5.6&&ereg('time',$l["type"]))$Gd+=7;echo"<input".(ereg('int',$l["type"])?" type='number'":"")." value='".h($X)."'".($Gd?" maxlength='$Gd'":"").(ereg('char|binary',$l["type"])&&$Gd>20?" size='40'":"")."$ya>";}}}function
  5. fields($O){$H=array();foreach(get_rows("PRAGMA table_info(".table($O).")")as$I){$S=strtolower($I["type"]);$vb=$I["dflt_value"];$H[$I["name"]]=array("field"=>$I["name"],"type"=>(eregi("int",$S)?"integer":(eregi("char|clob|text",$S)?"text":(eregi("blob",$S)?"blob":(eregi("real|floa|doub",$S)?"real":"numeric")))),"full_type"=>$S,"default"=>(ereg("'(.*)'",$vb,$z)?str_replace("''","'",$z[1]):($vb=="NULL"?null:$vb)),"null"=>!$I["notnull"],"auto_increment"=>eregi('^integer$',$S)&&$I["pk"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$I["pk"],);}return$H;}function
  6. indexes($O,$h=null){$H=array();$Ne=array();foreach(fields($O)as$l){if($l["primary"])$Ne[]=$l["field"];}if($Ne)$H[""]=array("type"=>"PRIMARY","columns"=>$Ne,"lengths"=>array());$If=get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ".q($O));foreach(get_rows("PRAGMA index_list(".table($O).")")as$I){$A=$I["name"];if(!ereg("^sqlite_",$A)){$H[$A]["type"]=($I["unique"]?"UNIQUE":"INDEX");$H[$A]["lengths"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($A).")")as$sf)$H[$A]["columns"][]=$sf["name"];$H[$A]["descs"]=array();if(eregi('^CREATE( UNIQUE)? INDEX '.quotemeta(idf_escape($A).' ON '.idf_escape($O)).' \((.*)\)$',$If[$A],$gf)){preg_match_all('/("[^"]*+")+( DESC)?/',$gf[2],$_d);foreach($_d[2]as$W)$H[$A]["descs"][]=($W?'1':null);}}}return$H;}function
  7. indexes($O,$h=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($O),$h)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"];$H[$I["Key_name"]]["descs"][]=null;}return$H;}function
  8. foreign_keys($O){global$g,$ee;static$Ee='`(?:[^`]|``)+`';$H=array();$kb=$g->result("SHOW CREATE TABLE ".table($O),1);if($kb){preg_match_all("~CONSTRAINT ($Ee) FOREIGN KEY \\(((?:$Ee,? ?)+)\\) REFERENCES ($Ee)(?:\\.($Ee))? \\(((?:$Ee,? ?)+)\\)(?: ON DELETE ($ee))?(?: ON UPDATE ($ee))?~",$kb,$_d,PREG_SET_ORDER);foreach($_d
  9. as$z){preg_match_all("~$Ee~",$z[2],$Ff);preg_match_all("~$Ee~",$z[5],$cg);$H[idf_unescape($z[1])]=array("db"=>idf_unescape($z[4]!=""?$z[3]:$z[4]),"table"=>idf_unescape($z[4]!=""?$z[4]:$z[3]),"source"=>array_map('idf_unescape',$Ff[0]),"target"=>array_map('idf_unescape',$cg[0]),"on_delete"=>($z[6]?$z[6]:"RESTRICT"),"on_update"=>($z[7]?$z[7]:"RESTRICT"),);}}return$H;}function
  10. view($A){global$g;return
  11. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  12. routine($A,$S){global$g,$Vb,$Xc,$T;$ua=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Ag="((".implode("|",array_merge(array_keys($T),$ua)).")\\b(?:\\s*\\(((?:[^'\")]*|$Vb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$Ee="\\s*(".($S=="FUNCTION"?"":$Xc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ag";$jb=$g->result("SHOW CREATE $S ".idf_escape($A),2);preg_match("~\\(((?:$Ee\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$Ag\\s+":"")."(.*)~is",$jb,$z);$m=array();preg_match_all("~$Ee\\s*,?~is",$z[1],$_d,PREG_SET_ORDER);foreach($_d
  13. <td><input name="',$v,'[length]" value="',h($l["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">';echo"<select name='$v"."[collation]'".(ereg('(char|text|enum|set)$',$l["type"])?"":" class='hidden'").'><option value="">('.'collation'.')'.optionlist($Wa,$l["collation"]).'</select>',($Hg?"<select name='$v"."[unsigned]'".(!$l["type"]||ereg('((^|[^o])int|float|double|decimal)$',$l["type"])?"":" class='hidden'").'><option>'.optionlist($Hg,$l["unsigned"]).'</select>':''),(isset($l['on_update'])?"<select name='$v"."[on_update]'".($l["type"]=="timestamp"?"":" class='hidden'").'>'.optionlist(array(""=>"(".'ON UPDATE'.")","CURRENT_TIMESTAMP"),$l["on_update"]).'</select>':''),($vc?"<select name='$v"."[on_delete]'".(ereg("`",$l["type"])?"":" class='hidden'")."><option value=''>(".'ON DELETE'.")".optionlist(explode("|",$ee),$l["on_delete"])."</select> ":" ");}function
  14. process_length($td){global$Vb;return(preg_match("~^\\s*(?:$Vb)(?:\\s*,\\s*(?:$Vb))*\\s*\$~",$td)&&preg_match_all("~$Vb~",$td,$_d)?implode(",",$_d[0]):preg_replace('~[^0-9,+-]~','',$td));}function
  15. </form>
  16. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Se=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$gb)$Se[$gb][$I["Privilege"]]=$I["Comment"];}$Se["Server Admin"]+=$Se["File access on server"];$Se["Databases"]["Create routine"]=$Se["Procedures"]["Create routine"];unset($Se["Procedures"]["Create routine"]);$Se["Columns"]=array();foreach(array("Select","Insert","Update","References")as$W)$Se["Columns"][$W]=$Se["Tables"][$W];unset($Se["Server Admin"]["Usage"]);foreach($Se["Tables"]as$v=>$W)unset($Se["Databases"][$v]);$Sd=array();if($_POST){foreach($_POST["objects"]as$v=>$W)$Sd[$W]=(array)$Sd[$W]+(array)$_POST["grants"][$v];}$Ec=array();$be="";if(isset($_GET["host"])&&($G=$g->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($I=$G->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$I[0],$z)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$z[1],$_d,PREG_SET_ORDER)){foreach($_d












  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);


Back to Top