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














  1. 
                        
  2.         if(preg_match_all("/\balejandro gonzález iñárritu/i", $depunctuated_text, $matches)) { $topic = 'Alejandro González Iñárritu'; }
  3.         if(preg_match_all("/\bamerican sniper/i", $depunctuated_text, $matches)) { $topic = 'American Sniper'; }
  4.         if(preg_match_all("/\bbig hero 6/i", $depunctuated_text, $matches)) { $topic = 'Big Hero 6'; }
  5.         if(preg_match_all("/\bbirdman/i", $depunctuated_text, $matches)) { $topic = 'Birdman'; }
  6.         if(preg_match_all("/\bcitizenfour/i", $depunctuated_text, $matches)) { $topic = 'Citizenfour'; }
  7. //        if(preg_match_all("/\bcommon/i", $depunctuated_text, $matches)) { $topic = 'Common'; }
  8.         if(preg_match_all("/\bcrisis hotline/i", $depunctuated_text, $matches)) { $topic = 'Crisis Hotline'; }
  9.         if(preg_match_all("/\beddie redmayne/i", $depunctuated_text, $matches)) { $topic = 'Eddie Redmayne'; }
  10. //        if(preg_match_all("/\bfeast/i", $depunctuated_text, $matches)) { $topic = 'Feast'; }
  11. //        if(preg_match_all("/\bglory/i", $depunctuated_text, $matches)) { $topic = 'Glory'; }
  12.         if(preg_match_all("/\bgrand budapest hotel/i", $depunctuated_text, $matches)) { $topic = 'Grand Budapest Hotel'; }
  13.         if(preg_match_all("/\binarritu/i", $depunctuated_text, $matches)) { $topic = 'Alejandro González Iñárritu'; }
  14.         if(preg_match_all("/\binterstellar/i", $depunctuated_text, $matches)) { $topic = 'Interstellar'; }
  15.         if(preg_match_all("/\bj. k. simmons/i", $depunctuated_text, $matches)) { $topic = 'J.K. Simmons'; }


  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. column_foreign_keys($O){global$b;$H=array();foreach($b->foreignKeys($O)as$o){foreach($o["source"]as$W)$H[$W][]=$o;}return$H;}function
  2. enum_input($S,$Aa,$m,$X,$Qb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$m["length"],$ud);$H=($Qb!==null?"<label><input type='$S'$Aa value='$Qb'".((is_array($X)?in_array($Qb,$X):$X===0)?" checked":"")."><i>".lang(4)."</i></label>":"");foreach($ud[1]as$q=>$W){$W=stripcslashes(str_replace("''","'",$W));$Ra=(is_int($X)?$X==$q+1:(is_array($X)?in_array($q+1,$X):$X===$W));$H.=" <label><input type='$S'$Aa value='".($q+1)."'".($Ra?' checked':'').'>'.h($b->editVal($W,$m)).'</label>';}return$H;}function
  3. nbsp($zc[""])."<td>".$b->editInput($_GET["edit"],$m,$Aa,$X);else{$oc=0;foreach($zc
  4. as$w=>$W){if($w===""||!$W)break;$oc++;}$Xd=($oc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($m["field"])))."]']; if ($oc > f.selectedIndex) f.selectedIndex = $oc;\"":"");$Aa.=$Xd;echo(count($zc)>1?html_select("function[$A]",$zc,$p===null||in_array($p,$zc)||isset($zc[$p])?$p:"","functionChange(this);"):nbsp(reset($zc))).'<td>';$Rc=$b->editInput($_GET["edit"],$m,$Aa,$X);if($Rc!="")echo$Rc;elseif($m["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$m["length"],$ud);foreach($ud[1]as$q=>$W){$W=stripcslashes(str_replace("''","'",$W));$Ra=(is_int($X)?($X>>$q)&1:in_array($W,explode(",",$X),true));echo" <label><input type='checkbox' name='fields[$A][$q]' value='".(1<<$q)."'".($Ra?' checked':'')."$Xd>".h($b->editVal($W,$m)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$m["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$A'$Xd>";elseif(($Uf=ereg('text|lob',$m["type"]))||ereg("\n",$X)){if($Uf&&$v!="sqlite")$Aa.=" cols='50' rows='12'";else{$J=min(12,substr_count($X,"\n")+1);$Aa.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$Aa>".h($X).'</textarea>';}else{$_d=(!ereg('int',$m["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$m["length"],$_)?((ereg("binary",$m["type"])?2:1)*$_[1]+($_[3]?1:0)+($_[2]&&!$m["unsigned"]?1:0)):($T[$m["type"]]?$T[$m["type"]]+($m["unsigned"]?0:1):0));echo"<input".(ereg('int',$m["type"])?" type='number'":"")." value='".h($X)."'".($_d?" maxlength='$_d'":"").(ereg('char|binary',$m["type"])&&$_d>20?" size='40'":"")."$Aa>";}}}function
  5. indexes($O,$i=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($O),$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
  6. foreign_keys($O){global$h,$Wd;static$ye='`(?:[^`]|``)+`';$H=array();$mb=$h->result("SHOW CREATE TABLE ".table($O),1);if($mb){preg_match_all("~CONSTRAINT ($ye) FOREIGN KEY \\(((?:$ye,? ?)+)\\) REFERENCES ($ye)(?:\\.($ye))? \\(((?:$ye,? ?)+)\\)(?: ON DELETE ($Wd))?(?: ON UPDATE ($Wd))?~",$mb,$ud,PREG_SET_ORDER);foreach($ud
  7. as$_){preg_match_all("~$ye~",$_[2],$wf);preg_match_all("~$ye~",$_[5],$Sf);$H[idf_unescape($_[1])]=array("db"=>idf_unescape($_[4]!=""?$_[3]:$_[4]),"table"=>idf_unescape($_[4]!=""?$_[4]:$_[3]),"source"=>array_map('idf_unescape',$wf[0]),"target"=>array_map('idf_unescape',$Sf[0]),"on_delete"=>($_[6]?$_[6]:"RESTRICT"),"on_update"=>($_[7]?$_[7]:"RESTRICT"),);}}return$H;}function
  8. view($A){global$h;return
  9. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  10. routine($A,$S){global$h,$Ub,$Qc,$T;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$ng="((".implode("|",array_merge(array_keys($T),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Ub)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ye="\\s*(".($S=="FUNCTION"?"":$Qc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$ng";$lb=$h->result("SHOW CREATE $S ".idf_escape($A),2);preg_match("~\\(((?:$ye\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$ng\\s+":"")."(.*)~is",$lb,$_);$n=array();preg_match_all("~$ye\\s*,?~is",$_[1],$ud,PREG_SET_ORDER);foreach($ud
  11. <td><input name="',$w,'[length]" value="',h($m["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">';echo"<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>':''),($sc?"<select name='$w"."[on_delete]'".(ereg("`",$m["type"])?"":" class='hidden'")."><option value=''>(".lang(88).")".optionlist(explode("|",$Wd),$m["on_delete"])."</select> ":" ");}function
  12. process_length($x){global$Ub;return(preg_match("~^\\s*(?:$Ub)(?:\\s*,\\s*(?:$Ub))*\\s*\$~",$x)&&preg_match_all("~$Ub~",$x,$ud)?implode(",",$ud[0]):preg_replace('~[^0-9,+-]~','',$x));}function
  13. </form>
  14. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Le=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$ib)$Le[$ib][$I["Privilege"]]=$I["Comment"];}$Le["Server Admin"]+=$Le["File access on server"];$Le["Databases"]["Create routine"]=$Le["Procedures"]["Create routine"];unset($Le["Procedures"]["Create routine"]);$Le["Columns"]=array();foreach(array("Select","Insert","Update","References")as$W)$Le["Columns"][$W]=$Le["Tables"][$W];unset($Le["Server Admin"]["Usage"]);foreach($Le["Tables"]as$w=>$W)unset($Le["Databases"][$w]);$Md=array();if($_POST){foreach($_POST["objects"]as$w=>$W)$Md[$W]=(array)$Md[$W]+(array)$_POST["grants"][$w];}$Ac=array();$Td="";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],$ud,PREG_SET_ORDER)){foreach($ud
  15. as$A=>$W){$W=process_input($n[$A]);if($W!==null){if($_POST["clone"])$M[idf_escape($A)]=($W!==false?$W:idf_escape($A));elseif($W!==false)$M[]=idf_escape($A)." = $W";}}$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"])||$Uc){$G=queries("$ab $F".($_POST["all"]?($Z?"\nWHERE ".implode(" AND ",$Z):""):"\nWHERE $Hg"));$sa=$h->affected_rows;}else{foreach((array)$_POST["check"]as$W){$G=queries($ab.limit1($F,"\nWHERE ".where_check($W,$n)));if(!$G)break;$sa+=$h->affected_rows;}}}$Ad=lang(226,$sa);if($_POST["clone"]&&$G&&$sa==1){$id=last_id();if($id)$Ad=lang(139," $id");}queries_redirect(remove_from_uri("page"),$Ad,$G);}elseif(!$_POST["import"]){if(!$_POST["val"])$l=lang(227);else{$G=true;$sa=0;foreach($_POST["val"]as$rg=>$I){$M=array();foreach($I
  16. as$w=>$W){$w=bracket_escape($w,1);$M[]=idf_escape($w)." = ".(ereg('char|text',$n[$w]["type"])||$W!=""?$b->processInput($n[$w],$W):"NULL");}$F=table($a)." SET ".implode(", ",$M);$Gg=" WHERE ".where_check($rg,$n).($Z?" AND ".implode(" AND ",$Z):"");$G=queries("UPDATE".($Uc?" $F$Gg":limit1($F,$Gg)));if(!$G)break;$sa+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(226,$sa),$G);}}elseif(is_string($lc=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]+)+~',$lc,$ud);$sa=count($ud[0]);begin();$rf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($ud[0]as$w=>$W){preg_match_all("~((?>\"[^\"]*\")+|[^$rf]*)$rf~",$W.$rf,$vd);if(!$w&&!array_diff($vd[1],$Za)){$Za=$vd[1];$sa--;}else{$M=array();foreach($vd[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,$Ge);if(!$G)break;}}if($G)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(228,$sa),$G);queries("ROLLBACK");}else$l=upload_error($lc);}}$Lf=$b->tableName($P);if(is_ajax())ob_start();page_header(lang(35).": $Lf",$l);$M=null;if(isset($ef["insert"])){$M="";foreach((array)$_GET["where"]as$W){if(count($sc[$W["col"]])==1&&($W["op"]=="="||(!$W["op"]&&!ereg('[_%]',$W["val"]))))$M.="&set".urlencode("[".bracket_escape($W["col"])."]")."=".urlencode($W["val"]);}}$b->selectLinks($P,$M);if(!$f)echo"<p class='error'>".lang(229).($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($ee,$f,$u);$b->selectLimitPrint($y);$b->selectLengthPrint($Vf);$b->selectActionPrint($u);echo"</form>\n";$C=$_GET["page"];if($C=="last"){$vc=$h->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$C=floor(max(0,$vc-1)/$y);}$F=$b->selectQueryBuild($K,$Z,$Bc,$ee,$y,$C);if(!$F)$F="SELECT".limit((+$y&&$Bc&&$Uc&&$v=="sql"?"SQL_CALC_FOUND_ROWS ":"").$xc,($Z?"\nWHERE ".implode(" AND ",$Z):"").$Cc,($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")$vc=(+$y&&$Bc&&$Uc?($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);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Bc&&$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(230)."</a>");$Ld=array();$zc=array();reset($K);$Qe=1;foreach($J[0]as$w=>$W){if($w!=$Rd){$W=$_GET["columns"][key($K)];$m=$n[$K?($W?$W["col"]:current($K)):$w];$A=($m?$b->fieldName($m,$Qe):"*");if($A!=""){$Qe++;$Ld[$w]=$A;$e=idf_escape($w);$Ic=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($Ic.($ee[0]==$e||$ee[0]==$w||(!$ee&&$Uc&&$Bc[0]==$e)?$yb:'')).'">';echo(!$K||$W?apply_sql_function($W["fun"],$A):h(current($K)))."</a>";echo"<span class='column hidden'>","<a href='".h($Ic.$yb)."' title='".lang(41)."' class='text'> ↓</a>";if(!$W["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($w)).'\'); return false;" title="'.lang(38).'" class="text jsonly"> =</a>';echo"</span>";}$zc[$w]=$W["fun"];next($K);}}$nd=array();if($_GET["modify"]){foreach($J


Back to Top