2014-05-08 19:46:08 +02:00
< ? php
/** Adminer - Compact database management
2017-06-25 00:56:50 +02:00
* @ link https :// www . adminer . org /
* @ author Jakub Vrana , https :// www . vrana . cz /
2014-05-08 19:46:08 +02:00
* @ copyright 2007 Jakub Vrana
2018-04-01 23:34:54 +02:00
* @ license https :// www . apache . org / licenses / LICENSE - 2.0 Apache License , Version 2.0
* @ license https :// www . gnu . org / licenses / gpl - 2.0 . html GNU General Public License , version 2 ( one or other )
* @ version 4.6 . 2
*/ error_reporting ( 6135 ); $Vc =! preg_match ( '~^(unsafe_raw)?$~' , ini_get ( " filter.default " )); if ( $Vc || ini_get ( " filter.default_flags " )){ foreach ( array ( '_GET' , '_POST' , '_COOKIE' , '_SERVER' ) as $X ){ $_i = filter_input_array ( constant ( " INPUT $X " ), FILTER_UNSAFE_RAW ); if ( $_i ) $$X = $_i ;}} if ( function_exists ( " mb_internal_encoding " )) mb_internal_encoding ( " 8bit " ); function
2017-06-25 00:56:50 +02:00
connection (){ global $g ; return $g ;} function
2018-04-01 23:34:54 +02:00
adminer (){ global $b ; return $b ;} function
version (){ global $ia ; return $ia ;} function
idf_unescape ( $v ){ $je = substr ( $v , - 1 ); return
str_replace ( $je . $je , $je , substr ( $v , 1 , - 1 ));} function
2014-05-08 19:46:08 +02:00
escape_string ( $X ){ return
substr ( q ( $X ), 1 , - 1 );} function
2015-07-03 19:50:03 +02:00
number ( $X ){ return
preg_replace ( '~[^0-9]+~' , '' , $X );} function
2018-04-01 23:34:54 +02:00
number_type (){ return '((?<!o)int(?!er)|numeric|real|float|double|decimal|money)' ;} function
remove_slashes ( $jg , $Vc = false ){ if ( get_magic_quotes_gpc ()){ while ( list ( $z , $X ) = each ( $jg )){ foreach ( $X
as $Yd => $W ){ unset ( $jg [ $z ][ $Yd ]); if ( is_array ( $W )){ $jg [ $z ][ stripslashes ( $Yd )] = $W ; $jg [] =& $jg [ $z ][ stripslashes ( $Yd )];} else $jg [ $z ][ stripslashes ( $Yd )] = ( $Vc ? $W : stripslashes ( $W ));}}}} function
bracket_escape ( $v , $Oa = false ){ static $ki = array ( ':' => ':1' , ']' => ':2' , '[' => ':3' , '"' => ':4' ); return
strtr ( $v ,( $Oa ? array_flip ( $ki ) : $ki ));} function
min_version ( $Qi , $xe = " " , $h = null ){ global $g ; if ( ! $h ) $h = $g ; $eh = $h -> server_info ; if ( $xe && preg_match ( '~([\d.]+)-MariaDB~' , $eh , $C )){ $eh = $C [ 1 ]; $Qi = $xe ;} return ( version_compare ( $eh , $Qi ) >= 0 );} function
charset ( $g ){ return ( min_version ( " 5.5.3 " , 0 , $g ) ? " utf8mb4 " : " utf8 " );} function
script ( $nh , $ji = " \n " ){ return " <script " . nonce () . " > $nh </script> $ji " ;} function
script_src ( $Ei ){ return " <script src=' " . h ( $Ei ) . " ' " . nonce () . " ></script> \n " ;} function
nonce (){ return ' nonce="' . get_nonce () . '"' ;} function
target_blank (){ return ' target="_blank" rel="noreferrer noopener"' ;} function
h ( $Q ){ return
str_replace ( " \0 " , " � " , htmlspecialchars ( $Q , ENT_QUOTES , 'utf-8' ));} function
nbsp ( $Q ){ return ( trim ( $Q ) != " " ? h ( $Q ) : " " );} function
nl_br ( $Q ){ return
str_replace ( " \n " , " <br> " , $Q );} function
checkbox ( $D , $Y , $fb , $fe = " " , $lf = " " , $kb = " " , $ge = " " ){ $J = " <input type='checkbox' name=' $D ' value=' " . h ( $Y ) . " ' " . ( $fb ? " checked " : " " ) . ( $ge ? " aria-labelledby=' $ge ' " : " " ) . " > " . ( $lf ? script ( " qsl('input').onclick = function () { $lf }; " , " " ) : " " ); return ( $fe != " " || $kb ? " <label " . ( $kb ? " class=' $kb ' " : " " ) . " > $J " . h ( $fe ) . " </label> " : $J );} function
optionlist ( $rf , $Yg = null , $Ii = false ){ $J = " " ; foreach ( $rf
as $Yd => $W ){ $sf = array ( $Yd => $W ); if ( is_array ( $W )){ $J .= '<optgroup label="' . h ( $Yd ) . '">' ; $sf = $W ;} foreach ( $sf
as $z => $X ) $J .= '<option' . ( $Ii || is_string ( $z ) ? ' value="' . h ( $z ) . '"' : '' ) . (( $Ii || is_string ( $z ) ? ( string ) $z : $X ) === $Yg ? ' selected' : '' ) . '>' . h ( $X ); if ( is_array ( $W )) $J .= '</optgroup>' ;} return $J ;} function
html_select ( $D , $rf , $Y = " " , $kf = true , $ge = " " ){ if ( $kf ) return " <select name=' " . h ( $D ) . " ' " . ( $ge ? " aria-labelledby=' $ge ' " : " " ) . " > " . optionlist ( $rf , $Y ) . " </select> " . ( is_string ( $kf ) ? script ( " qsl('select').onchange = function () { $kf }; " , " " ) : " " ); $J = " " ; foreach ( $rf
as $z => $X ) $J .= " <label><input type='radio' name=' " . h ( $D ) . " ' value=' " . h ( $z ) . " ' " . ( $z == $Y ? " checked " : " " ) . " > " . h ( $X ) . " </label> " ; return $J ;} function
select_input ( $Ka , $rf , $Y = " " , $kf = " " , $Vf = " " ){ $Oh = ( $rf ? " select " : " input " ); return " < $Oh $Ka " . ( $rf ? " ><option value=''> $Vf " . optionlist ( $rf , $Y , true ) . " </select> " : " size='10' value=' " . h ( $Y ) . " ' placeholder=' $Vf '> " ) . ( $kf ? script ( " qsl(' $Oh ').onchange = $kf ; " , " " ) : " " );} function
confirm ( $Ge = " " , $Zg = " qsl('input') " ){ return
script ( " $Zg .onclick = function () { return confirm(' " . ( $Ge ? js_escape ( $Ge ) : lang ( 0 )) . " '); }; " , " " );} function
print_fieldset ( $u , $oe , $Ti = false ){ echo " <fieldset><legend> " , " <a href='#fieldset- $u '> $oe </a> " , script ( " qsl('a').onclick = partial(toggle, 'fieldset- $u '); " , " " ), " </legend> " , " <div id='fieldset- $u ' " . ( $Ti ? " " : " class='hidden' " ) . " > \n " ;} function
bold ( $Wa , $kb = " " ){ return ( $Wa ? " class='active $kb ' " : ( $kb ? " class=' $kb ' " : " " ));} function
odd ( $J = ' class="odd"' ){ static $t = 0 ; if ( ! $J ) $t =- 1 ; return ( $t ++% 2 ? $J : '' );} function
js_escape ( $Q ){ return
addcslashes ( $Q , " \r \n ' \\ / " );} function
json_row ( $z , $X = null ){ static $Wc = true ; if ( $Wc ) echo " { " ; if ( $z != " " ){ echo ( $Wc ? " " : " , " ) . " \n \t \" " . addcslashes ( $z , " \r \n \t \" \\ / " ) . '": ' . ( $X !== null ? '"' . addcslashes ( $X , " \r \n \" \\ / " ) . '"' : 'null' ); $Wc = false ;} else { echo " \n } \n " ; $Wc = true ;}} function
ini_bool ( $Ld ){ $X = ini_get ( $Ld ); return ( preg_match ( '~^(on|true|yes)$~i' , $X ) || ( int ) $X );} function
sid (){ static $J ; if ( $J === null ) $J = ( SID &&! ( $_COOKIE && ini_bool ( " session.use_cookies " ))); return $J ;} function
set_password ( $Pi , $O , $V , $G ){ $_SESSION [ " pwds " ][ $Pi ][ $O ][ $V ] = ( $_COOKIE [ " adminer_key " ] && is_string ( $G ) ? array ( encrypt_string ( $G , $_COOKIE [ " adminer_key " ])) : $G );} function
get_password (){ $J = get_session ( " pwds " ); if ( is_array ( $J )) $J = ( $_COOKIE [ " adminer_key " ] ? decrypt_string ( $J [ 0 ], $_COOKIE [ " adminer_key " ]) : false ); return $J ;} function
q ( $Q ){ global $g ; return $g -> quote ( $Q );} function
get_vals ( $H , $d = 0 ){ global $g ; $J = array (); $I = $g -> query ( $H ); if ( is_object ( $I )){ while ( $K = $I -> fetch_row ()) $J [] = $K [ $d ];} return $J ;} function
get_key_vals ( $H , $h = null , $Xh = 0 , $hh = true ){ global $g ; if ( ! is_object ( $h )) $h = $g ; $J = array (); $h -> timeout = $Xh ; $I = $h -> query ( $H ); $h -> timeout = 0 ; if ( is_object ( $I )){ while ( $K = $I -> fetch_row ()){ if ( $hh ) $J [ $K [ 0 ]] = $K [ 1 ]; else $J [] = $K [ 0 ];}} return $J ;} function
get_rows ( $H , $h = null , $o = " <p class='error'> " ){ global $g ; $yb = ( is_object ( $h ) ? $h : $g ); $J = array (); $I = $yb -> query ( $H ); if ( is_object ( $I )){ while ( $K = $I -> fetch_assoc ()) $J [] = $K ;} elseif ( ! $I &&! is_object ( $h ) && $o && defined ( " PAGE_HEADER " )) echo $o . error () . " \n " ; return $J ;} function
unique_array ( $K , $x ){ foreach ( $x
as $w ){ if ( preg_match ( " ~PRIMARY|UNIQUE~ " , $w [ " type " ])){ $J = array (); foreach ( $w [ " columns " ] as $z ){ if ( ! isset ( $K [ $z ])) continue
2 ; $J [ $z ] = $K [ $z ];} return $J ;}}} function
2017-06-25 00:56:50 +02:00
escape_key ( $z ){ if ( preg_match ( '(^([\w(]+)(' . str_replace ( " _ " , " .* " , preg_quote ( idf_escape ( " _ " ))) . ')([ \w)]+)$)' , $z , $C )) return $C [ 1 ] . idf_escape ( idf_unescape ( $C [ 2 ])) . $C [ 3 ]; return
idf_escape ( $z );} function
2018-04-01 23:34:54 +02:00
where ( $Z , $q = array ()){ global $g , $y ; $J = array (); foreach (( array ) $Z [ " where " ] as $z => $X ){ $z = bracket_escape ( $z , 1 ); $d = escape_key ( $z ); $J [] = $d . ( $y == " sql " && preg_match ( '~^[0-9]*\\.[0-9]*$~' , $X ) ? " LIKE " . q ( addcslashes ( $X , " %_ \\ " )) : ( $y == " mssql " ? " LIKE " . q ( preg_replace ( '~[_%[]~' , '[\0]' , $X )) : " = " . unconvert_field ( $q [ $z ], q ( $X )))); if ( $y == " sql " && preg_match ( '~char|text~' , $q [ $z ][ " type " ]) && preg_match ( " ~[^ -@]~ " , $X )) $J [] = " $d = " . q ( $X ) . " COLLATE " . charset ( $g ) . " _bin " ;} foreach (( array ) $Z [ " null " ] as $z ) $J [] = escape_key ( $z ) . " IS NULL " ; return
implode ( " AND " , $J );} function
where_check ( $X , $q = array ()){ parse_str ( $X , $db ); remove_slashes ( array ( & $db )); return
where ( $db , $q );} function
where_link ( $t , $d , $Y , $nf = " = " ){ return " &where%5B $t %5D%5Bcol%5D= " . urlencode ( $d ) . " &where%5B $t %5D%5Bop%5D= " . urlencode (( $Y !== null ? $nf : " IS NULL " )) . " &where%5B $t %5D%5Bval%5D= " . urlencode ( $Y );} function
convert_fields ( $e , $q , $M = array ()){ $J = " " ; foreach ( $e
as $z => $X ){ if ( $M &&! in_array ( idf_escape ( $z ), $M )) continue ; $Ha = convert_field ( $q [ $z ]); if ( $Ha ) $J .= " , $Ha AS " . idf_escape ( $z );} return $J ;} function
cookie ( $D , $Y , $re = 2592000 ){ global $ba ; return
header ( " Set-Cookie: $D = " . urlencode ( $Y ) . ( $re ? " ; expires= " . gmdate ( " D, d M Y H:i:s " , time () + $re ) . " GMT " : " " ) . " ; path= " . preg_replace ( '~\\?.*~' , '' , $_SERVER [ " REQUEST_URI " ]) . ( $ba ? " ; secure " : " " ) . " ; HttpOnly; SameSite=lax " , false );} function
2014-05-08 19:46:08 +02:00
restart_session (){ if ( ! ini_bool ( " session.use_cookies " )) session_start ();} function
2017-06-25 00:56:50 +02:00
stop_session (){ if ( ! ini_bool ( " session.use_cookies " )) session_write_close ();} function & get_session ( $z ){ return $_SESSION [ $z ][ DRIVER ][ SERVER ][ $_GET [ " username " ]];} function
set_session ( $z , $X ){ $_SESSION [ $z ][ DRIVER ][ SERVER ][ $_GET [ " username " ]] = $X ;} function
2018-04-01 23:34:54 +02:00
auth_url ( $Pi , $O , $V , $m = null ){ global $ec ; preg_match ( '~([^?]*)\\??(.*)~' , remove_from_uri ( implode ( " | " , array_keys ( $ec )) . " |username| " . ( $m !== null ? " db| " : " " ) . session_name ()), $C ); return " $C[1] ? " . ( sid () ? SID . " & " : " " ) . ( $Pi != " server " || $O != " " ? urlencode ( $Pi ) . " = " . urlencode ( $O ) . " & " : " " ) . " username= " . urlencode ( $V ) . ( $m != " " ? " &db= " . urlencode ( $m ) : " " ) . ( $C [ 2 ] ? " & $C[2] " : " " );} function
2014-05-08 19:46:08 +02:00
is_ajax (){ return ( $_SERVER [ " HTTP_X_REQUESTED_WITH " ] == " XMLHttpRequest " );} function
2018-04-01 23:34:54 +02:00
redirect ( $B , $Ge = null ){ if ( $Ge !== null ){ restart_session (); $_SESSION [ " messages " ][ preg_replace ( '~^[^?]*~' , '' ,( $B !== null ? $B : $_SERVER [ " REQUEST_URI " ]))][] = $Ge ;} if ( $B !== null ){ if ( $B == " " ) $B = " . " ; header ( " Location: $B " ); exit ;}} function
query_redirect ( $H , $B , $Ge , $vg = true , $Cc = true , $Nc = false , $Wh = " " ){ global $g , $o , $b ; if ( $Cc ){ $vh = microtime ( true ); $Nc =! $g -> query ( $H ); $Wh = format_time ( $vh );} $qh = " " ; if ( $H ) $qh = $b -> messageQuery ( $H , $Wh , $Nc ); if ( $Nc ){ $o = error () . $qh . script ( " messagesPrint(); " ); return
false ;} if ( $vg ) redirect ( $B , $Ge . $qh ); return
true ;} function
queries ( $H ){ global $g ; static $og = array (); static $vh ; if ( ! $vh ) $vh = microtime ( true ); if ( $H === null ) return
array ( implode ( " \n " , $og ), format_time ( $vh )); $og [] = ( preg_match ( '~;$~' , $H ) ? " DELIMITER ;; \n $H ; \n DELIMITER " : $H ) . " ; " ; return $g -> query ( $H );} function
apply_queries ( $H , $T , $zc = 'table' ){ foreach ( $T
as $R ){ if ( ! queries ( " $H " . $zc ( $R ))) return
2014-05-08 19:46:08 +02:00
false ;} return
true ;} function
2018-04-01 23:34:54 +02:00
queries_redirect ( $B , $Ge , $vg ){ list ( $og , $Wh ) = queries ( null ); return
query_redirect ( $og , $B , $Ge , $vg , false , ! $vg , $Wh );} function
format_time ( $vh ){ return
lang ( 1 , max ( 0 , microtime ( true ) - $vh ));} function
remove_from_uri ( $Gf = " " ){ return
substr ( preg_replace ( " ~(?<=[?&])( $Gf " . ( SID ? " " : " | " . session_name ()) . " )=[^&]*&~ " , '' , " $_SERVER[REQUEST_URI] & " ), 0 , - 1 );} function
pagination ( $F , $Jb ){ return " " . ( $F == $Jb ? $F + 1 : '<a href="' . h ( remove_from_uri ( " page " ) . ( $F ? " &page= $F " . ( $_GET [ " next " ] ? " &next= " . urlencode ( $_GET [ " next " ]) : " " ) : " " )) . '">' . ( $F + 1 ) . " </a> " );} function
get_file ( $z , $Rb = false ){ $Tc = $_FILES [ $z ]; if ( ! $Tc ) return
null ; foreach ( $Tc
as $z => $X ) $Tc [ $z ] = ( array ) $X ; $J = '' ; foreach ( $Tc [ " error " ] as $z => $o ){ if ( $o ) return $o ; $D = $Tc [ " name " ][ $z ]; $ei = $Tc [ " tmp_name " ][ $z ]; $_b = file_get_contents ( $Rb && preg_match ( '~\\.gz$~' , $D ) ? " compress.zlib:// $ei " : $ei ); if ( $Rb ){ $vh = substr ( $_b , 0 , 3 ); if ( function_exists ( " iconv " ) && preg_match ( " ~^ \xFE \xFF |^ \xFF \xFE ~ " , $vh , $Ag )) $_b = iconv ( " utf-16 " , " utf-8 " , $_b ); elseif ( $vh == " \xEF \xBB \xBF " ) $_b = substr ( $_b , 3 ); $J .= $_b . " \n \n " ;} else $J .= $_b ;} return $J ;} function
upload_error ( $o ){ $De = ( $o == UPLOAD_ERR_INI_SIZE ? ini_get ( " upload_max_filesize " ) : 0 ); return ( $o ? lang ( 2 ) . ( $De ? " " . lang ( 3 , $De ) : " " ) : lang ( 4 ));} function
repeat_pattern ( $Tf , $pe ){ return
str_repeat ( " $Tf { 0,65535} " , $pe / 65535 ) . " $Tf { 0, " . ( $pe % 65535 ) . " } " ;} function
2014-05-08 19:46:08 +02:00
is_utf8 ( $X ){ return ( preg_match ( '~~u' , $X ) &&! preg_match ( '~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~' , $X ));} function
2018-04-01 23:34:54 +02:00
shorten_utf8 ( $Q , $pe = 80 , $Ch = " " ){ if ( ! preg_match ( " (^( " . repeat_pattern ( " [ \t \r \n - \ x { 10FFFF}] " , $pe ) . " )( $ )?)u " , $Q , $C )) preg_match ( " (^( " . repeat_pattern ( " [ \t \r \n -~] " , $pe ) . " )( $ )?) " , $Q , $C ); return
h ( $C [ 1 ]) . $Ch . ( isset ( $C [ 2 ]) ? " " : " <i>...</i> " );} function
2014-05-08 19:46:08 +02:00
format_number ( $X ){ return
strtr ( number_format ( $X , 0 , " . " , lang ( 5 )), preg_split ( '~~u' , lang ( 6 ), - 1 , PREG_SPLIT_NO_EMPTY ));} function
friendly_url ( $X ){ return
preg_replace ( '~[^a-z0-9_]~i' , '-' , $X );} function
2018-04-01 23:34:54 +02:00
hidden_fields ( $jg , $Bd = array ()){ $J = false ; while ( list ( $z , $X ) = each ( $jg )){ if ( ! in_array ( $z , $Bd )){ if ( is_array ( $X )){ foreach ( $X
as $Yd => $W ) $jg [ $z . " [ $Yd ] " ] = $W ;} else { $J = true ; echo '<input type="hidden" name="' . h ( $z ) . '" value="' . h ( $X ) . '">' ;}}} return $J ;} function
2014-05-08 19:46:08 +02:00
hidden_fields_get (){ echo ( sid () ? '<input type="hidden" name="' . session_name () . '" value="' . h ( session_id ()) . '">' : '' ),( SERVER !== null ? '<input type="hidden" name="' . DRIVER . '" value="' . h ( SERVER ) . '">' : " " ), '<input type="hidden" name="username" value="' . h ( $_GET [ " username " ]) . '">' ;} function
2018-04-01 23:34:54 +02:00
table_status1 ( $R , $Oc = false ){ $J = table_status ( $R , $Oc ); return ( $J ? $J : array ( " Name " => $R ));} function
column_foreign_keys ( $R ){ global $b ; $J = array (); foreach ( $b -> foreignKeys ( $R ) as $r ){ foreach ( $r [ " source " ] as $X ) $J [ $X ][] = $r ;} return $J ;} function
enum_input ( $U , $Ka , $p , $Y , $tc = null ){ global $b ; preg_match_all ( " ~'((?:[^']|'')*)'~ " , $p [ " length " ], $ze ); $J = ( $tc !== null ? " <label><input type=' $U ' $Ka value=' $tc ' " . (( is_array ( $Y ) ? in_array ( $tc , $Y ) : $Y === 0 ) ? " checked " : " " ) . " ><i> " . lang ( 7 ) . " </i></label> " : " " ); foreach ( $ze [ 1 ] as $t => $X ){ $X = stripcslashes ( str_replace ( " '' " , " ' " , $X )); $fb = ( is_int ( $Y ) ? $Y == $t + 1 : ( is_array ( $Y ) ? in_array ( $t + 1 , $Y ) : $Y === $X )); $J .= " <label><input type=' $U ' $Ka value=' " . ( $t + 1 ) . " ' " . ( $fb ? ' checked' : '' ) . '>' . h ( $b -> editVal ( $X , $p )) . '</label>' ;} return $J ;} function
input ( $p , $Y , $s ){ global $vi , $b , $y ; $D = h ( bracket_escape ( $p [ " field " ])); echo " <td class='function'> " ; if ( is_array ( $Y ) &&! $s ){ $Fa = array ( $Y ); if ( version_compare ( PHP_VERSION , 5.4 ) >= 0 ) $Fa [] = JSON_PRETTY_PRINT ; $Y = call_user_func_array ( 'json_encode' , $Fa ); $s = " json " ;} $Eg = ( $y == " mssql " && $p [ " auto_increment " ]); if ( $Eg &&! $_POST [ " save " ]) $s = null ; $jd = ( isset ( $_GET [ " select " ]) || $Eg ? array ( " orig " => lang ( 8 )) : array ()) + $b -> editFunctions ( $p ); $Ka = " name='fields[ $D ]' " ; if ( $p [ " type " ] == " enum " ) echo
nbsp ( $jd [ " " ]) . " <td> " . $b -> editInput ( $_GET [ " edit " ], $p , $Ka , $Y ); else { $sd = ( in_array ( $s , $jd ) || isset ( $jd [ $s ])); echo ( count ( $jd ) > 1 ? " <select name='function[ $D ]'> " . optionlist ( $jd , $s === null || $sd ? $s : " " ) . " </select> " . on_help ( " getTarget(event).value.replace(/^SQL \$ /, '') " , 1 ) . script ( " qsl('select').onchange = functionChange; " , " " ) : nbsp ( reset ( $jd ))) . '<td>' ; $Nd = $b -> editInput ( $_GET [ " edit " ], $p , $Ka , $Y ); if ( $Nd != " " ) echo $Nd ; elseif ( preg_match ( '~bool~' , $p [ " type " ])) echo " <input type='hidden' $Ka value='0'> " . " <input type='checkbox' " . ( preg_match ( '~^(1|t|true|y|yes|on)$~i' , $Y ) ? " checked='checked' " : " " ) . " $Ka value='1'> " ; elseif ( $p [ " type " ] == " set " ){ preg_match_all ( " ~'((?:[^']|'')*)'~ " , $p [ " length " ], $ze ); foreach ( $ze [ 1 ] as $t => $X ){ $X = stripcslashes ( str_replace ( " '' " , " ' " , $X )); $fb = ( is_int ( $Y ) ? ( $Y >> $t ) & 1 : in_array ( $X , explode ( " , " , $Y ), true )); echo " <label><input type='checkbox' name='fields[ $D ][ $t ]' value=' " . ( 1 << $t ) . " ' " . ( $fb ? ' checked' : '' ) . " > " . h ( $b -> editVal ( $X , $p )) . '</label>' ;}} elseif ( preg_match ( '~blob|bytea|raw|file~' , $p [ " type " ]) && ini_bool ( " file_uploads " )) echo " <input type='file' name='fields- $D '> " ; elseif (( $Uh = preg_match ( '~text|lob~' , $p [ " type " ])) || preg_match ( " ~ \n ~ " , $Y )){ if ( $Uh && $y != " sqlite " ) $Ka .= " cols='50' rows='12' " ; else { $L = min ( 12 , substr_count ( $Y , " \n " ) + 1 ); $Ka .= " cols='30' rows=' $L ' " . ( $L == 1 ? " style='height: 1.2em;' " : " " );} echo " <textarea $Ka > " . h ( $Y ) . '</textarea>' ;} elseif ( $s == " json " || preg_match ( '~^jsonb?$~' , $p [ " type " ])) echo " <textarea $Ka cols='50' rows='12' class='jush-js'> " . h ( $Y ) . '</textarea>' ; else { $Fe = ( ! preg_match ( '~int~' , $p [ " type " ]) && preg_match ( '~^(\\d+)(,(\\d+))?$~' , $p [ " length " ], $C ) ? (( preg_match ( " ~binary~ " , $p [ " type " ]) ? 2 : 1 ) * $C [ 1 ] + ( $C [ 3 ] ? 1 : 0 ) + ( $C [ 2 ] &&! $p [ " unsigned " ] ? 1 : 0 )) : ( $vi [ $p [ " type " ]] ? $vi [ $p [ " type " ]] + ( $p [ " unsigned " ] ? 0 : 1 ) : 0 )); if ( $y == 'sql' && min_version ( 5.6 ) && preg_match ( '~time~' , $p [ " type " ])) $Fe += 7 ; echo " <input " . (( ! $sd || $s === " " ) && preg_match ( '~(?<!o)int(?!er)~' , $p [ " type " ]) &&! preg_match ( '~\[\]~' , $p [ " full_type " ]) ? " type='number' " : " " ) . " value=' " . h ( $Y ) . " ' " . ( $Fe ? " data-maxlength=' $Fe ' " : " " ) . ( preg_match ( '~char|binary~' , $p [ " type " ]) && $Fe > 20 ? " size='40' " : " " ) . " $Ka > " ;} echo $b -> editHint ( $_GET [ " edit " ], $p , $Y ); $Wc = 0 ; foreach ( $jd
as $z => $X ){ if ( $z === " " ||! $X ) break ; $Wc ++ ;} if ( $Wc ) echo
script ( " mixin(qsl('td'), { onchange: partial(skipOriginal, $Wc ), oninput: function () { this.onchange(); }}); " );}} function
process_input ( $p ){ global $b , $n ; $v = bracket_escape ( $p [ " field " ]); $s = $_POST [ " function " ][ $v ]; $Y = $_POST [ " fields " ][ $v ]; if ( $p [ " type " ] == " enum " ){ if ( $Y ==- 1 ) return
false ; if ( $Y == " " ) return " NULL " ; return + $Y ;} if ( $p [ " auto_increment " ] && $Y == " " ) return
null ; if ( $s == " orig " ) return ( $p [ " on_update " ] == " CURRENT_TIMESTAMP " ? idf_escape ( $p [ " field " ]) : false ); if ( $s == " NULL " ) return " NULL " ; if ( $p [ " type " ] == " set " ) return
array_sum (( array ) $Y ); if ( $s == " json " ){ $s = " " ; $Y = json_decode ( $Y , true ); if ( ! is_array ( $Y )) return
false ; return $Y ;} if ( preg_match ( '~blob|bytea|raw|file~' , $p [ " type " ]) && ini_bool ( " file_uploads " )){ $Tc = get_file ( " fields- $v " ); if ( ! is_string ( $Tc )) return
false ; return $n -> quoteBinary ( $Tc );} return $b -> processInput ( $p , $Y , $s );} function
fields_from_edit (){ global $n ; $J = array (); foreach (( array ) $_POST [ " field_keys " ] as $z => $X ){ if ( $X != " " ){ $X = bracket_escape ( $X ); $_POST [ " function " ][ $X ] = $_POST [ " field_funs " ][ $z ]; $_POST [ " fields " ][ $X ] = $_POST [ " field_vals " ][ $z ];}} foreach (( array ) $_POST [ " fields " ] as $z => $X ){ $D = bracket_escape ( $z , 1 ); $J [ $D ] = array ( " field " => $D , " privileges " => array ( " insert " => 1 , " update " => 1 ), " null " => 1 , " auto_increment " => ( $z == $n -> primary ),);} return $J ;} function
search_tables (){ global $b , $g ; $_GET [ " where " ][ 0 ][ " val " ] = $_POST [ " query " ]; $bh = " <ul> \n " ; foreach ( table_status ( '' , true ) as $R => $S ){ $D = $b -> tableName ( $S ); if ( isset ( $S [ " Engine " ]) && $D != " " && ( ! $_POST [ " tables " ] || in_array ( $R , $_POST [ " tables " ]))){ $I = $g -> query ( " SELECT " . limit ( " 1 FROM " . table ( $R ), " WHERE " . implode ( " AND " , $b -> selectSearchProcess ( fields ( $R ), array ())), 1 )); if ( ! $I || $I -> fetch_row ()){ $fg = " <a href=' " . h ( ME . " select= " . urlencode ( $R ) . " &where[0][op]= " . urlencode ( $_GET [ " where " ][ 0 ][ " op " ]) . " &where[0][val]= " . urlencode ( $_GET [ " where " ][ 0 ][ " val " ])) . " '> $D </a> " ; echo " $bh <li> " . ( $I ? $fg : " <p class='error'> $fg : " . error ()) . " \n " ; $bh = " " ;}}} echo ( $bh ? " <p class='message'> " . lang ( 9 ) : " </ul> " ) . " \n " ;} function
dump_headers ( $_d , $Pe = false ){ global $b ; $J = $b -> dumpHeaders ( $_d , $Pe ); $Df = $_POST [ " output " ]; if ( $Df != " text " ) header ( " Content-Disposition: attachment; filename= " . $b -> dumpFilename ( $_d ) . " . $J " . ( $Df != " file " &&! preg_match ( '~[^0-9a-z]~' , $Df ) ? " . $Df " : " " )); session_write_close (); ob_flush (); flush (); return $J ;} function
dump_csv ( $K ){ foreach ( $K
as $z => $X ){ if ( preg_match ( " ~[ \" \n ,; \t ]~ " , $X ) || $X === " " ) $K [ $z ] = '"' . str_replace ( '"' , '""' , $X ) . '"' ;} echo
implode (( $_POST [ " format " ] == " csv " ? " , " : ( $_POST [ " format " ] == " tsv " ? " \t " : " ; " )), $K ) . " \r \n " ;} function
apply_sql_function ( $s , $d ){ return ( $s ? ( $s == " unixepoch " ? " DATETIME( $d , ' $s ') " : ( $s == " count distinct " ? " COUNT(DISTINCT " : strtoupper ( " $s ( " )) . " $d ) " ) : $d );} function
get_temp_dir (){ $J = ini_get ( " upload_tmp_dir " ); if ( ! $J ){ if ( function_exists ( 'sys_get_temp_dir' )) $J = sys_get_temp_dir (); else { $Uc =@ tempnam ( " " , " " ); if ( ! $Uc ) return
false ; $J = dirname ( $Uc ); unlink ( $Uc );}} return $J ;} function
file_open_lock ( $Uc ){ $hd =@ fopen ( $Uc , " r+ " ); if ( ! $hd ){ $hd =@ fopen ( $Uc , " w " ); if ( ! $hd ) return ; chmod ( $Uc , 0660 );} flock ( $hd , LOCK_EX ); return $hd ;} function
file_write_unlock ( $hd , $Lb ){ rewind ( $hd ); fwrite ( $hd , $Lb ); ftruncate ( $hd , strlen ( $Lb )); flock ( $hd , LOCK_UN ); fclose ( $hd );} function
password_file ( $i ){ $Uc = get_temp_dir () . " /adminer.key " ; $J =@ file_get_contents ( $Uc ); if ( $J ||! $i ) return $J ; $hd =@ fopen ( $Uc , " w " ); if ( $hd ){ chmod ( $Uc , 0660 ); $J = rand_string (); fwrite ( $hd , $J ); fclose ( $hd );} return $J ;} function
2014-05-08 19:46:08 +02:00
rand_string (){ return
md5 ( uniqid ( mt_rand (), true ));} function
2018-04-01 23:34:54 +02:00
select_value ( $X , $A , $p , $Vh ){ global $b ; if ( is_array ( $X )){ $J = " " ; foreach ( $X
as $Yd => $W ) $J .= " <tr> " . ( $X != array_values ( $X ) ? " <th> " . h ( $Yd ) : " " ) . " <td> " . select_value ( $W , $A , $p , $Vh ); return " <table cellspacing='0'> $J </table> " ;} if ( ! $A ) $A = $b -> selectLink ( $X , $p ); if ( $A === null ){ if ( is_mail ( $X )) $A = " mailto: $X " ; if ( is_url ( $X )) $A = $X ;} $J = $b -> editVal ( $X , $p ); if ( $J !== null ){ if ( $J === " " ) $J = " " ; elseif ( ! is_utf8 ( $J )) $J = " \0 " ; elseif ( $Vh != " " && is_shortable ( $p )) $J = shorten_utf8 ( $J , max ( 0 , + $Vh )); else $J = h ( $J );} return $b -> selectVal ( $J , $A , $p , $X );} function
is_mail ( $qc ){ $Ia = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]' ; $dc = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])' ; $Tf = " $Ia +( \\ . $Ia +)*@( $dc ? \\ .)+ $dc " ; return
is_string ( $qc ) && preg_match ( " (^ $Tf (, \\ s* $Tf )* \$ )i " , $qc );} function
is_url ( $Q ){ $dc = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])' ; return
preg_match ( " ~^(https?)://( $dc ? \\ .)+ $dc (: \\ d+)?(/.*)?( \\ ?.*)?(#.*)? \$ ~i " , $Q );} function
is_shortable ( $p ){ return
preg_match ( '~char|text|json|lob|geometry|point|linestring|polygon|string|bytea~' , $p [ " type " ]);} function
count_rows ( $R , $Z , $Td , $md ){ global $y ; $H = " FROM " . table ( $R ) . ( $Z ? " WHERE " . implode ( " AND " , $Z ) : " " ); return ( $Td && ( $y == " sql " || count ( $md ) == 1 ) ? " SELECT COUNT(DISTINCT " . implode ( " , " , $md ) . " ) $H " : " SELECT COUNT(*) " . ( $Td ? " FROM (SELECT 1 $H GROUP BY " . implode ( " , " , $md ) . " ) x " : $H ));} function
slow_query ( $H ){ global $b , $gi ; $m = $b -> database (); $Xh = $b -> queryTimeout (); if ( support ( " kill " ) && is_object ( $h = connect ()) && ( $m == " " || $h -> select_db ( $m ))){ $de = $h -> result ( connection_id ()); echo '<script' , nonce (), ' >
2014-05-08 19:46:08 +02:00
var timeout = setTimeout ( function () {
ajax ( \ '' , js_escape ( ME ), ' script = kill\ ' , function () {
2018-04-01 23:34:54 +02:00
}, \ 'kill=' , $de , '&token=' , $gi , ' \ ' );
}, ',1000*$Xh,' );
2014-05-08 19:46:08 +02:00
</ script >
2018-04-01 23:34:54 +02:00
' ;} else $h = null ; ob_flush (); flush (); $J =@ get_key_vals ( $H , $h , $Xh , false ); if ( $h ){ echo
script ( " clearTimeout(timeout); " ); ob_flush (); flush ();} return $J ;} function
get_token (){ $rg = rand ( 1 , 1e6 ); return ( $rg ^ $_SESSION [ " token " ]) . " : $rg " ;} function
verify_token (){ list ( $gi , $rg ) = explode ( " : " , $_POST [ " token " ]); return ( $rg ^ $_SESSION [ " token " ]) == $gi ;} function
lzw_decompress ( $Sa ){ $Zb = 256 ; $Ta = 8 ; $mb = array (); $Gg = 0 ; $Hg = 0 ; for ( $t = 0 ; $t < strlen ( $Sa ); $t ++ ){ $Gg = ( $Gg << 8 ) + ord ( $Sa [ $t ]); $Hg += 8 ; if ( $Hg >= $Ta ){ $Hg -= $Ta ; $mb [] = $Gg >> $Hg ; $Gg &= ( 1 << $Hg ) - 1 ; $Zb ++ ; if ( $Zb >> $Ta ) $Ta ++ ;}} $Yb = range ( " \0 " , " \xFF " ); $J = " " ; foreach ( $mb
as $t => $lb ){ $pc = $Yb [ $lb ]; if ( ! isset ( $pc )) $pc = $ej . $ej [ 0 ]; $J .= $pc ; if ( $t ) $Yb [] = $ej . $pc [ 0 ]; $ej = $pc ;} return $J ;} function
on_help ( $tb , $ih = 0 ){ return
script ( " mixin(qsl('select, input'), { onmouseover: function (event) { helpMouseover.call(this, event, $tb , $ih ) }, onmouseout: helpMouseout}); " , " " );} function
edit_form ( $a , $q , $K , $Ci ){ global $b , $y , $gi , $o ; $Hh = $b -> tableName ( table_status1 ( $a , true )); page_header (( $Ci ? lang ( 10 ) : lang ( 11 )), $o , array ( " select " => array ( $a , $Hh )), $Hh ); if ( $K === false ) echo " <p class='error'> " . lang ( 12 ) . " \n " ; echo ' < form action = " " method = " post " enctype = " multipart/form-data " id = " form " >
';if(!$q)echo"<p class=' error '>".lang(13)."\n";else{echo"<table cellspacing=' 0 '>".script("qsl(' table ' ) . onkeydown = editingKeydown ; " );foreach( $q
as $D => $p ){ echo " <tr><th> " . $b -> fieldName ( $p ); $Sb = $_GET [ " set " ][ bracket_escape ( $D )]; if ( $Sb === null ){ $Sb = $p [ " default " ]; if ( $p [ " type " ] == " bit " && preg_match ( " ~^b'([01]*)' \$ ~ " , $Sb , $Ag )) $Sb = $Ag [ 1 ];} $Y = ( $K !== null ? ( $K [ $D ] != " " && $y == " sql " && preg_match ( " ~enum|set~ " , $p [ " type " ]) ? ( is_array ( $K [ $D ]) ? array_sum ( $K [ $D ]) :+ $K [ $D ]) : $K [ $D ]) : ( ! $Ci && $p [ " auto_increment " ] ? " " : ( isset ( $_GET [ " select " ]) ? false : $Sb ))); if ( ! $_POST [ " save " ] && is_string ( $Y )) $Y = $b -> editVal ( $Y , $p ); $s = ( $_POST [ " save " ] ? ( string ) $_POST [ " function " ][ $D ] : ( $Ci && $p [ " on_update " ] == " CURRENT_TIMESTAMP " ? " now " : ( $Y === false ? null : ( $Y !== null ? '' : 'NULL' )))); if ( preg_match ( " ~time~ " , $p [ " type " ]) && $Y == " CURRENT_TIMESTAMP " ){ $Y = " " ; $s = " now " ;} input ( $p , $Y , $s ); echo " \n " ;} if ( ! support ( " table " )) echo " <tr> " . " <th><input name='field_keys[]'> " . script ( " qsl('input').oninput = fieldChange; " ) . " <td class='function'> " . html_select ( " field_funs[] " , $b -> editFunctions ( array ( " null " => isset ( $_GET [ " select " ])))) . " <td><input name='field_vals[]'> " . " \n " ; echo " </table> \n " ;} echo " <p> \n " ; if ( $q ){ echo " <input type='submit' value=' " . lang ( 14 ) . " '> \n " ; if ( ! isset ( $_GET [ " select " ])){ echo " <input type='submit' name='insert' value=' " . ( $Ci ? lang ( 15 ) : lang ( 16 )) . " ' title='Ctrl+Shift+Enter'> \n " ,( $Ci ? script ( " qsl('input').onclick = function () { return !ajaxForm(this.form, ' " . lang ( 17 ) . " ...', this); }; " ) : " " );}} echo ( $Ci ? " <input type='submit' name='delete' value=' " . lang ( 18 ) . " '> " . confirm () . " \n " : ( $_POST ||! $q ? " " : script ( " focus(qsa('td', qs('#form'))[1].firstChild); " ))); if ( isset ( $_GET [ " select " ])) hidden_fields ( array ( " check " => ( array ) $_POST [ " check " ], " clone " => $_POST [ " clone " ], " all " => $_POST [ " all " ])); echo '<input type="hidden" name="referer" value="' , h ( isset ( $_POST [ " referer " ]) ? $_POST [ " referer " ] : $_SERVER [ " HTTP_REFERER " ]), ' " >
2014-05-08 19:46:08 +02:00
< input type = " hidden " name = " save " value = " 1 " >
2018-04-01 23:34:54 +02:00
< input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
' ;} if ( isset ( $_GET [ " file " ])){ if ( $_SERVER [ " HTTP_IF_MODIFIED_SINCE " ]){ header ( " HTTP/1.1 304 Not Modified " ); exit ;} header ( " Expires: " . gmdate ( " D, d M Y H:i:s " , time () + 365 * 24 * 60 * 60 ) . " GMT " ); header ( " Last-Modified: " . gmdate ( " D, d M Y H:i:s " ) . " GMT " ); header ( " Cache-Control: immutable " ); if ( $_GET [ " file " ] == " favicon.ico " ){ header ( " Content-Type: image/x-icon " ); echo
lzw_decompress ( " \0 \0 \0 ` \0 <EFBFBD> \0 \n @ \0 <EFBFBD> C<> <10> \" \0 `E<> Q<EFBFBD> <51> <01> <1F> ?<3F> tvM'<27> Jd<4A> d \\ <19> b0\0 <08> \" <13> <> fӈ<66> <D388> s5<73> <35> <EFBFBD> <EFBFBD> A<EFBFBD> X P a J<> 0<18> <> <EFBFBD> 8<> #R<> T<EFBFBD> <54> z`<60> #.<2E> <> c<EFBFBD> X<EFBFBD> <58> Ȁ?<3F> -\0 <05> Im?<3F> .<16> M<EFBFBD> <16> \0 ȯ (̉<> <1E> /( %<25> \0 " );} elseif ( $_GET [ " file " ] == " default.css " ){ header ( " Content-Type: text/css; charset=utf-8 " ); echo
lzw_decompress ( " \n 1 ̇<> ٌ<EFBFBD> l7<6C> <37> B1<42> 4vb0<62> <30> fs<66> <73> <EFBFBD> n2B<32> ѱ٘<D1B1> n:<0E> # (<28> b. \r D c)<29> <> a7 E<> <13> <> <EFBFBD> l<0C> ñ<EFBFBD> <C3B1> i1̎s<03> <> <EFBFBD> -4<> <34> f<EFBFBD> <09> <> i7<0E> <03> <> <EFBFBD> <07> <> <EFBFBD> Fé<46> vt2<74> <0E> <> !<21> r0<72> <30> <EFBFBD> <EFBFBD> t~<7E> U<1D> '3M<33> <4D> W<EFBFBD> B<EFBFBD> 'c<> P<EFBFBD> :6T \r c<EFBFBD> A<EFBFBD> zr _<> WK<57> \r -<2D> VNFS%~<7E> c<EFBFBD> <63> <EFBFBD> &<26> \\ ^<5E> r<EFBFBD> <72> <EFBFBD> <EFBFBD> u<> ŎÞ<C58E> ً4'7k<37> <6B> <EFBFBD> <EFBFBD> <EFBFBD> Q<EFBFBD> <51> h<16> 'g \r FB \r y T7SS<53> P<EFBFBD> 1=Ǥ cI<63> <49> :<18> d<EFBFBD> <64> m><3E> S8 L<> J<EFBFBD> <4A> t. M<> <01> <> ϋ`'C<> <43> <EFBFBD> <EFBFBD> 8 89<38> <39> <11> Q<7F> <51> <EFBFBD> <EFBFBD> 2<EFBFBD> #8А <38> <D090> <EFBFBD> <EFBFBD> 6 m<> <6D> <11> <> j<1E> <> h<EFBFBD> <<3C> <> <EFBFBD> <EFBFBD> <EFBFBD> 9/<2F> <> <EFBFBD> :<0E> J<EFBFBD> )ʂ<> \0 d >! \0 Z<18> <0F> v<EFBFBD> <76> n<EFBFBD> <6E> <EFBFBD> <EFBFBD> o(<28> <> <EFBFBD> <EFBFBD> k<EFBFBD> 7<EFBFBD> <37> s<EFBFBD> <73> ><3E> <0B> <> !<21> R \" *nS<6E> \0 @P \" <03> <> <EFBFBD> (<28> # [<5B> <> <0F> @g<0C> o<EFBFBD> <01> <> zn<7A> 9k<39> 8<18> n<EFBFBD> <6E> <10> 1<EFBFBD> I *<2A> <> =<3D> n<EFBFBD> <6E> <EFBFBD> <0E> <> <EFBFBD> 0<EFBFBD> c(<28> ;<3B> à<EFBFBD> <C3A0> !<21> <> <EFBFBD> *c<> <63> >Ύ<> E7D<37> LJ<4C> <4A> 1<EFBFBD> <31> <16> <> `<60> 8(<28> <> 3M<33> <4D> \" <EFBFBD> 39<EFBFBD> ?E<0C> e =Ҭ<> ~<7E> <> <EFBFBD> <1B> <1C> <> Ӹ7;<3B> C<EFBFBD> <05> <> <EFBFBD> E\r d!)<29> a *<2A> 5ajo\0 <EFBFBD> #`<60> 38<33> \0 <EFBFBD> <EFBFBD> ]<5D> e<EFBFBD> <65> <EFBFBD> <EFBFBD> 2<EFBFBD> mk<18> <0E> e]<5D> <> <EFBFBD> AZs<5A> StZ<74> Z!)BR<42> G+<2B> #Jv2(<28> <> <EFBFBD> <EFBFBD> c<> 4<<3C> #sB<73> 0<EFBFBD> <30> <EFBFBD> 6YL\r <EFBFBD> =<3D> <> <EFBFBD> [<5B> 73<37> <33> <<3C> :<3A> <> bx<62> <78> J= m_ <20> <> <EFBFBD> f<EFBFBD> l<> <19> t<EFBFBD> <74> I<EFBFBD> <49> H<EFBFBD> 3<EFBFBD> x*<2A> <> <EFBFBD> 6`t6<74> <36> %<25> U<> L<EFBFBD> eق<65> <<05> \0 <EFBFBD> A Q<P<:<3A> #u/<2F> :T\\ ><3E> <> -<2D> xJ<78> ͍ QH \n j<> L+ j<> z<EFBFBD> <7A> <EFBFBD> 7<EFBFBD> <37> <EFBFBD> `<60> <> <EFBFBD> <EFBFBD> \n k<EFBFBD> <EFBFBD> '<27> N<EFBFBD> vX><3E> C-T˩<54> <CBA9> <EFBFBD> <EFBFBD> <EFBFBD> 4*L<> %Cj>7ߨ<37> ި<03> <> <EFBFBD> `<60> <> <17> ;y<> <79> <EFBFBD> q<EFBFBD> r<EFBFBD> 3 #<23> <> } :#n<> \r <EFBFBD> <EFBFBD> ^<18> =C<> Aܸ<41> Ǝ<EFBFBD> s&8<> <38> K&<26> <> *0<> <30> t<EFBFBD> S<EFBFBD> <53> <EFBFBD> =<3D> [<5B> <> :<1D> \\ ]<5D> E<45> /O<> >^ ]<5D> ø<> <<3C> <> <EFBFBD> <EFBFBD> gZ<01> V<EFBFBD> <56> q <10> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> x \\ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \" J<EFBFBD> \\ î<EFBFBD> <EFBFBD> ##<23> <> <EFBFBD> D<EFBFBD> <44> x6<06> <> <EFBFBD> 5x<19> <> <05> <> <EFBFBD> <EFBFBD> <EFBFBD> \r H<> l <20> <> <EFBFBD> <EFBFBD> b<> <62> r<EFBFBD> 7<EFBFBD> <37> 6<EFBFBD> <36> <EFBFBD> j|<7C> <> <EFBFBD> <04> ۖ*<2A> F Aq uvyO<79> <4F> WeM<65> <02> <1A> <> D.F<> <46> :R<> \$ -<2D> <> <1F> <> T !<21> DS`<60> 8D<38> ~<7E> <> A`(<28> em<65> <6D> <EFBFBD> <EFBFBD> <EFBFBD> T@O1@<40> <> X<EFBFBD> <58> <EFBFBD> \n Lp<4C> <70> <EFBFBD> P<EFBFBD> <50> <EFBFBD> <EFBFBD> <EFBFBD> m<EFBFBD> y f<> <0B> ) <01> <> <EFBFBD> G SEI<45> <49> <02> x C(s(a<> ?\$ `tE<10> n<EFBFBD> <6E> <EFBFBD> <EFBFBD> ,<2C> <> \$ a<> <61> U>,<2C> В \$ Z<EFBFBD> kDm,G \0 <EFBFBD> <19> \\ <EFBFBD> <EFBFBD> i<EFBFBD> <15> %ʹ <11> n<> <6E> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <18> <> g<EFBFBD> <67> <1B> b y`<60> <> Ԇ<EFBFBD> W<EFBFBD> <57> 䗗<> _C<5F> <43> T\n i<04> <> H %<25> da<08> <> i<EFBFBD> 7<EFBFBD> At<41> ,<2C> <> J<EFBFBD> X4n<34> <6E> <EFBFBD> <EFBFBD> 0 o<6F> 9g \n zm<EFBFBD> M%`<60> 'I<> <49> <EFBFBD> О -<2D> <> <EFBFBD> <01> 7:p<> 3 p<> <08> Q<EFBFBD> rED<45> <44> <EFBFBD> <EFBFBD> <1B> <> b2 ]<5D> PF<50> <46> <EFBFBD> <EFBFBD> >e<> <65> <EFBFBD> 3j \n <EFBFBD> ߰t !<21> ?4f<34> tK ;<3B> <> \r Ξи<EFBFBD> !<21> o<10> u<> ?<3F> <> <EFBFBD> Ph<50> <68> <EFBFBD> 0uIC}'~<7E> <> 2<EFBFBD> v<EFBFBD> Q<EFBFBD> <51> <EFBFBD> 8)<29> <> <EFBFBD> 7<EFBFBD> DI<44> =<3D> <> y&<26> <> ea<65> s *hɕjl A<> (<0F> <> \" <EFBFBD> \\ <EFBFBD> <EFBFBD> m^i<> <69> M)<29> <> ^<5E> |~<7E> l<EFBFBD> <6C> #!Y<1A> f8 1RS<16> <> <EFBFBD> <EFBFBD> !<21> <> <EFBFBD> 62P<32> C<> <43> l&<26> <> <11> xd!<01> |<7C> <> 9<EFBFBD> `<60> _OY<4F> =<3D> <> G<06> [E<> -eL<65> CvT<76> )<29> @<12> j -5<> <06> <> pSg<14> .<2E> G=<3D> <> <EFBFBD> ZE<0E> <> \$ \0 <EFBFBD> ц Kj<4B> U<EFBFBD> <55> \$ <EFBFBD> <14> <> G' I<> P<EFBFBD> <50> ~<06> ځ<> ;<3B> <> hNێG%*<2A> Rj<52> <6A> X[<5B> X Pf^<5E> <> |<13> <> T!<21> *N<> <4E> І <EFBFBD> \r U<EFBFBD> <EFBFBD> ^q1V!<21> <> Uz,<2C> I|7<> 7<EFBFBD> r,<2C> <> <EFBFBD> 7<EFBFBD> <37> <EFBFBD> ľB<C4BE> <42> <EFBFBD> ;<3B> +<2B> <> <EFBFBD> ߕ<0B> A<EFBFBD> p<EFBFBD> <70> <1A> <> ^<5E> <1C> <> ~ ؼ W!3 P<> I8]<5D> <> v<EFBFBD> J<EFBFBD> <4A> f<EFBFBD> q<EFBFBD> |,<2C> <> <EFBFBD> 9W<39> f` \0 <EFBFBD> q<EFBFBD> Z<EFBFBD> p}[Jdhy<18> <> N<EFBFBD> <4E> Y |<7C> <> C y,<2C> <s A<01> { e<EFBFBD> Q<EFBFBD> <13> <05> hd<68> <64> <EFBFBD> LJ <20> B 4 ;ks&<26> <> <EFBFBD> <1C> <> <EFBFBD> <EFBFBD> a<EFBFBD> <61> <EFBFBD> <EFBFBD> <EFBFBD> <0F> <> ;˹}<7D> S<EFBFBD> <53> J<7F> <4A> <EFBFBD> )<29> =d<> <64> |<7C> <> <1E> Nd<4E> <0C> I<05> *8<> <38> <EFBFBD> dl<64> ѓ<EFBFBD> E6~Ϩ <> F<EFBFBD> <46> <EFBFBD> <1C> X `<60> M \r ʞ/<2F> %B/V<04> I<EFBFBD> N&;<3B> <> <1A> 0<EFBFBD> UC c T&.E+<2B> <> <EFBFBD> <EFBFBD> <0E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> @<40> 0`;<3B> <> <EFBFBD> G<EFBFBD> 5<EFBFBD> <35> <EFBFBD> ަj'<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ɛ<> Y<1B> +<2B> <> QZ-i<> <69> <11> yv<79> <76> I<EFBFBD> 5<EFBFBD> <35> ,O|<7C> P<EFBFBD> ]Fۏ<46> <DB8F> <EFBFBD> <EFBFBD> <EFBFBD> \0 <EFBFBD> <EFBFBD> <EFBFBD> 2<EFBFBD> 49͢<EFBFBD> <EFBFBD> <EFBFBD> n/ χ]س&<26> <> I^<05> =<02> l<EFBFBD> <6C> qfI<66> <49> = <20> ]x1GR<47> & <> e<> 7<EFBFBD> <37> )<29> <> '<27> <> :B<> B<EFBFBD> >a<> z<EFBFBD> -<2D> <> <EFBFBD> 2.<2E> <> <04> <> bz<62> <7A> <EFBFBD> #<23> <> <EFBFBD> <11> <> <EFBFBD> Uᓍ<55> L7-<2D> w<EFBFBD> t<EFBFBD> 3ɵ<33> <C9B5> <EFBFBD> e<> <65> <EFBFBD> D<EFBFBD> <08> \$ <EFBFBD> #<23> <> <EFBFBD> j<16> @<40> G<> 8<EFBFBD> <20> 7p<37> <70> <1D> R<EFBFBD> YC<59> <43> ~<7E> <> :<06> @<10> <> EU<45> J<> <1F> ;67v]<5D> J'<27> <17> <15> q1ϳ <02> El<45> QІ i<D086> <69> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> { k<<3C> <> ֡M<D6A1> po<70> }<7D> <11> r<EFBFBD> <72> q<16> ؞<0C> c<EFBFBD> ä<EFBFBD> _m<5F> w<EFBFBD> <77> <1F> ^<5E> u<EFBFBD> <75> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ln<6C> <6E> <1D> <09> <> _<EFBFBD> ~<7E> G<EFBFBD> n<EFBFBD> <6E> <1D> <> { kܞ<6B> w<EFBFBD> <77> <EFBFBD> \r j~<7E> K<EFBFBD> \0 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <0E> -<2D> <> <EFBFBD> <1E> B<04> ;<3B> <> <EFBFBD> <EFBFBD> b`}<7D> CC,<2C> <> <EFBFBD> -<2D> <> L<EFBFBD> <4C> 8\r ,<14> <> kl<6B> nj<EFBFBD> n}-5<> <35> <EFBFBD> <EFBFBD> 3u<1A> gm<67> <6D> Ÿ<EFBFBD> *<2A> /<2F> <> <0C> <> <EFBFBD> <EFBFBD> <EFBFBD> `<60> `<60> #x<> +B?#<23> ۏN;OR \r <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \$ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> k<> <6B> ϙ\0 1\0 k<EFBFBD> \0 <EFBFBD> 8<EFBFBD> <EFBFBD> a<02> <> /t<0F> <> <EFBFBD> #(&<26> l&<26> <12> <> p<EFBFBD> <70> 삅<EFBFBD> <EC8285> <EFBFBD> i<04> M<> { <EFBFBD> z p*<2A> -g<0F> <> <EFBFBD> v<EFBFBD> <76> 6<EFBFBD> k<EFBFBD> <09> <04> <> <EFBFBD> d<EFBFBD> ؋<EFBFBD> <D88B> <EFBFBD> <08> A `6<> lX) +d <20> <> <EFBFBD> 7 <20> \r <EFBFBD> <EFBFBD> <20> ځcj6<6A> <36> \r p<EFBFBD> \r <EFBFBD> <EFBFBD> \r \" oP<6F> 7<02> \r <EFBFBD> <EFBFBD> \0 <EFBFBD> \0 <EFBFBD> y<EFBFBD> <EFBFBD> P<> <0F> <> \r Q 7<0B> <> <0E> Z<EFBFBD> <5A> 4Q<11> <> <0F> ڍ p/<2F> y \r <EFBFBD> <0F> # #D<0E> ;<0F> <> <EFBFBD> <EFBFBD> <<3C> g<EFBFBD> \0 f i2<69> )f<08> \\ m<0C> Gh\r <EFBFBD> #<16> n<0E> <> <11> <> @[ <20> G<EFBFBD> \" Sqm<11> <> \r <EFBFBD> <EFBFBD> <18> #<18> <> (A j<> <0B> q ѣ %<25> <> <EFBFBD> ̑3 qE<18> <> \0 r<EFBFBD> <EFBFBD> <17> <16> <> 0<> <0E> я<1C> <> <EFBFBD> <EFBFBD> <EFBFBD> .<2E> <> Q7 шW<D188> <57> <16> u<11> <1B> <> <EFBFBD> <11> <11> @<40> <> H<EFBFBD> <48> q 'vs<76> 0<EFBFBD> \n <EFBFBD> +0<> <30> <EFBFBD> <EFBFBD> SG<53> p<> O`<60> \r ) c<> #<23> <17> <> <0E> <> R= \$ <EFBFBD> ƐR\r <EFBFBD> G ы\$ R?%2C<0C> [ \0 ؍ <10> ~<7E> !<15> \\ <08> <> p<> #@<40> <> <EFBFBD> O(rg%<25> ? ra\$ <EFBFBD> <EFBFBD> )r](<28> <> &<26> ?&<26> #&R<> ' ,\r qV3<EFBFBD> \" H<EFBFBD> m+<2B> <> <1E> l<EFBFBD> Q \" \0 <EFBFBD> 4<> <02> \$ r<EFBFBD> ,<2C> <> =<3D> <> <EFBFBD> <12> &2;.<2E> H@`<60> <> <EFBFBD> <EFBFBD> a<EFBFBD> <61> <0B> <> \$ <EFBFBD> _*RI S &<26> <> q<EFBFBD> <71> _<EFBFBD> 1<0C> 1+ 1<> <31> <11> <> <0C> <> 3)2<> V7<12> <0C> 2l<32> ڄ !1g-<11> 2f`<60> <> <EFBFBD> ,Q<18> 7<17> <> 0qg<0F> ]!q<> <19> m6<6D> <36> <EFBFBD> <EFBFBD> _<1C> M7 <20> <19> <> 7<EFBFBD> o6Q<36> <0B> <> <0C> k p<> 3<EFBFBD> g9<13> <> s<EFBFBD> 3<> 6<10> \r <EFBFBD> :S<> 9ӏ ;<13> <20> \r 9<EFBFBD> - \0 <EFBFBD> Yӧ0Q<EFBFBD> <b#<Ӂ<1B> w/<2F> G<15> <> >r<> \r <EFBFBD> <EFBFBD> =3<> <11> ^&Q ;ѣ?q<> 0\" <EFBFBD> 0HЙ<EFBFBD> |<7C> <10> <17> ʖS<CA96> <53> i<EFBFBD> <0E> @*<2A> T<EFBFBD> 2<EFBFBD> T#<11> <> <20> \0 <EFBFBD> C<08> <> 07 ]?<3F> <> &<26> <> <EFBFBD> E<0C> <> D<EFBFBD> ;:/<2F> 3<> E<EFBFBD> 5<> <35> EQ<45> e<EFBFBD> <18> T\" <EFBFBD> m<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5<EFBFBD> E;<3B> <> <16> #=4<> 8<EFBFBD> <38> *<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> LS<17> 5Hr<48> J E TO\r ԅJ<EFBFBD> <EFBFBD> J<EFBFBD> <EFBFBD> J<EFBFBD> <EFBFBD> <1A> eG) 8B<38> 8<EFBFBD> ,&<26> <> G<EFBFBD> <03> <> <EFBFBD> <EFBFBD> <09> <> <EFBFBD> + M<> <4D> <EFBFBD> ɲ<EFBFBD> <C9B2> ^*<2A> <18> <> G<> <47> 14<31> 6<EFBFBD> \$ . \" 拢<EFBFBD> I4w! \$ L <20> 8b<38> A2<41> L<EFBFBD> 'M ?MF<4D> \$ <14> ,<2C> <> <EFBFBD> <EFBFBD> Nr<0C> <> /4<> B J<> ¨" );} elseif ( $_GET [ " file " ] == " functions.js " ){ header ( " Content-Type: text/javascript; charset=utf-8 " ); echo
lzw_decompress ( " f:<3A> <> gCI<43> <49> \n 8<EFBFBD> <EFBFBD> 3)<29> <> 7<> <37> <EFBFBD> 81<38> <31> x: \n Og#)<29> <> r7 \n \" <EFBFBD> <EFBFBD> <EFBFBD> `<60> |2<1B> gSi<53> H) N<> S<EFBFBD> <53> <EFBFBD> \r <EFBFBD> <EFBFBD> \" 0<EFBFBD> <EFBFBD> @<40> )<1D> ` ( \$ s6O!<21> <> <EFBFBD> V/ =<3D> <> ' T4<54> =<3D> <> iS<69> <53> 6IO<49> <4F> er<65> x<EFBFBD> 9<1E> *ź<> <C5BA> n3<6E> \r щv<D189> C<EFBFBD> <43> `<60> <> <EFBFBD> 2G%<25> Y<EFBFBD> <59> <EFBFBD> <05> <> 1<EFBFBD> <31> f<EFBFBD> <66> <EFBFBD> Ȃl<C882> <6C> 1<EFBFBD> \n y<> *pC\r \$ <EFBFBD> n<EFBFBD> T<EFBFBD> <EFBFBD> 3=\\ <EFBFBD> r9 O\" <EFBFBD> <09> <> l<<3C> \r <EFBFBD> \\ <EFBFBD> <EFBFBD> I,<2C> s\n A<EFBFBD> <EFBFBD> e h +M<> <4D> !<21> q0<71> <30> f<EFBFBD> `(<28> N { c<EFBFBD> <EFBFBD> +w<> <77> <EFBFBD> Y<EFBFBD> <59> p٧ 3<D9A7> 3<EFBFBD> <1A> +I<> <49> j<EFBFBD> <6A> <EFBFBD> <EFBFBD> <EFBFBD> k<EFBFBD> <6B> n<EFBFBD> q<EFBFBD> <18> <> z i#^r<> <72> <EFBFBD> <1E> <> 3<EFBFBD> <33> <EFBFBD> <EFBFBD> [<5B> <> <EFBFBD> o;<3B> <> (<28> <> 6<> #<23> Ґ<EFBFBD> <D290> \" : cz>ߣC2v<32> CX<43> <<3C> P<EFBFBD> <0C> c*5 \n <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> P97<39> |F<> <0F> c0<63> <30> <EFBFBD> <EFBFBD> <EFBFBD> !<21> <> <08> <> !<21> <> <EFBFBD> !<21> <> \n Z %<25> ć#CH<43> !<21> <> r8<72> \$ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> Rܔ2<DC94> <32> <EFBFBD> ^0<> <30> @<40> 2<EFBFBD> <32> (<28> 8 8P/<0F> <> <EFBFBD> ݄<EFBFBD> \\ <EFBFBD> \$ La \\ <EFBFBD> ; c<> H<14> <> HX<13> <> <EFBFBD> \n ʃt<CA83> <74> <07> 8A<<3C> s Z<04> *<2A> ;I<> <49> 3<EFBFBD> <33> @<40> 2<<3C> <> <1A> !A8G<<3C> j<04> -K<> ({ * \r <EFBFBD> <EFBFBD> a1<EFBFBD> <EFBFBD> <EFBFBD> N4Tc\" \\ <13> !=1^<0C> <> <EFBFBD> M9O<39> :<3A> ; j<> <6A> \r <EFBFBD> X<EFBFBD> <EFBFBD> L#H<> 7<05> #Tݪ/-<2D> <> <07> p<EFBFBD> ;<3B> B \n <05> 2!<21> <> <EFBFBD> t]apΎ<70> <CE8E> \0 R<15> C<EFBFBD> v<1D> M<EFBFBD> I, \r <EFBFBD> <EFBFBD> <EFBFBD> \0 Hv<EFBFBD> <EFBFBD> ? kT<6B> 4<EFBFBD> <34> <EFBFBD> <EFBFBD> uٱ<75> ;&<26> <> <EFBFBD> +&<26> <> <EFBFBD> <EFBFBD> <EFBFBD> \r <EFBFBD> X<EFBFBD> <EFBFBD> <EFBFBD> bu 4 ݡi8 8<> 2B<10> /⃖4<E28396> <07> <> N 8A<38> A)52<35> <32> <EFBFBD> <EFBFBD> <08> <> 2<EFBFBD> <32> s<EFBFBD> 8<EFBFBD> <38> 5<> <35> <EFBFBD> p<EFBFBD> WC@<40> :<03> t<17> 㾴<EFBFBD> e<EFBFBD> <65> h\" #8_<38> <5F> cp^<1F> <> <EFBFBD> I]OH<4F> <48> : zd<7A> 3g<33> (<28> <> <EFBFBD> Ök<C396> <6B> <EFBFBD> \\ 6<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2<EFBFBD> ږ<EFBFBD> <EFBFBD> i<EFBFBD> <18> 7<EFBFBD> <10> <> ] \r <EFBFBD> xO<EFBFBD> n<EFBFBD> p<EFBFBD> <<3C> <> p<EFBFBD> Q<EFBFBD> U<EFBFBD> n<EFBFBD> <6E> |@<40> <> <EFBFBD> #G 3<> <33> 8b A<> <41> 6<EFBFBD> 2<EFBFBD> 67%#<23> \\ 8 \r <EFBFBD> <18> 2<EFBFBD> c\r <EFBFBD> ݟk<DD9F> <0C> .(<28> <09> <> -<2D> J;<3B> <> <EFBFBD> <EFBFBD> <20> <> L<EFBFBD> <4C> <20> <0C> <> W<EFBFBD> <57> 㧓ѥɤ<D1A5> <C9A4> <EFBFBD> <EFBFBD> <EFBFBD> n<EFBFBD> <6E> ҧ<EFBFBD> <D2A7> <EFBFBD> M<EFBFBD> <4D> 9ZН s]<5D> z<EFBFBD> <7A> <EFBFBD> <EFBFBD> y^[<5B> <> 4-<2D> U\0 t a<> <1E> 62^<5E> <> . `<60> <17> <> .C<> j<EFBFBD> [ᄠ% Q \0 ` d<> M8<4D> <38> <EFBFBD> <EFBFBD> <EFBFBD> \$ O0`4<05> <> <EFBFBD> \n \0 a \r A<EFBFBD> <<02> @<40> <> <EFBFBD> <EFBFBD> \r !<21> :<03> BA<42> 9<EFBFBD> ? h><3E> Ǻ<0B> <> ~ ̌<> 6Ȉh<14> =<0C> -<12> A 7X<37> <58> և \\ <1A> \r <EFBFBD> <EFBFBD> Q<蚧 q<> '!XΓ2<CE93> T <20> !<21> D\r <EFBFBD> <13> , K<> \" <EFBFBD> %<01> H<EFBFBD> qR\r <EFBFBD> ̠<EFBFBD> <08> C =<3D> <> <EFBFBD> <17> <> <16> <> <11> < c<> \n #<<3C> 5<EFBFBD> M<EFBFBD> <20> E<EFBFBD> <45> y<EFBFBD> <79> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> o \" <EFBFBD> cJKL2<03> &<26> <> e R<> <52> W<> AΐTw<54> ё;<3B> J<02> <> <EFBFBD> \\ `)5<> <35> ޜB<DE9C> q hT3<54> <33> R <19> ' \r + \" :<3A> 8<0B> <> tV<74> A<EFBFBD> + ]<0E> <> S72<37> <32> <EFBFBD> Y<EFBFBD> F<EFBFBD> <46> Z8 5<> c,<2C> <> <EFBFBD> J<EFBFBD> <4A> /+S<> nBpoW<6F> d<> <64> \" <EFBFBD> Q<EFBFBD> <EFBFBD> a<> ZKp<4B> ާy\$ <EFBFBD> <EFBFBD> <EFBFBD> <13> <> 4<EFBFBD> I<EFBFBD> @L'@<40> x C<> df<64> ~}Q *<2A> Һ A<> <41> Q<EFBFBD> \" B<> *2\0 <EFBFBD> .<2E> <> kF<6B> \" \r <EFBFBD> <EFBFBD> <EFBFBD> <20> o<EFBFBD> \\ <EFBFBD> Ԣ<> <D4A2> <EFBFBD> V ijY<6A> <0B> M<EFBFBD> <4D> O<1B> \$ <EFBFBD> <EFBFBD> 2<14> T hH<0E> <> <EFBFBD> <EFBFBD> 0XH<58> 5~k L<> <4C> <EFBFBD> T*:~P<> <50> 2<EFBFBD> t<EFBFBD> <0B> <> B\0 <EFBFBD> Y<EFBFBD> <EFBFBD> <EFBFBD> <1E> <> <EFBFBD> j<17> vD<10> s .<2E> 9<EFBFBD> s<EFBFBD> <73> ̤<EFBFBD> P<EFBFBD> *x<> <78> <EFBFBD> b<EFBFBD> o<EFBFBD> <6F> <EFBFBD> <EFBFBD> P<EFBFBD> \$ <EFBFBD> W/<2F> *<2A> <> z';<3B> <> \$ <EFBFBD> *<2A> <> <EFBFBD> <10> d<EFBFBD> m<0C> Ã<EFBFBD> 'b\r <EFBFBD> n%<25> <> 47 W<02> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <1B> <> K<> <16> <> @<<3C> g<EFBFBD> èbB<01> <> [7<> \\ <EFBFBD> |<7C> VdR<64> <52> 6leQ<65> `(Ԣ,<2C> d<> <64> <EFBFBD> 8\r <EFBFBD> ] S:?<03> 1<EFBFBD> `<60> <> Y<EFBFBD> `<60> A<EFBFBD> ғ%<25> <> ZkQ<05> sM<73> *<2A> <> <EFBFBD> { `<0B> J*<2A> w<EFBFBD> <77> ӊ ><3E> վ<> D<1D> <> <EFBFBD> ><3E> eӾ<65> \" <EFBFBD> t+po<70> <6F> <EFBFBD> <EFBFBD> =<3D> *<2A> <> Apc7g<37> <67> <EFBFBD> ]<5D> <> l<> !ї+<2B> <> zsN<73> <4E> <EFBFBD> <EFBFBD> <EFBFBD> P<EFBFBD> <50> <0C> <0E> ia<69> y}U<> a<EFBFBD> <61> <EFBFBD> <EFBFBD> `<60> <> A<EFBFBD> <41> <EFBFBD> <EFBFBD> <EFBFBD> w\n <EFBFBD> <EFBFBD> <EFBFBD> <1A> <> j<07> <> <<1A> :+<2B> 7;\" <05> <> N 3 tqd4źg<C5BA> <67> <EFBFBD> T<EFBFBD> x<02> <> P H<15> <> FvW<76> V\n <EFBFBD> h;<3B> <> B<EFBFBD> D<EFBFBD> س/<2F> bJ<62> <4A> \\ <EFBFBD> + %<25> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ]<5D> <> ъ<EFBFBD> <1E> wa<77> ݫ<EFBFBD> <DDAB> <EFBFBD> <EFBFBD> <18> <> <EFBFBD> <EFBFBD> <EFBFBD> E<> <45> (i<> !<21> <> 7<EFBFBD> <37> x<EFBFBD> <78> z<EFBFBD> <7A> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Hɳ<48> d<EFBFBD> <64> md<6D> <64> <EFBFBD> Q<EFBFBD> r@<40> a<EFBFBD> <61> <EFBFBD> ja?<3F> \r <0E> \r y<EFBFBD> 4-4<> f P<> ҉W<D289> <57> `,<1E> x @<40> <> <EFBFBD> x<EFBFBD> <78> <EFBFBD> A<EFBFBD> <41> <EFBFBD> K.<2E> O<04> i<EFBFBD> <69> o<EFBFBD> ;<3B> <> <EFBFBD> <EFBFBD> )<29> Ш<EFBFBD> <D0A8> <EFBFBD> ɆS<C986> d<> <01> eO<65> <4F> %<25> N<EFBFBD> <0E> L78<37> <38> F㪛<46> S<EFBFBD> <53> <EFBFBD> <EFBFBD> <EFBFBD> I<EFBFBD> <0B> \r <EFBFBD> <EFBFBD> Z<EFBFBD> <EFBFBD> r^<5E> ><3E> <> <EFBFBD> <EFBFBD> *<2A> d\r i<0C> Y<EFBFBD> <1E> Yd<59> u<EFBFBD> <75> s<> *<2A> <09> <1C> E<> <45> ʽ <EFBFBD> D<EFBFBD> 9<EFBFBD> <39> !<21> ><10> kCရA<E1809B> <41> <EFBFBD> d<EFBFBD> <64> <EFBFBD> <EFBFBD> !WW<57> 1<06> <> <EFBFBD> <EFBFBD> QA<51> <41> <EFBFBD> k<06> <> d%<25> <> # <20> y<EFBFBD> <79> { <EFBFBD> <EFBFBD> `}T<> _YY<59> R<> <52> -<01> M<EFBFBD> <4D> O<EFBFBD> 2<EFBFBD> <32> <EFBFBD> ,<2C> ,Š<> `<60> -2<> <32> <EFBFBD> <EFBFBD> +]L<> <4C> 7E<37> <45> <EFBFBD> { `<60> <> ˕<EFBFBD> <CB95> ~w<> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> M6<4D> <36> <EFBFBD> <EFBFBD> ] F<> <05> <> <EFBFBD> @<16> <> <EFBFBD> e`<60> /<2F> 8<EFBFBD> @<40> e<EFBFBD> <1D> <> \\ ap.<2E> H<1B> <> <EFBFBD> <EFBFBD> C<EFBFBD> <EFBFBD> <7F> * EAoz2<7A> <32> <EFBFBD> g0<67> <30> ?]͝~<7E> s<EFBFBD> <73> <EFBFBD> `<60> hJ`<60> <> 箤`<60> }<18> <> <EFBFBD> ^ `<60> <12> <1E> ><3E> <04> O<> 5\r <EFBFBD> W ^I<> <49> <EFBFBD> <EFBFBD> \n <EFBFBD> <EFBFBD> <1E> <1F> ;<3B> <> <EFBFBD> <EFBFBD> :<3A> <> <EFBFBD> _h<5F> n<> <6E> <EFBFBD> <EFBFBD> <0C> YP4<11> <> <EFBFBD> )<29> <> *<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <16> 6v<36> <76> [ˤ<> C;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <06> n<EFBFBD> W/j<> <\$ J*qĢ<71> <C4A2> <EFBFBD> <EFBFBD> -L<> <4C> \0 <EFBFBD> <EFBFBD> <10> <> <EFBFBD> \0 O<EFBFBD> \$ <EFBFBD> ZW z<> \0 }<7D> <> . 4 F<> \r nu \0 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䏋<EFBFBD> <EFBFBD> L<EFBFBD> <0C> <> I A\n z<EFBFBD> <0E> *<2A> <> <EFBFBD> <EFBFBD> jJ<6A> ̅P<CC85> <02> <> <08> <> p<EFBFBD> <70> <EFBFBD> 6<EFBFBD> ئN<D8A6> <4E> D<EFBFBD> Bf \\ \0 <EFBFBD> <09> <> W@L\r <EFBFBD> <EFBFBD> `<60> g' B d<> Bi <09> <> <07> <> <EFBFBD> *|r%|\n r\r #<23> <> <EFBFBD> @w<02> <> <EFBFBD> (T.<2E> v<EFBFBD> 8<EFBFBD> <38> <EFBFBD> \n m<EFBFBD> <EFBFBD> <EFBFBD> < p<> <70> `<60> Y0<59> <30> <EFBFBD> <0E> <> <EFBFBD> <EFBFBD> \0 <EFBFBD> #<23> <> <05> }<7D> .I <20> x<05> T\\ <EFBFBD> <EFBFBD> <05> \n <0C> <> Q<> <04> @bR M F<> <11> |<0C> <> %0SDr<44> <72> <EFBFBD> <0E> <> f/b<> <62> <EFBFBD> <EFBFBD> <EFBFBD> :<3A> <> k /<2F> <> f %<0E> Ш<EFBFBD> e\n x \0 <EFBFBD> l\0 <EFBFBD> <0C> <> <09> 0<0E> W `<60> <18> <> \n <EFBFBD> 8\r \0 } p<> <70> <EFBFBD> <EFBFBD> <18> ; \0 <EFBFBD> .B<> <06> V<EFBFBD> <56> ,z&<26> f <20> \r <EFBFBD> <EFBFBD> WO cK<63> \n <EFBFBD> <EFBFBD> <15> <> <EFBFBD> <EFBFBD> <EFBFBD> k<> z 2\r <EFBFBD> <EFBFBD> <1C> <> W@ <> %\n ~1<> <31> X<EFBFBD> <58> <EFBFBD> q<EFBFBD> D<0C> !<21> ^<5E> <> t<<3C> \$ <EFBFBD> { 0<E<> <45> Ѫ<EFBFBD> 2&<26> N<EFBFBD> \r \n <EFBFBD> ^i<04> <> <EFBFBD> \" <EFBFBD> <EFBFBD> #n<> <20> <> #2D<32> <44> <EFBFBD> <EFBFBD> <EFBFBD> <14> D<EFBFBD> <44> <EFBFBD> o!<21> z K6<4B> <36> :<3A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> #Rl<52> %q'k*<2A> <> À<05> <> Z @<40> <> J<EFBFBD> `^P<> H<04> bSR|<7C> <14> %|<06> <> <EFBFBD> .<2E> <> µ<EFBFBD> ^<5E> rc&o<> <6F> k<<3C> <> <1E> <> &<26> <> xK<78> <4B> '<27> <> LĂ<4C> <C482> <EFBFBD> (<28> <> <EFBFBD> mE)<29> *<06> <> <EFBFBD> `R<> bWGbTR<54> <52> <EFBFBD> `VNf<4E> <66> j<EFBFBD> <6A> <12> w oV<6F> <56> <EFBFBD> (\" <EFBFBD> <05> ڧ<08> &s\0 <EFBFBD> <EFBFBD> .<2E> <> 8<> <10> =h<> <68> Q&<11> <> <EFBFBD> n*h<06> \0 <EFBFBD> v<EFBFBD> B<EFBFBD> G<EFBFBD> <EFBFBD> @\\ F \n <EFBFBD> W<EFBFBD> r f\$ <EFBFBD> e6<EFBFBD> <EFBFBD> 6<EFBFBD> a 㤥<> 5H<08> <> <EFBFBD> <0F> bY<62> f<EFBFBD> <66> RF<52> <46> 9<EFBFBD> (Һ<> .EQ<45> *<2A> <> <EFBFBD> <EFBFBD> (<28> 1<EFBFBD> *<2A> /+,<2C> \" <EFBFBD> <EFBFBD> \r <EFBFBD> <EFBFBD> <09> <> 8<12> \0 <EFBFBD> <EFBFBD> 3@<40> %l 厭<> <E58EAD> ,+<2B> <> <13> &<26> #-\$ <EFBFBD> <05> <> %<25> <> <EFBFBD> gF!s<> 1<EFBFBD> <31> %<25> <> s<> /<2F> nK<6E> q<> \0 O \" EA<EFBFBD> 8<0F> 2<EFBFBD> <32> }5 \0 <EFBFBD> 8<EFBFBD> <EFBFBD> A\n <EFBFBD> <EFBFBD> R rH<0C> <> <05> <> 9<EFBFBD> 4U<34> dW 3!b<> z`<60> ><04> F ><3E> i,<2C> a?L><3E> <> `<07> r<EFBFBD> <72> r<EFBFBD> ta;L<> <4C> <EFBFBD> %<25> Rx R<14> <> t<EFBFBD> ʥHW/m 7 Dr<44> EsG2<47> .B5I<35> <49> <EFBFBD> <EFBFBD> Q3<0B> _<EFBFBD> <5F> Ԉ봤<D488> 24.<05> <> <EFBFBD> R k<> <04> z @<40> <> @<40> N<> [4<> & <%b >n<> YPW<1F> <0C> <> <EFBFBD> 6 n\$ bK 5<> t<EFBFBD> <74> ZB<5A> YI L<> ~G<> Y<1F> <1C> <> cQc 6DXֵ\" }ƞ f<> Т I<1F> j<0C> <> 5<EFBFBD> \\ <EFBFBD> X٢td<74> <64> \n btN aE<61> Tb;<16> l<EFBFBD> p<> <70> |<7C> \0 <EFBFBD> <0E> x\n <EFBFBD> <EFBFBD> <EFBFBD> dV<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ]X<> <58> Yf<59> <66> %D `<60> Q b<> svDsk0<6B> qT<71> <54> 7<EFBFBD> l<07> c7<63> <37> <EFBFBD> <03> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SZ<53> 6<EFBFBD> <36> <EFBFBD> 㵊 Ğ#<23> x<EFBFBD> <78> h ՚ <> <0B> <> `<60> _`ܾ<> ڧ<EFBFBD> <DAA7> <05> <> <EFBFBD> <06> <> +w`<60> %U<> <55> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 虯<EFBFBD> <E899AF> ̻U<CCBB> <55> <EFBFBD> D<15> X l#<23> <> Ju<4A> [ <20> Q'<27> \\ H<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> GR<EFBFBD> <EFBFBD> 0<EFBFBD> oa<EFBFBD> <EFBFBD> <04> <> C<> X<EFBFBD> +<2B> a<> c<> N 䞮`<60> re<72> \n <EFBFBD> <EFBFBD> %<25> 4<EFBFBD> S<EFBFBD> _<EFBFBD> k_<6B> ښ<EFBFBD> !3({ 7<EFBFBD> <EFBFBD> bI \r V\r <EFBFBD> 5<EFBFBD> <EFBFBD> \0 <EFBFBD> \\ <EFBFBD> <06> aeSg[<5B> z<07> f -P<> O , ju;XUv<55> <76> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> m<15> l<EFBFBD> \" \\ B1 Ğ<> <C49E> 0<10> <20> <> p<10> <0C> 4<EFBFBD> <34> <EFBFBD> ;2*<2A> <16> . b<> \0 <EFBFBD> <EFBFBD> u<EFBFBD> <EFBFBD> J\" NV<EFBFBD> <EFBFBD> r rO<72> f<EFBFBD> 2<EFBFBD> W3[<5B> آ<EFBFBD> <D8A2> <EFBFBD> <0C> <> <0C> 5 \r 7<1A> <> 0 ,yt<79> <74> wS W ]kG<6B> X<EFBFBD> iA*=P \r bs \" <0F> \\ <EFBFBD> o{ e<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5k<EFBFBD> <EFBFBD> k<EFBFBD> <<3C> <> ;<3B> ;x<> <0F> -<04> 0<EFBFBD> <30> _ \$ 4<EFBFBD> <20> <> <EFBFBD> <0F> 8*i \0 f<EFBFBD> .<04> (`<60> <> <EFBFBD> <EFBFBD> D`<60> P<EFBFBD> &<26> <> <EFBFBD> <EFBFBD> <EFBFBD> A+e B \" Z<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <07> W̢ \\ M><3E> w<EFBFBD> <0C> <> <EFBFBD> <EFBFBD> g0<67> <30> G<7F> <0C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <0F> <> \r <EFBFBD> ܩ*<2A> f\\ <EFBFBD> <EFBFBD> p\0 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
lzw_decompress ( " v0<EFBFBD> <EFBFBD> F<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ==<3D> <> FS <09> <> _6 MƳ<4D> <C6B3> <EFBFBD> r:<3A> E<EFBFBD> CI<43> <49> o:<3A> C<11> <> Xc<58> <63> \r <EFBFBD> J(:=<3D> E<EFBFBD> <13> <> a28<03> x<EFBFBD> <78> ?<0F> '<27> i<EFBFBD> SA NN<02> <> <EFBFBD> xs<78> N B<> <42> Vl0<6C> <30> <EFBFBD> S <09> <> U l<14> (D| ҄<> <D284> P<EFBFBD> <50> ><17> E<EFBFBD> 㩶yH c h<> <68> -3 Eb<45> <62> <20> b<EFBFBD> <62> pE<70> p<EFBFBD> 9.<2E> <> <EFBFBD> <EFBFBD> ~\n <EFBFBD> ? Kb<4B> iw |<7C> `<60> <> d.<2E> x8EN<45> <4E> !<21> <> 2<> <05> 3<EFBFBD> <33> <EFBFBD> \r <EFBFBD> <1C> <> Y<EFBFBD> <59> <EFBFBD> y6 GFmY<6D> 8o7\n \r <10> 0<EFBFBD> <30> \0 <EFBFBD> Dbc<EFBFBD> !<21> Q 7 Шd8<64> <38> <EFBFBD> ~<7E> <> N)<1D> Eг `<60> Ns<4E> <73> `<60> S)<29> O<EFBFBD> <4F> <0B> <> /<2F> <<0E> x<EFBFBD> 9<EFBFBD> o<EFBFBD> <6F> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3 n<> <6E> 2<EFBFBD> !r<> :;<3B> +<2B> 9<EFBFBD> CȨ<43> <C8A8> <EFBFBD> \n <<3C> <> `<60> <> <EFBFBD> b<EFBFBD> \\ <EFBFBD> ?<3F> `<60> 4\r #`<60> <<3C> Be<0C> B#<1A> N <20> <> \r .D`<60> <> j<EFBFBD> 4<EFBFBD> <34> <EFBFBD> p<EFBFBD> ar<61> <72> 㢺<> ><3E> 8<EFBFBD> \$ <EFBFBD> c<EFBFBD> <EFBFBD> 1<EFBFBD> c<EFBFBD> <EFBFBD> <1D> c<EFBFBD> <63> <EFBFBD> <04> { n7<12> <> <07> <08> A<> N<15> RLi \r 1<EFBFBD> <EFBFBD> <EFBFBD> !<21> (<28> j´ <6A> +<2B> <> 62<36> X<> 8+<18> <05> <> <EFBFBD> . \r <EFBFBD> <18> <04> <> <EFBFBD> !x<> <78> <0E> h<EFBFBD> '<0C> <> <EFBFBD> 6S<36> \0 R<05> <> <EFBFBD> <EFBFBD> O<EFBFBD> \n <EFBFBD> <14> 1(W0<57> <30> <EFBFBD> <EFBFBD> 7 q<> <71> :N<> E:68n+<2B> <> մ 5_(<28> s<EFBFBD> \r <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /m<> 6P<36> @<40> EQ<45> <51> <EFBFBD> 9\n <EFBFBD> V-<2D> <> <EFBFBD> \" <EFBFBD> . :<3A> J<EFBFBD> <4A> 8we<77> q<EFBFBD> |؇<> X<EFBFBD> ]<5D> <> Y X<> e<EFBFBD> zW<7A> <57> <20> 7<EFBFBD> <37> Z1<5A> <31> hQf<51> <66> u<EFBFBD> j<EFBFBD> 4Z{ p \\ AU<EFBFBD> J<<3C> <> k<> <6B> @<40> ɍ<EFBFBD> <C98D> @<14> }&<13> <> <EFBFBD> L7 U<> wuYh<59> <68> 2<EFBFBD> <32> @<40> u<EFBFBD> P<> 7<EFBFBD> A<EFBFBD> h<EFBFBD> <68> <EFBFBD> <EFBFBD> <EFBFBD> 3 Û<> <1E> XEͅZ<CD85> ]<5D> l<05> @Mp l v<> )<01> <20> <07> HW<48> <05> <> y ><03> Y <59> -<2D> Y<EFBFBD> <59> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <0F> hC<68> [*<2A> <> F<EFBFBD> <46> #~<1F> !<21> `<60> \r #0P<10> C˝<43> f<03> <> <EFBFBD> <0B> <> <EFBFBD> \\ <EFBFBD> <EFBFBD> <0E> ^<5E> %B <<3C> \\ <EFBFBD> f<> ޱ<> <DEB1> <EFBFBD> <EFBFBD> <EFBFBD> &/<2F> O<EFBFBD> <4F> L\\ jF<EFBFBD> <EFBFBD> jZ<EFBFBD> 1<EFBFBD> \\ :ƴ><04> N<EFBFBD> <4E> XaF<61> A<EFBFBD> <1B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> f<EFBFBD> h { \" s \n <EFBFBD> 64<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <16> <> ?<05> 8<EFBFBD> ^p<15> \" 띰<EFBFBD> ȸ \\ <EFBFBD> e(<28> P<05> N<EFBFBD> <4E> q[g<> <67> r<EFBFBD> &<26> }Ph<50> <68> <EFBFBD> <EFBFBD> W<EFBFBD> <57> *<2A> <> r _s<5F> P<EFBFBD> h<EFBFBD> <68> <EFBFBD> <EFBFBD> \n <EFBFBD> <EFBFBD> <EFBFBD> om<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> #<23> <0F> <> .<2E> \0 @<40> pdW <20> \$ Һ<EFBFBD> Q۽T l0<6C> <20> <1D> HdH<64> )<29> <> ۏ<> <0C> )P<03> <> <EFBFBD> H<EFBFBD> g<04> <> U<> <55> <EFBFBD> <EFBFBD> B<> e \r <EFBFBD> t:<3A> <> \0 ) \" <EFBFBD> t<EFBFBD> ,<2C> <> <18> <> <EFBFBD> [<5B> ( D<> O\n R8!<21> Ƭ֚<C6AC> <D69A> lA<6C> V<EFBFBD> <10> 4<03> h<EFBFBD> <1E> S q<<15> <> @}<7D> <> <EFBFBD> gK<67> ]<5D> <> <EFBFBD> ]<5D> =90<39> <30> '<27> <> <1D> <> w A <<3C> <> <EFBFBD> <1D> a<EFBFBD> ~<7E> <> W<> <57> <EFBFBD> D| A<> <41> <EFBFBD> 2<0E> X<EFBFBD> U2<55> <32> y Ŋ<> <C58A> =<05> p)<29> \0 P <0C> s<0F> <> n<EFBFBD> 3<06> <> r<EFBFBD> f \0 <EFBFBD> F<EFBFBD> <EFBFBD> <EFBFBD> v<EFBFBD> <EFBFBD> G<0C> <01> I@<40> %<25> <> <EFBFBD> +<2B> <> _I`<60> <0C> <> <EFBFBD> \r .<2E> <> N<EFBFBD> <0F> <> KI<4B> [<15> ʖSJ<53> <05> <> a Uf<55> Sz<53> <7A> <EFBFBD> M<1F> <> <EFBFBD> %<25> <> \" Q|9<04> <> Bc<42> a<EFBFBD> q \0 <EFBFBD> 8<EFBFBD> #<23> <a<> <61> :z1Uf<15> <> ><3E> Z<10> l<EFBFBD> <6C> <01> <> <EFBFBD> <EFBFBD> e5#U@iUG <47> <C282> n<EFBFBD> %Ұ s<> <73> <10> ;gxL<07> p P<> ?B<> <42> <EFBFBD> Q<EFBFBD> \\ <15> b<1F> <> 龒Q<E9BE92> =7<> :<3A> <0F> ݡQ<DDA1> \r :<3A> t<EFBFBD> <74> :y(<28> <20> \n <EFBFBD> d)<29> <07> <> \n <EFBFBD> X;<3B> <> <EFBFBD> <EFBFBD> <11> CaA<61> \r <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> P<EFBFBD> GH<EFBFBD> !<21> <> <EFBFBD> @<40> 9\n \n Al~H<> <48> <EFBFBD> V \n s<> <73> ի<EFBFBD> Ư<EFBFBD> bBr<42> <72> <EFBFBD> <05> <> <06> <> <1A> <> 3<EFBFBD> \r <EFBFBD> P<EFBFBD> %<0B> ф\r }b/<2F> Α \$ <EFBFBD> 5<> P<EFBFBD> C<EFBFBD> \" w<13> B_<42> <5F> <EFBFBD> U<> gAt<41> <74> <EFBFBD> <EFBFBD> 夅<EFBFBD> ^Q<> <51> U<EFBFBD> <01> <> j<EFBFBD> <6A> <EFBFBD> <EFBFBD> Bvh졄4<ECA184> )<29> <> +<2B> )<<3C> j ^<5E> <L<> <4C> 4U*<2A> <> <EFBFBD> Bg<42> <67> <EFBFBD> <EFBFBD> <1C> *n<> ʖ<> -<2D> <> <EFBFBD> <EFBFBD> 9 O \$ <EFBFBD> <EFBFBD> طzyM<EFBFBD> 3<0E> \\ 9<EFBFBD> <EFBFBD> <1E> . o<> <6F> <EFBFBD> <EFBFBD> <10> <> E(i<> <07> <> <0B> <> <EFBFBD> 7 tߚ<74> <DF9A> -&<26> \n j!\r <EFBFBD> <EFBFBD> y<> y<EFBFBD> D1g<31> <67> <EFBFBD> ]<5D> <> yR<79> 7\" <EFBFBD> <EFBFBD> <1D> <13> <> <EFBFBD> ~<10> <> <EFBFBD> <EFBFBD> )TZ0E9M<39> YZ t Xe !<21> f<EFBFBD> @<40> { Ȭyl 8<> ;<3B> <> <EFBFBD> R { <EFBFBD> <EFBFBD> 8<EFBFBD> Į<> e<EFBFBD> +U L<> '<27> F<> 1<EFBFBD> <04> <> 8PE5- <09> _ !<21> 7<EFBFBD> <37> <EFBFBD> [2<> J<EFBFBD> <01> ;<3B> HR<48> <52> ǹ<> 8 p痲݇@<40> <> 0,ծpsK0\r <01> 4<EFBFBD> <34> \$ sJ<73> <0E> <> 4<EFBFBD> DZ<44> <5A> I<0E> <> '\$ cL<EFBFBD> R<EFBFBD> <EFBFBD> MpY&<1E> <> <EFBFBD> <EFBFBD> i<EFBFBD> z3G<06> zҚJ%<25> <> P<> -<2D> <01> [<5B> /x<> <78> T<EFBFBD> { p<EFBFBD> <EFBFBD> z<> C<05> v<02> <05> <> :<3A> V'<27> \\ <EFBFBD> <EFBFBD> KJa<EFBFBD> <EFBFBD> M<EFBFBD> &<26> <> <EFBFBD> Ӿ\" <EFBFBD> <EFBFBD> e<13> o^Q +h^<5E> <02> iT<69> <54> 1<EFBFBD> OR<4F> l<EFBFBD> , 5[ݘ\$ <EFBFBD> <EFBFBD> )<29> <> jLƁU`<60> S<EFBFBD> `Z ^<5E> |<0F> <> r<EFBFBD> =<3D> <0F> n登<6E> <E799BB> TU 1Hyk<79> <6B> t+\0 v<1C> D<EFBFBD> \r <<3C> <> ƙ<EFBFBD> <C699> j G<> <1E> <> t<EFBFBD> *3%k<> Y ܲT *<2A> |\" C<1E> <> l hE<68> (<28> \r <EFBFBD> 8r<EFBFBD> <EFBFBD> { <EFBFBD> <18> 0<EFBFBD> <30> <EFBFBD> <EFBFBD> <EFBFBD> D<EFBFBD> _<EFBFBD> <5F> .6и<EFBFBD> ;<3B> <> <EFBFBD> <EFBFBD> rBj<1B> O'ۜ<> <DB9C> <EFBFBD> >\$ <EFBFBD> <EFBFBD> `^6<> <36> 9<EFBFBD> #<19> <> <EFBFBD> <14> 4 X<03> <> mh8:<3A> <> c<EFBFBD> <06> 0<1D> <> ;<3B> /ԉ<> <D489> <EFBFBD> <EFBFBD> ;<3B> \\ '(<28> <> <EFBFBD> t<EFBFBD> '+<0B> <1C> <> <EFBFBD> <EFBFBD> ̷<EFBFBD> ^<0B> ]<5D> <> N<EFBFBD> v<EFBFBD> <76> #<23> ,<08> v<EFBFBD> <76> <EFBFBD> O<EFBFBD> i<> ϖ<EFBFBD> ><3E> <> <S<0E> A \\ <02> \\ <EFBFBD> <EFBFBD> <EFBFBD> !<21> 3*tl`<60> u<EFBFBD> \0 p '<27> 7<EFBFBD> P<EFBFBD> 9<7F> bs<62> { <EFBFBD> v<EFBFBD> { <EFBFBD> <EFBFBD> 7<EFBFBD> \" { <EFBFBD> <EFBFBD> r<EFBFBD> a<EFBFBD> (<28> ^<5E> <> <EFBFBD> E<EFBFBD> <45> <EFBFBD> <EFBFBD> <EFBFBD> g<> <67> /<2F> <> <EFBFBD> U<EFBFBD> 9g<39> <67> <EFBFBD> /<2F> <> `<60> \n L\n <EFBFBD> )<07> <> <14> (A<> a<EFBFBD> \" <20> <03> <> <09> &<26> P<EFBFBD> <14> @O\n 師 0<> (M &<17> FJ '<27> ! <20> 0<EFBFBD> <<3C> H<EFBFBD> <48> <EFBFBD> <EFBFBD> <0E> <> <EFBFBD> *<2A> |<7C> <> *<2A> OZ<4F> m*n/b<> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <0C> <> .<2E> <> <EFBFBD> o \0 <EFBFBD> <EFBFBD> dn<EFBFBD> )<29> <1E> <> <EFBFBD> i<EFBFBD> :R<> <52> <EFBFBD> P2<50> m<EFBFBD> \0 /v<> OX<4F> <58> <1C> Fʳψ<CAB3> <0F> <> <EFBFBD> \" <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0<04> 0<08> <> <EFBFBD> <EFBFBD> <16> 0b<30> <62> g j<> <6A> \$ <EFBFBD> n<EFBFBD> 0}<05> <05> @<40> = M Ƃ 0n<30> P<EFBFBD> /p<> ot<6F> <10> <> <EFBFBD> <EFBFBD> <EFBFBD> .<12> ̽<0B> g\0 <EFBFBD> ) o<> \n 0<EFBFBD> <EFBFBD> <EFBFBD> \r F<> <46> <0B> <07> b<EFBFBD> i<EFBFBD> <69> o}\n <EFBFBD> ̯<> NQ<0B> '<0B> x<EFBFBD> Fa<46> J<04> <> <EFBFBD> <EFBFBD> L<EFBFBD> <10> <0F> <> <04> <> \r <EFBFBD> <EFBFBD> \r <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0<> <07> '<0C> <> <EFBFBD> d oe p<> <13> 4D<34> <44> ʐ<> q(~<7E> <> <20> \r <EFBFBD> E<10> <> pr<70> QVFH<46> l<EFBFBD> <6C> Kj<4B> <6A> <EFBFBD> N&<26> j!<21> H`<11> _bh\r 1<EFBFBD> <0C> <> n !<21> Ɏ<> z<> <7A> <EFBFBD> <13> <> <0C> \\ <0F> <> \r <EFBFBD> <07> <> <EFBFBD> `V_k<5F> <6B> \" \\ ׂ' V<05> <> \0 ʾ `A C<> <43> <EFBFBD> <EFBFBD> <18> <> V<EFBFBD> `\r %<25> <> <EFBFBD> <02> <> <EFBFBD> \r <EFBFBD> <EFBFBD> <0E> <> k@N<> <4E> <EFBFBD> <EFBFBD> B<> 횙<11> <20> !<21> \n <EFBFBD> \0 Z<EFBFBD> 6<> \$ d<EFBFBD> <EFBFBD> ,%<03> %la<19> H<EFBFBD> \n <EFBFBD> #<23> S\$ !\$ @<40> <> 2<> <32> <EFBFBD> I \$ r<EFBFBD> { !<21> <> J<EFBFBD> 2H<32> Z M \\ <EFBFBD> <EFBFBD> hb,<2C> '||cj~g<> r<EFBFBD> `<60> ļ<EFBFBD> \$ <EFBFBD> <EFBFBD> <EFBFBD> +<2B> A1<41> <31> E <1F> <> <1F> <> <<3C> L<EFBFBD> <11> \$ <EFBFBD> Y%-FD<46> <44> d<EFBFBD> L 焳<> <E784B3> \n @<40> bVf<56> <66> ;2_(<28> <> L<EFBFBD> п<EFBFBD> <05> <%@ڜ , \" <EFBFBD> d<EFBFBD> <EFBFBD> N<EFBFBD> er<EFBFBD> \0 <EFBFBD> <EFBFBD> `<60> <0E> Z<0C> <> 4<EFBFBD> 'ld9-<2D> #`<60> <> Ŗ<EFBFBD> <C596> <EFBFBD> <EFBFBD> <EFBFBD> j6<6A> ƣ<EFBFBD> v<07> <> <04> N<EFBFBD> ͐f<CD90> <66> @܆<> &<26> B\$ <0B> <> (<28> Z&<26> <> <EFBFBD> 27 8I <20> <> <EFBFBD> P\r k \\ <EFBFBD> <EFBFBD> <EFBFBD> 2`<60> \r dL b@ E<14> <> 2`P( B'<27> <0B> <> <0F> <> 0<EFBFBD> &<05> <> { <EFBFBD> <EFBFBD> <EFBFBD> :<3A> <> dB<64> 1<EFBFBD> ^؉*\r \0 c< K<> |<06> 5sZ<73> `<60> <> <EFBFBD> O3<4F> 5=@<40> 5<EFBFBD> C>@<40> W* = \0 N<g<> 6s67Sm7 u? { <&L<04> . 3~D<> <44> \r Ś<0C> x<EFBFBD> <13> ) ,r<> i n<> /<2F> <> O \0 o { 0k<EFBFBD> ]3> m<> <05> 1 \0 <EFBFBD> I@<40> 9 T34+ԙ@e<0F> GF MC<4D> \r E3<EFBFBD> Etm!<13> #1<> D @<40> H(<28> <> n <20> <> <g,V`R]@<40> <> <EFBFBD> <EFBFBD> 3Cr7s~<7E> G I<> i@ \0 v<EFBFBD> <EFBFBD> 5 \r V<EFBFBD> '<1A> <> <EFBFBD> <0C> <> <08> P<05> <> \r <EFBFBD> \$ <b<> %(<28> Dd<44> <64> PW<50> <57> <EFBFBD> <EFBFBD> b<EFBFBD> fO <20> x \0 <EFBFBD> } <20> <0B> <> lb<6C> &<26> v j 4<> LS<1A> <> ִԶ5&d sF M<> 4<EFBFBD> <18> \" .H<> M0<4D> 1u L<> \" <EFBFBD> <EFBFBD> /J`<60> { <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> xǐYu*\" U.I53Q<33> 3Q<33> <51> J<EFBFBD> <4A> g<EFBFBD> <67> 5<EFBFBD> s<> <73> <EFBFBD> &jь<6A> <D18C> u<EFBFBD> ٭ ЪG Q MTmGB<47> t l- c<> *<2A> <> \r <02> <> Z7<5A> <37> <1B> *hs/RUV<55> <56> <EFBFBD> <EFBFBD> B<EFBFBD> Nˈ <4E> <CB88> <06> <> <EFBFBD> Ԋ<> i<EFBFBD> Lk<4C> .<2E> <> <EFBFBD> t<EFBFBD> <74> 龩<EFBFBD> rYi<59> <69> <EFBFBD> -S<> <53> 3<EFBFBD> \\ <EFBFBD> T<EFBFBD> OM^<5E> G><3E> ZQj<51> <07> <> \" <EFBFBD> <EFBFBD> <EFBFBD> i<EFBFBD> <EFBFBD> MsS<EFBFBD> S\$ Ib f<> <13> <> u<EFBFBD> <75> <08> <> <EFBFBD> :<04> SB|i<> <69> Y¦<0F> <> 8 v<07> #<02> <> D<EFBFBD> 4`<60> <> .<2E> <> ^<5E> H<EFBFBD> M<EFBFBD> _ռ <5F> u<EFBFBD> <75> U<EFBFBD> z`Z<> J e<> <65> <EFBFBD> @Ce<43> <65> a<EFBFBD> \" m<> b<12> 6ԯJR<4A> <EFBFBD> <0C> T<EFBFBD> ?ԣXMZ<4D> <5A> І <EFBFBD> <D086> p<EFBFBD> <70> <0F> <> Qv<51> j<13> jV<6A> { <EFBFBD> <EFBFBD> <EFBFBD> C<EFBFBD> \r <EFBFBD> <EFBFBD> 7<16> Tʞ<54> <20> <> 5{ P<EFBFBD> <EFBFBD> ]<12> \r <EFBFBD> ?Q<> AA<41> <41> <07> <> <EFBFBD> <EFBFBD> 2V)J i<> <69> -N 9 9f<39> l J m<> <6D> ;u<> @<40> <F<> Ѡ<EFBFBD> e<EFBFBD> j<0C> <> Ħ<> I<EFBFBD> <+CW@<40> <> <18> <> <EFBFBD> Z<EFBFBD> l<EFBFBD> 1<EFBFBD> <2<> iF<69> 7` KG<4B> ~L&+N<08> <> YtWH飑w <0E> <1A> <> <19> l<EFBFBD> <6C> s'g<04> <> q+L<> zbiz<69> <7A> <EFBFBD> Ţ<EFBFBD> .Њ<> zW<7A> <57> <20> zd<06> W<EFBFBD> <57> <EFBFBD> <EFBFBD> (<17> y)v<> E4,\0 <EFBFBD> \" d<> <64> \$ B<EFBFBD> { <EFBFBD> <EFBFBD> !) 1U<31> 5b p#<23> }m =<3D> <> @<40> w<12> P\0 <EFBFBD> \r <EFBFBD> <0C> <> <EFBFBD> <EFBFBD> `O|<7C> <> <0E> <09> ɍ<EFBFBD> <C98D> <EFBFBD> <EFBFBD> Y<EFBFBD> <59> JՂ<15> E<EFBFBD> <45> Ou<4F> _<EFBFBD> \n `F`<60> }
get_lang (){ global $ca ; return $ca ;} function
lang ( $v , $af = null ){ if ( is_string ( $v )){ $Xf = array_search ( $v , get_translations ( " en " )); if ( $Xf !== false ) $v = $Xf ;} global $ca , $mi ; $li = ( $mi [ $v ] ? $mi [ $v ] : $v ); if ( is_array ( $li )){ $Xf = ( $af == 1 ? 0 : ( $ca == 'cs' || $ca == 'sk' ? ( $af && $af < 5 ? 1 : 2 ) : ( $ca == 'fr' ? ( ! $af ? 0 : 1 ) : ( $ca == 'pl' ? ( $af % 10 > 1 && $af % 10 < 5 && $af / 10 % 10 != 1 ? 1 : 2 ) : ( $ca == 'sl' ? ( $af % 100 == 1 ? 0 : ( $af % 100 == 2 ? 1 : ( $af % 100 == 3 || $af % 100 == 4 ? 2 : 3 ))) : ( $ca == 'lt' ? ( $af % 10 == 1 && $af % 100 != 11 ? 0 : ( $af % 10 > 1 && $af / 10 % 10 != 1 ? 1 : 2 )) : ( $ca == 'bs' || $ca == 'ru' || $ca == 'sr' || $ca == 'uk' ? ( $af % 10 == 1 && $af % 100 != 11 ? 0 : ( $af % 10 > 1 && $af % 10 < 5 && $af / 10 % 10 != 1 ? 1 : 2 )) : 1 ))))))); $li = $li [ $Xf ];} $Fa = func_get_args (); array_shift ( $Fa ); $ed = str_replace ( " %d " , " %s " , $li ); if ( $ed != $li ) $Fa [ 0 ] = format_number ( $af ); return
vsprintf ( $ed , $Fa );} function
switch_lang (){ global $ca , $ie ; echo " <form action='' method='post'> \n <div id='lang'> " , lang ( 19 ) . " : " . html_select ( " lang " , $ie , $ca , " this.form.submit(); " ), " <input type='submit' value=' " . lang ( 20 ) . " ' class='hidden'> \n " , " <input type='hidden' name='token' value=' " . get_token () . " '> \n " ; echo " </div> \n </form> \n " ;} if ( isset ( $_POST [ " lang " ]) && verify_token ()){ cookie ( " adminer_lang " , $_POST [ " lang " ]); $_SESSION [ " lang " ] = $_POST [ " lang " ]; $_SESSION [ " translations " ] = array (); redirect ( remove_from_uri ());} $ca = " en " ; if ( isset ( $ie [ $_COOKIE [ " adminer_lang " ]])){ cookie ( " adminer_lang " , $_COOKIE [ " adminer_lang " ]); $ca = $_COOKIE [ " adminer_lang " ];} elseif ( isset ( $ie [ $_SESSION [ " lang " ]])) $ca = $_SESSION [ " lang " ]; else { $va = array (); preg_match_all ( '~([-a-z]+)(;q=([0-9.]+))?~' , str_replace ( " _ " , " - " , strtolower ( $_SERVER [ " HTTP_ACCEPT_LANGUAGE " ])), $ze , PREG_SET_ORDER ); foreach ( $ze
as $C ) $va [ $C [ 1 ]] = ( isset ( $C [ 3 ]) ? $C [ 3 ] : 1 ); arsort ( $va ); foreach ( $va
as $z => $ng ){ if ( isset ( $ie [ $z ])){ $ca = $z ; break ;} $z = preg_replace ( '~-.*~' , '' , $z ); if ( ! isset ( $va [ $z ]) && isset ( $ie [ $z ])){ $ca = $z ; break ;}}} $mi = $_SESSION [ " translations " ]; if ( $_SESSION [ " translations_version " ] != 944611216 ){ $mi = array (); $_SESSION [ " translations_version " ] = 944611216 ;} function
get_translations ( $he ){ switch ( $he ){ case " en " : $f = " A9 D<07> y<EFBFBD> @s:<3A> G<EFBFBD> <47> (<28> ff<66> <66> <EFBFBD> <EFBFBD> <EFBFBD> <09> <> :<1B> S<> <53> <EFBFBD> a2 \" 1<> .. L'<27> I<EFBFBD> <49> m<EFBFBD> #<23> s,<2C> K<17> <> OP#I<> @%9<> <39> i4<08> o2ύ<32> <CF8D> <EFBFBD> <EFBFBD> <EFBFBD> ,9<> %<02> P<EFBFBD> b2<19> <06> a<EFBFBD> <61> r\n 2<EFBFBD> N C<> (<28> r4<72> <34> 1C`(<28> :Eb<45> 9A<14> i:<02> &㙔<> y<EFBFBD> <79> F<> <46> <EFBFBD> Y<> <59> \r <13> \n <EFBFBD> 8Z<0E> S=\$ A<19> <> <0C> <13> `<60> =<3D> ܌<EFBFBD> <DC8C> <EFBFBD> 0<EFBFBD> \n <EFBFBD> <EFBFBD> dF<EFBFBD> <09> <> n:Zΰ)<29> <> Q<EFBFBD> <51> <EFBFBD> mw<6D> <77> <EFBFBD> <EFBFBD> O<EFBFBD> <4F> mfpQ<10> <> <CE82> q<> <71> a<EFBFBD> į<EFBFBD> <C4AF> <EFBFBD> \\ <EFBFBD> }<7D> <> 5<EFBFBD> #|@<40> h<EFBFBD> 3<> <33> N<EFBFBD> }@<40> <> i<EFBFBD> <03> <18> t<EFBFBD> sN}+<2B> \\ <EFBFBD> p<EFBFBD> ۥ<EFBFBD> +<2B> ̈<EFBFBD> NbB؍ <42> 8<EFBFBD> <38> <EFBFBD> #<23> <> '<0C> <> `P<> 2<EFBFBD> <32> +ಉ<> <E0B289> <EFBFBD> <EFBFBD> *<2A> <> <EFBFBD> /<2F> h<EFBFBD> <68> H<> \n <EFBFBD> :<3A> <> 9<0C> +8<> <38> <EFBFBD> 8<EFBFBD> 7<EFBFBD> Cs<43> <73> \r <EFBFBD> `<60> <> <08> j<07> Ѐ<> <D080> <EFBFBD> D4<0E> <> <EFBFBD> 9<EFBFBD> Ax^;<3B> r@6<> k<EFBFBD> \\ <EFBFBD> <EFBFBD> <EFBFBD> |w-<Q<> <51> <EFBFBD> <EFBFBD> <EFBFBD> xD<78> <07> Jċ<4A> <C48B> <EFBFBD> x<17> !<21> ~<7E> B<EFBFBD> @<40> <01> C<EFBFBD> <43> )<29> 0<EFBFBD> :<3A> 8<EFBFBD> (Ʀ <> k<EFBFBD> Q9<0E> ;<3B> :<3A> <> KN <20> <> <EFBFBD> <EFBFBD> 2c(<28> Q<> sB<73> 4<EFBFBD> e\n <EFBFBD> C<EFBFBD> <EFBFBD> 78o<38> J<EFBFBD> <4A> C<EFBFBD> :<04> a Jξb<18> 6%<25> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> p<EFBFBD> 4<EFBFBD> \" <08> <> /c\\ 8<EFBFBD> (<28> 0<EFBFBD> <30> m 0<> \r 8<EFBFBD> ><3E> <> P<EFBFBD> :<3A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> #8<38> <CE80> <EFBFBD> <EFBFBD> A#<18> 9<> <39> <EFBFBD> <EFBFBD> -Bμ<42> <CEBC> H<EFBFBD> <1D> <> k<EFBFBD> <6B> <EFBFBD> £<EFBFBD> <1E> c;<3B> JZM}<7D> b<EFBFBD> <62> <EFBFBD> p9<70> ncQ<<3C> \r uo ,<2C> <> l9<6C> ԥ<1A> <> 1<EFBFBD> <31> J<EFBFBD> <4A> <03> <1C> B \0 <20> <> <EFBFBD> 0<EFBFBD> ˈ <EFBFBD> 㸾@(2L<32> <4C> 3 8 \" <EFBFBD> j<> <6A> <EFBFBD> l<EFBFBD> <6C> <EFBFBD> <EFBFBD> 9<1B> \" MF=<3D> /<2F> <> <EFBFBD> F<EFBFBD> lB\r <04> <> 0<EFBFBD> 6J<36> Df3<66> <33> Ȩ7<C8A8> Q<EFBFBD> <51> <<3C> k<EFBFBD> u<> c<EFBFBD> <63> bDZ<62> v 2<> REl<45> a<06> Tʃuvс :<3A> <> p<EFBFBD> (@Ǯk<C7AE> }<7D> <> <EFBFBD> à0<C3A0> ;ZC<5A> <43> <EFBFBD> 2<EFBFBD> ;Y JB!<21> b<EFBFBD> <62> ˍ<EFBFBD> \\ v [X˼ \" Θo<EFBFBD> ^<5E> j(><3E> <> <EFBFBD> #bP*1cp֟<0C> ;<3B> <> <EFBFBD> ɶ<> <C9B6> # \\ <EFBFBD> ]4|<7C> <> H<EFBFBD> 2<EFBFBD> <07> :(ع<> \\ <EFBFBD> >k<> <03> 8\r ( ɲ#<23> .I<> <49> <EFBFBD> ? \000 7% T=G<> LV<4C> <56> <EFBFBD> g<EFBFBD> <67> wr<1D> #I T<> 'J<03> <> <EFBFBD> ʣ<EFBFBD> <CAA3> 9K2ہ /L ɖM<11> <> <EFBFBD> <EFBFBD> q@ <09> 9<EFBFBD> \\ <EFBFBD> j)<29> <> 95g<35> <67> <12> <> tA<74> <41> <14> \\ TUQ<EFBFBD> \" <EFBFBD> `2:w2 W<> <57> <0E> <> ~<7E> <> _<> l\r &<26> <> 3)f<> <66> <1A> <> z<EFBFBD> <7A> <11> <> 0@<40> b `<60> 9<EFBFBD> <06> <> a<EFBFBD> <0B> <<3C> 跛<EFBFBD> @wa<77> <13> <> <EFBFBD> (<04> <> z<EFBFBD> /<2F> <> \0 RH<EFBFBD> \" q<04> <> <12> \\ <1B> <> <EFBFBD> 9<EFBFBD> Ȇ<> &E̩!<21> <> <EFBFBD> <EFBFBD> <14> <> <EFBFBD> <09> 5% Ě<> xl!<21> l0Ĩ<30> <12> `ۃi<DB83> Q<EFBFBD> \" 8 HVIN8d'<27> =u<> X<EFBFBD> <0E> <> ;<05> _I \" z<0B> <20> <18> <> <18> A<EFBFBD> c<EFBFBD> 4 8<> 80<19> 0vN<76> G<EFBFBD> <47> v<EFBFBD> H<EFBFBD> <48> ;<3B> <> <EFBFBD> <EFBFBD> WN<57> Qi<51> <)<29> @@<40> \\ <EFBFBD> R&<26> <20> d_<11> |<7C> cr<63> <72> <EFBFBD> 'nINpr[PH<50> <48> <15> cICF`<60> 0̑<30> @H<> <48> gr<67> <10> <> #&H<> 0T<30> <54> <09> %<25> <02> \$ <EFBFBD> <EFBFBD> <01> 2<> KK<4B> rHt<1A> e4ѰO <09> <> *<2A> \0 <EFBFBD> B<> E T @<40> - c*<2A> X<EFBFBD> <58> <09> <> 4<EFBFBD> <34> dd<64> W<EFBFBD> O,kMJ I<p Ho5Dr<44> <72> <EFBFBD> <EFBFBD> Ѵ <> \r <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F<EFBFBD> HY<EFBFBD> 1%<07> <> # |b<> Q<EFBFBD> <51> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> H<EFBFBD> <48> <12> E<EFBFBD> <45> Z<EFBFBD> Y<EFBFBD> ON<4F> (\r <EFBFBD> <EFBFBD> <1E> <> <15> L>S<07> <> <EFBFBD> <EFBFBD> <EFBFBD> C <09> \" <EFBFBD> @<40> 7<EFBFBD> <37> C8h<38> :(?<3F> \$ P R4<52> \$ <EFBFBD> &&<26> 0<> AI[<5B> <> <EFBFBD> <15> \r \\ 'J<> \n <EFBFBD> <06> R<13> <> E<EFBFBD> <12> <> <EFBFBD> <EFBFBD> <EFBFBD> )<29> %c<> e\0 <16> N<> \n <EFBFBD> RaX4<EFBFBD> ` Ŏ]!<21> <> <EFBFBD> I<EFBFBD> k\n y<EFBFBD> \n d 9.<2E> ><3E> L<EFBFBD> <4C> a<EFBFBD> <61> <EFBFBD> i<> >A<04> <> <EFBFBD> <EFBFBD> k<1F> J<EFBFBD> <4A> <EFBFBD> <EFBFBD> DaA #<23> x<EFBFBD> U Wv<18> <> g6g+<2B> QJ<51> <4A> \" <EFBFBD> <EFBFBD> ` <> { 4zL<EFBFBD> ;<17> (<02> A a JR<4A> gI<67> H7<48> 2%.z<> C<> <43> <EFBFBD> <EFBFBD> <EFBFBD> ٠ <EFBFBD> HAx <20> <> <08> *<2A> B`<60> ( \n \n 7լZ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> O m<> T<EFBFBD> X<19> Lr 8<0C> `[I<> <49> P <20> X2<58> <32> K<EFBFBD> Ұ<EFBFBD> -<2D> i<EFBFBD> 5i<01> 3o% \n <EFBFBD> <EFBFBD> 6lS<EFBFBD> pP.<2E> <> <EFBFBD> <EFBFBD> <EFBFBD> l_\n <EFBFBD> <EFBFBD> /<2F> <> <0C> B<EFBFBD> <42> <0F> D' ro\" ܄ @<40> !<1F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 8P瑼D@(+<2B> PŔ<50> <C594> <EFBFBD> <EFBFBD> <EFBFBD> Ih B<> j<08> p<EFBFBD> <70> T<EFBFBD> _% a3 l<> <6C> ij<EFBFBD> 0<EFBFBD> <30> <EFBFBD> 9e gY<11> b<EFBFBD> LKhI3<49> <33> œ<EFBFBD> <C593> <EFBFBD> WIȨ<49> 谘<EFBFBD> <E8B098> ey P: =<3D> ,<2C> <> <1E> <> /<2F> )Ӛ-\r <EFBFBD> <EFBFBD> -C<> <43> <EFBFBD> Z q<> <71> <EFBFBD> 1Q<31> O -A<> ^<5E> <> @ wKQ<4B> <51> sR<73> <52> Xk<14> <> Lqj*o!td<74> <64> <EFBFBD> <EFBFBD> <EFBFBD> QF<51> <46> <EFBFBD> <EFBFBD> `<60> <1D> E<EFBFBD> =XY'̽<> 3-P<16> Y<1A> lҞ<15> <> <EFBFBD> j<EFBFBD> 6<EFBFBD> PPE<50> i<EFBFBD> %<25> <> <EFBFBD> %<25> <> ><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> b*y<> <79> <EFBFBD> <EFBFBD> 0H<30> <48> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5<<3C> <> ZSsT<73> 㴭<EFBFBD> G\n l<EFBFBD> !n<> Q/<2F> <> <02> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɸd<C9B8> <64> e<EFBFBD> <65> <EFBFBD> 8<EFBFBD> tU<74> U<EFBFBD> :<3A> 8 \\ 9 (a<> <09> +<2B> <11> <> & \\ x<EFBFBD> <EFBFBD> <EFBFBD> <0B> <> <0C> 6<> }<7D> <> <11> 4<EFBFBD> 2<EFBFBD> <01> } V<> <56> u<14> W;<3B> <> <EFBFBD> sϹ <73> <0E> V<EFBFBD> <56> <EFBFBD> <EFBFBD> rh_<68> \r `<60> Sn<53> <04> Sv<53> I<EFBFBD> 5<<3C> <> C<EFBFBD> <43> %tY<74> <59> 6 M<> <4D> h<EFBFBD> I.=D<> <44> <EFBFBD> cz \\ <EFBFBD> D<EFBFBD> <EFBFBD> F<15> <07> <> Z<1A> \\ ӟZ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˩:6ש<36> <D7A9> mg<14> 6<EFBFBD> o<EFBFBD> <6F> <EFBFBD> <EFBFBD> <0B> 7^<5E> % #<23> <> m<EFBFBD> S<EFBFBD> <1A> s<EFBFBD> <73> 2<EFBFBD> <32> <EFBFBD> <<3C> <> <EFBFBD> 8<EFBFBD> <38> <EFBFBD> <EFBFBD> <15> }'<27> <> >`<60> Zb<5A> <62> <EFBFBD> <EFBFBD> <0C> ®<EFBFBD> 0<EFBFBD> k<<3C> <15> z<EFBFBD> <EFBFBD> <C29C> dJJ!4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> C<EFBFBD> <43> <EFBFBD> x<> <78> Lq/PJ>'<27> <> ~o z澴v R<> F<EFBFBD> <46> 5<EFBFBD> <35> <EFBFBD> <EFBFBD> ׄ>ś}<7D> <> UwA<77> %<25> <> <EFBFBD> <EFBFBD> o7t<37> <74> G<EFBFBD> <47> <0F> Ӻ JO<4A> <4F> <EFBFBD> o/<16> <> \\ /<2F> <> <EFBFBD> <EFBFBD> p<EFBFBD> f<> <66> >V<> <56> <EFBFBD> gO O<> <4F> <EFBFBD> <EFBFBD> ><3E> <> \0 <EFBFBD> <EFBFBD> <EFBFBD> @<40> <> #<23> <> <18> bҸONڇO<01> <> <EFBFBD> <EFBFBD> fl<66> :<3A> <> <EFBFBD> f<EFBFBD> <66> \$ F \n <EFBFBD> Z4<EFBFBD> J6 I np<6E> <70> <EFBFBD> 7<EFBFBD> ><3E> BQ 02<30> <32> <EFBFBD> @<40> :<3A> <> E<EFBFBD> <45> <EFBFBD> <20> <> Ph<50> @<40> r#NU/<2F> t<EFBFBD> l\r hH<EFBFBD> P<EFBFBD> 0f<EFBFBD> <EFBFBD> <EFBFBD> p<EFBFBD> 0<EFBFBD> <EFBFBD> o2#<23> ~<7E> f<EFBFBD> # \" <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> o<14> m(<28> e8\r <EFBFBD> n<0E> L <20> <> 2>\0 <EFBFBD> `<60> i<EFBFBD> <69> \r n<EFBFBD> \$ ml#<06> N`<60> ư/<03> ' ƃ&<26> z<EFBFBD> <7A> \n <EFBFBD> <EFBFBD> <05> p)ţ<10> <> <EFBFBD> n\\ <EFBFBD> <EFBFBD> Z<EFBFBD> h:<3A> l<EFBFBD> <6C> ʂ<EFBFBD> <CA82> 6<EFBFBD> <36> D\" m,3<06> <> .<2E> 4JR.<2E> <0C> @ؠ<03> 6<EFBFBD> <36> .⚹<10> 3 \n g ư<> j<EFBFBD> Y fs龦h<E9BEA6> b*<2A> \$ <03> E<03> \" <EFBFBD> ʄ<EFBFBD> ' !<1A> <> <EFBFBD> \r <EFBFBD> <EFBFBD> <EFBFBD> Z-Vұ<56> <D2B1> -B<> c Ց<> M<> ;<1C> <> \r <EFBFBD> <EFBFBD> <EFBFBD> H<EFBFBD> 1<EFBFBD> <EFBFBD> -<2D> @<40> C,<2C> <> 4<EFBFBD> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ư&^<5E> <10> <> <EFBFBD> @ <09> @[<5B> <> <20> <> \0 <EFBFBD> /<2F> <> ʮ<EFBFBD> \0 <EFBFBD> %<25> <16> d<EFBFBD> 'e(-<2D> <> #@<40> <<10> <> G<EFBFBD> y<EFBFBD> vZ 9 <20> <> <EFBFBD> )<29> ȗ<EFBFBD> <C897> :rR1<52> &<02> Yo<59> <6F> <EFBFBD> <<3C> .R<> <52> -K<> 2<EFBFBD> b<EFBFBD> `<60> <05> r\$ <EFBFBD> l/<2F> `<60> ES(r<> <72> Q<EFBFBD> <51> <EFBFBD> <EFBFBD> *@" ; break ; case " ar " : $f = " <EFBFBD> C<EFBFBD> P<EFBFBD> <> <C28D> l*<2A> \r <EFBFBD> ,&\n <EFBFBD> A<EFBFBD> <15> <> <EFBFBD> (J.<19> <> 0Se\\ <EFBFBD> \r <EFBFBD> <EFBFBD> b<> @<40> 0<> ,\n Q,l)<29> <> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> A<14> <> j _1<5F> C<EFBFBD> M<EFBFBD> <4D> e<0B> <> S<> \n g@<40> Og<4F> <67> <EFBFBD> <EFBFBD> X<EFBFBD> DM<44> )<29> <> 0<18> <> cA<63> <41> n8<1C> e*y#au4<75> <34> <20> Ir*;rS<72> U<> dJ }<7D> <> <EFBFBD> *z<> U<12> @<40> <> X;ai1l(n<> <1B> <> <EFBFBD> <EFBFBD> <EFBFBD> [<14> y<EFBFBD> d<EFBFBD> u 'c(<28> <> o F<> <46> <EFBFBD> <EFBFBD> e3<65> Nb<03> <> <EFBFBD> p2 N<> S<EFBFBD> <53> ӳ: LZ<4C> z<EFBFBD> P<EFBFBD> \\ b<EFBFBD> <EFBFBD> u<EFBFBD> .<2E> [<5B> Q`u !<15> <> Jy<4A> <79> &2<11> <> (gT<1C> <> SњM<D19A> x<EFBFBD> 5g5<67> K<EFBFBD> K<EFBFBD> ¦<EFBFBD> <C2A6> <EFBFBD> <EFBFBD> <EFBFBD> 0ʇƢ<CA87> <C6A2> \n S <20> <> r \$ <EFBFBD> <10> <> j<EFBFBD> (<28> <> v<EFBFBD> <76> <EFBFBD> <0E> !Jb<4A> <62> <EFBFBD> <EFBFBD> q<02> <> 0\n <EFBFBD> <EFBFBD> j\n <EFBFBD> <10> <> <EFBFBD> <0C> <> j<EFBFBD> <6A> @<40> z<18> l<\$ W<EFBFBD> <EFBFBD> rؓ<EFBFBD> <EFBFBD> s<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <1A> U&<26> [<1A> *<2A> <> l<08> ꎠ(B&<26> <> <EFBFBD> <EFBFBD> <04> 4_ !<05> <1A> <> d \\ B<EFBFBD> <EFBFBD> =<3D> t[<17> <09> <> ?<3F> :<3A> X<EFBFBD> <58> ؐ<> eJ \$ <EFBFBD> <EFBFBD> <EFBFBD> \n &<26> 3ޜ:<3A> <> <EFBFBD> <03> <> ñ?+T \n <08> Ь <1B> J<> \0 x0<EFBFBD> #<23> <> 3<07> <10> :<0E> <> <EFBFBD> <05> x<EFBFBD> Q<EFBFBD> <51> <08> 6<EFBFBD> C(<28> \r <EFBFBD> <EFBFBD> <EFBFBD> <17> <> u`<7cp<63> 4<EFBFBD> <34> <EFBFBD> D<EFBFBD> <07> H<EFBFBD> 85<38> mb:<07> x<EFBFBD> )m<> <6D> ލ<EFBFBD> #h<> m(<28> (<28> <> Kv<4B> <76> %<25> <> [G<> B<EFBFBD> =2 m[<5B> <> <0C> <> j<EFBFBD> Q%<25> <> u q<> s<EFBFBD> d<EFBFBD> <64> J CD<43> S Z<> ɻ<EFBFBD> <C9BB> B<> <42> 9\r <EFBFBD> PΎ<04> t<EFBFBD> <74> #<23> <13> <> <EFBFBD> 1<EFBFBD> <31> ^O<> |<7C> <> W<EFBFBD> e<EFBFBD> /<2F> J]9J<39> <4A> \" R<EFBFBD> <08> 6<0E> \0 <EFBFBD> 0<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> F<EFBFBD> r<EFBFBD> <EFBFBD> <EFBFBD> I<EFBFBD> Z<EFBFBD> <EFBFBD> )<29> ֛ kR<<3C> <> J<EFBFBD> #=^V<> e\$ O<EFBFBD> <19> Y<<3C> ^ \$ [<5B> b Zƥ-<2D> m< P<> <50> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ףc<18> 7L) D<> <44> bbԇ<15> <> <EFBFBD> <EFBFBD> b<EFBFBD> <62> <04> <> <13> <> <EFBFBD> O \n <04> <> <EFBFBD> <EFBFBD> v<EFBFBD> 2@<40> <> o<EFBFBD> 1lk<6C> Ȧ 7 [<5B> <> /<1E> <> q<EFBFBD> <71> A<EFBFBD> <41> <04> <> 1<EFBFBD> <31> <EFBFBD> <EFBFBD> <EFBFBD> ;N<> <4E> ` u<> wf<77> ý#<23> +<2B> GN,<2C> <> ;[<5B> Ν <08> <13> <> q<EFBFBD> F<EFBFBD> ƃ<7F> <C683> 6 L<> A<EFBFBD> <41> <EFBFBD> x<EFBFBD> 3\r <EFBFBD> K\n <EFBFBD> Q< Mɸ *\r <EFBFBD> @۳<> !\0 <EFBFBD> [<0E> <18> <> c6N\r <EFBFBD> x<EFBFBD> <EFBFBD> ach9{ <EFBFBD> <08> 0<EFBFBD> A 넄 @<40> :<3A> a@<40> \n Jy'!<21> <> 0<> <14> 1 *<2A> |<7C> <> C<EFBFBD> +Arl!<21> i \0 <EFBFBD> <EFBFBD> <EFBFBD> { ˊ <EFBFBD> Dlx<EFBFBD> <EFBFBD> t֛[<5B> 1z<31> <> <1C> ע݄hu;<3B> <> <EFBFBD> [ <20> <> 4A<34> 5<EFBFBD> 0̫^<5E> <> =`<60> <20> uR<1C> pcW*<2A> 2*<2A> @<40> Ԫ<EFBFBD> S%0<03> ȮM<C8AE> X<> <1C> <> <EFBFBD> <EFBFBD> !<21> J<EFBFBD> '<05> (\r <EFBFBD> U<> 3<EFBFBD>
2014-05-08 19:46:08 +02:00
Min_PDO
extends
PDO { var $_result , $server_info , $affected_rows , $errno , $error ; function
2018-04-01 23:34:54 +02:00
__construct (){ global $b ; $Xf = array_search ( " SQL " , $b -> operators ); if ( $Xf !== false ) unset ( $b -> operators [ $Xf ]);} function
dsn ( $jc , $V , $G , $rf = array ()){ try { parent :: __construct ( $jc , $V , $G , $rf );} catch ( Exception $Ac ){ auth_error ( h ( $Ac -> getMessage ()));} $this -> setAttribute ( 13 , array ( 'Min_PDOStatement' )); $this -> server_info =@ $this -> getAttribute ( 4 );} function
query ( $H , $wi = false ){ $I = parent :: query ( $H ); $this -> error = " " ; if ( ! $I ){ list (, $this -> errno , $this -> error ) = $this -> errorInfo (); return
false ;} $this -> store_result ( $I ); return $I ;} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result ( $I = null ){ if ( ! $I ){ $I = $this -> _result ; if ( ! $I ) return
false ;} if ( $I -> columnCount ()){ $I -> num_rows = $I -> rowCount (); return $I ;} $this -> affected_rows = $I -> rowCount (); return
2014-05-08 19:46:08 +02:00
true ;} function
next_result (){ if ( ! $this -> _result ) return
false ; $this -> _result -> _offset = 0 ; return @ $this -> _result -> nextRowset ();} function
2018-04-01 23:34:54 +02:00
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! $I ) return
false ; $K = $I -> fetch (); return $K [ $p ];}} class
2014-05-08 19:46:08 +02:00
Min_PDOStatement
extends
PDOStatement { var $_offset = 0 , $num_rows ; function
fetch_assoc (){ return $this -> fetch ( 2 );} function
fetch_row (){ return $this -> fetch ( 3 );} function
2018-04-01 23:34:54 +02:00
fetch_field (){ $K = ( object ) $this -> getColumnMeta ( $this -> _offset ++ ); $K -> orgtable = $K -> table ; $K -> orgname = $K -> name ; $K -> charsetnr = ( in_array ( " blob " ,( array ) $K -> flags ) ? 63 : 0 ); return $K ;}}} $ec = array (); class
2014-05-08 19:46:08 +02:00
Min_SQL { var $_conn ; function
2017-06-25 00:56:50 +02:00
__construct ( $g ){ $this -> _conn = $g ;} function
2018-04-01 23:34:54 +02:00
select ( $R , $M , $Z , $md , $tf = array (), $_ = 1 , $F = 0 , $fg = false ){ global $b , $y ; $Td = ( count ( $md ) < count ( $M )); $H = $b -> selectQueryBuild ( $M , $Z , $md , $tf , $_ , $F ); if ( ! $H ) $H = " SELECT " . limit (( $_GET [ " page " ] != " last " && $_ != " " && $md && $Td && $y == " sql " ? " SQL_CALC_FOUND_ROWS " : " " ) . implode ( " , " , $M ) . " \n FROM " . table ( $R ),( $Z ? " \n WHERE " . implode ( " AND " , $Z ) : " " ) . ( $md && $Td ? " \n GROUP BY " . implode ( " , " , $md ) : " " ) . ( $tf ? " \n ORDER BY " . implode ( " , " , $tf ) : " " ),( $_ != " " ? + $_ : null ),( $F ? $_ * $F : 0 ), " \n " ); $vh = microtime ( true ); $J = $this -> _conn -> query ( $H ); if ( $fg ) echo $b -> selectQuery ( $H , $vh , ! $J ); return $J ;} function
delete ( $R , $pg , $_ = 0 ){ $H = " FROM " . table ( $R ); return
queries ( " DELETE " . ( $_ ? limit1 ( $R , $H , $pg ) : " $H $pg " ));} function
update ( $R , $P , $pg , $_ = 0 , $N = " \n " ){ $Ni = array (); foreach ( $P
as $z => $X ) $Ni [] = " $z = $X " ; $H = table ( $R ) . " SET $N " . implode ( " , $N " , $Ni ); return
queries ( " UPDATE " . ( $_ ? limit1 ( $R , $H , $pg , $N ) : " $H $pg " ));} function
insert ( $R , $P ){ return
queries ( " INSERT INTO " . table ( $R ) . ( $P ? " ( " . implode ( " , " , array_keys ( $P )) . " ) \n VALUES ( " . implode ( " , " , $P ) . " ) " : " DEFAULT VALUES " ));} function
insertUpdate ( $R , $L , $dg ){ return
2014-05-08 19:46:08 +02:00
false ;} function
begin (){ return
queries ( " BEGIN " );} function
commit (){ return
queries ( " COMMIT " );} function
rollback (){ return
2018-04-01 23:34:54 +02:00
queries ( " ROLLBACK " );} function
convertSearch ( $v , $X , $p ){ return $v ;} function
value ( $X , $p ){ return $X ;} function
quoteBinary ( $Rg ){ return
q ( $Rg );} function
warnings (){ return '' ;} function
tableHelp ( $D ){}} $ec [ " sqlite " ] = " SQLite 3 " ; $ec [ " sqlite2 " ] = " SQLite 2 " ; if ( isset ( $_GET [ " sqlite " ]) || isset ( $_GET [ " sqlite2 " ])){ $ag = array (( isset ( $_GET [ " sqlite " ]) ? " SQLite3 " : " SQLite " ), " PDO_SQLite " ); define ( " DRIVER " ,( isset ( $_GET [ " sqlite " ]) ? " sqlite " : " sqlite2 " )); if ( class_exists ( isset ( $_GET [ " sqlite " ]) ? " SQLite3 " : " SQLiteDatabase " )){ if ( isset ( $_GET [ " sqlite " ])){ class
Min_SQLite { var $extension = " SQLite3 " , $server_info , $affected_rows , $errno , $error , $_link ; function
__construct ( $Uc ){ $this -> _link = new
SQLite3 ( $Uc ); $Qi = $this -> _link -> version (); $this -> server_info = $Qi [ " versionString " ];} function
query ( $H ){ $I =@ $this -> _link -> query ( $H ); $this -> error = " " ; if ( ! $I ){ $this -> errno = $this -> _link -> lastErrorCode (); $this -> error = $this -> _link -> lastErrorMsg (); return
false ;} elseif ( $I -> numColumns ()) return
new
Min_Result ( $I ); $this -> affected_rows = $this -> _link -> changes (); return
true ;} function
quote ( $Q ){ return ( is_utf8 ( $Q ) ? " ' " . $this -> _link -> escapeString ( $Q ) . " ' " : " x' " . reset ( unpack ( 'H*' , $Q )) . " ' " );} function
store_result (){ return $this -> _result ;} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! is_object ( $I )) return
false ; $K = $I -> _result -> fetchArray (); return $K [ $p ];}} class
Min_Result { var $_result , $_offset = 0 , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ;} function
fetch_assoc (){ return $this -> _result -> fetchArray ( SQLITE3_ASSOC );} function
fetch_row (){ return $this -> _result -> fetchArray ( SQLITE3_NUM );} function
fetch_field (){ $d = $this -> _offset ++ ; $U = $this -> _result -> columnType ( $d ); return ( object ) array ( " name " => $this -> _result -> columnName ( $d ), " type " => $U , " charsetnr " => ( $U == SQLITE3_BLOB ? 63 : 0 ),);} function
__desctruct (){ return $this -> _result -> finalize ();}}} else { class
Min_SQLite { var $extension = " SQLite " , $server_info , $affected_rows , $error , $_link ; function
__construct ( $Uc ){ $this -> server_info = sqlite_libversion (); $this -> _link = new
SQLiteDatabase ( $Uc );} function
query ( $H , $wi = false ){ $Me = ( $wi ? " unbufferedQuery " : " query " ); $I =@ $this -> _link -> $Me ( $H , SQLITE_BOTH , $o ); $this -> error = " " ; if ( ! $I ){ $this -> error = $o ; return
false ;} elseif ( $I === true ){ $this -> affected_rows = $this -> changes (); return
true ;} return
new
Min_Result ( $I );} function
quote ( $Q ){ return " ' " . sqlite_escape_string ( $Q ) . " ' " ;} function
store_result (){ return $this -> _result ;} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! is_object ( $I )) return
false ; $K = $I -> _result -> fetch (); return $K [ $p ];}} class
Min_Result { var $_result , $_offset = 0 , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ; if ( method_exists ( $I , 'numRows' )) $this -> num_rows = $I -> numRows ();} function
fetch_assoc (){ $K = $this -> _result -> fetch ( SQLITE_ASSOC ); if ( ! $K ) return
false ; $J = array (); foreach ( $K
as $z => $X ) $J [( $z [ 0 ] == '"' ? idf_unescape ( $z ) : $z )] = $X ; return $J ;} function
fetch_row (){ return $this -> _result -> fetch ( SQLITE_NUM );} function
fetch_field (){ $D = $this -> _result -> fieldName ( $this -> _offset ++ ); $Tf = '(\\[.*]|"(?:[^"]|"")*"|(.+))' ; if ( preg_match ( " ~^( $Tf\\ .)? $Tf\ $ ~ " , $D , $C )){ $R = ( $C [ 3 ] != " " ? $C [ 3 ] : idf_unescape ( $C [ 2 ])); $D = ( $C [ 5 ] != " " ? $C [ 5 ] : idf_unescape ( $C [ 4 ]));} return ( object ) array ( " name " => $D , " orgname " => $D , " orgtable " => $R ,);}}}} elseif ( extension_loaded ( " pdo_sqlite " )){ class
Min_SQLite
extends
Min_PDO { var $extension = " PDO_SQLite " ; function
__construct ( $Uc ){ $this -> dsn ( DRIVER . " : $Uc " , " " , " " );}}} if ( class_exists ( " Min_SQLite " )){ class
Min_DB
extends
Min_SQLite { function
__construct (){ parent :: __construct ( " :memory: " ); $this -> query ( " PRAGMA foreign_keys = 1 " );} function
select_db ( $Uc ){ if ( is_readable ( $Uc ) && $this -> query ( " ATTACH " . $this -> quote ( preg_match ( " ~(^[/ \\ \\ ]|:)~ " , $Uc ) ? $Uc : dirname ( $_SERVER [ " SCRIPT_FILENAME " ]) . " / $Uc " ) . " AS a " )){ parent :: __construct ( $Uc ); $this -> query ( " PRAGMA foreign_keys = 1 " ); return
true ;} return
false ;} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
next_result (){ return
false ;}}} class
Min_Driver
extends
Min_SQL { function
insertUpdate ( $R , $L , $dg ){ $Ni = array (); foreach ( $L
as $P ) $Ni [] = " ( " . implode ( " , " , $P ) . " ) " ; return
queries ( " REPLACE INTO " . table ( $R ) . " ( " . implode ( " , " , array_keys ( reset ( $L ))) . " ) VALUES \n " . implode ( " , \n " , $Ni ));} function
tableHelp ( $D ){ if ( $D == " sqlite_sequence " ) return " fileformat2.html#seqtab " ; if ( $D == " sqlite_master " ) return " fileformat2.html# $D " ;}} function
idf_escape ( $v ){ return '"' . str_replace ( '"' , '""' , $v ) . '"' ;} function
table ( $v ){ return
idf_escape ( $v );} function
connect (){ return
new
Min_DB ;} function
get_databases (){ return
array ();} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return " $H $Z " . ( $_ !== null ? $N . " LIMIT $_ " . ( $E ? " OFFSET $E " : " " ) : " " );} function
limit1 ( $R , $H , $Z , $N = " \n " ){ global $g ; return ( preg_match ( '~^INTO~' , $H ) || $g -> result ( " SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT') " ) ? limit ( $H , $Z , 1 , 0 , $N ) : " $H WHERE rowid = (SELECT rowid FROM " . table ( $R ) . $Z . $N . " LIMIT 1) " );} function
db_collation ( $m , $qb ){ global $g ; return $g -> result ( " PRAGMA encoding " );} function
engines (){ return
array ();} function
logged_user (){ return
get_current_user ();} function
tables_list (){ return
get_key_vals ( " SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY (name = 'sqlite_sequence'), name " , 1 );} function
count_tables ( $l ){ return
array ();} function
table_status ( $D = " " ){ global $g ; $J = array (); foreach ( get_rows ( " SELECT name AS Name, type AS Engine, 'rowid' AS Oid, '' AS Auto_increment FROM sqlite_master WHERE type IN ('table', 'view') " . ( $D != " " ? " AND name = " . q ( $D ) : " ORDER BY name " )) as $K ){ $K [ " Rows " ] = $g -> result ( " SELECT COUNT(*) FROM " . idf_escape ( $K [ " Name " ])); $J [ $K [ " Name " ]] = $K ;} foreach ( get_rows ( " SELECT * FROM sqlite_sequence " , null , " " ) as $K ) $J [ $K [ " name " ]][ " Auto_increment " ] = $K [ " seq " ]; return ( $D != " " ? $J [ $D ] : $J );} function
is_view ( $S ){ return $S [ " Engine " ] == " view " ;} function
fk_support ( $S ){ global $g ; return ! $g -> result ( " SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY') " );} function
fields ( $R ){ global $g ; $J = array (); $dg = " " ; foreach ( get_rows ( " PRAGMA table_info( " . table ( $R ) . " ) " ) as $K ){ $D = $K [ " name " ]; $U = strtolower ( $K [ " type " ]); $Sb = $K [ " dflt_value " ]; $J [ $D ] = array ( " field " => $D , " type " => ( preg_match ( '~int~i' , $U ) ? " integer " : ( preg_match ( '~char|clob|text~i' , $U ) ? " text " : ( preg_match ( '~blob~i' , $U ) ? " blob " : ( preg_match ( '~real|floa|doub~i' , $U ) ? " real " : " numeric " )))), " full_type " => $U , " default " => ( preg_match ( " ~'(.*)'~ " , $Sb , $C ) ? str_replace ( " '' " , " ' " , $C [ 1 ]) : ( $Sb == " NULL " ? null : $Sb )), " null " =>! $K [ " notnull " ], " privileges " => array ( " select " => 1 , " insert " => 1 , " update " => 1 ), " primary " => $K [ " pk " ],); if ( $K [ " pk " ]){ if ( $dg != " " ) $J [ $dg ][ " auto_increment " ] = false ; elseif ( preg_match ( '~^integer$~i' , $U )) $J [ $D ][ " auto_increment " ] = true ; $dg = $D ;}} $qh = $g -> result ( " SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q ( $R )); preg_match_all ( '~(("[^"]*+")+|[a-z0-9_]+)\s+text\s+COLLATE\s+(\'[^\']+\'|\S+)~i' , $qh , $ze , PREG_SET_ORDER ); foreach ( $ze
as $C ){ $D = str_replace ( '""' , '"' , preg_replace ( '~^"|"$~' , '' , $C [ 1 ])); if ( $J [ $D ]) $J [ $D ][ " collation " ] = trim ( $C [ 3 ], " ' " );} return $J ;} function
indexes ( $R , $h = null ){ global $g ; if ( ! is_object ( $h )) $h = $g ; $J = array (); $qh = $h -> result ( " SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q ( $R )); if ( preg_match ( '~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*"|`[^`]*`)++)~i' , $qh , $C )){ $J [ " " ] = array ( " type " => " PRIMARY " , " columns " => array (), " lengths " => array (), " descs " => array ()); preg_match_all ( '~((("[^"]*+")+|(?:`[^`]*+`)+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i' , $C [ 1 ], $ze , PREG_SET_ORDER ); foreach ( $ze
as $C ){ $J [ " " ][ " columns " ][] = idf_unescape ( $C [ 2 ]) . $C [ 4 ]; $J [ " " ][ " descs " ][] = ( preg_match ( '~DESC~i' , $C [ 5 ]) ? '1' : null );}} if ( ! $J ){ foreach ( fields ( $R ) as $D => $p ){ if ( $p [ " primary " ]) $J [ " " ] = array ( " type " => " PRIMARY " , " columns " => array ( $D ), " lengths " => array (), " descs " => array ( null ));}} $th = get_key_vals ( " SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = " . q ( $R ), $h ); foreach ( get_rows ( " PRAGMA index_list( " . table ( $R ) . " ) " , $h ) as $K ){ $D = $K [ " name " ]; $w = array ( " type " => ( $K [ " unique " ] ? " UNIQUE " : " INDEX " )); $w [ " lengths " ] = array (); $w [ " descs " ] = array (); foreach ( get_rows ( " PRAGMA index_info( " . idf_escape ( $D ) . " ) " , $h ) as $Qg ){ $w [ " columns " ][] = $Qg [ " name " ]; $w [ " descs " ][] = null ;} if ( preg_match ( '~^CREATE( UNIQUE)? INDEX ' . preg_quote ( idf_escape ( $D ) . ' ON ' . idf_escape ( $R ), '~' ) . ' \((.*)\)$~i' , $th [ $D ], $Ag )){ preg_match_all ( '/("[^"]*+")+( DESC)?/' , $Ag [ 2 ], $ze ); foreach ( $ze [ 2 ] as $z => $X ){ if ( $X ) $w [ " descs " ][ $z ] = '1' ;}} if ( ! $J [ " " ] || $w [ " type " ] != " UNIQUE " || $w [ " columns " ] != $J [ " " ][ " columns " ] || $w [ " descs " ] != $J [ " " ][ " descs " ] ||! preg_match ( " ~^sqlite_~ " , $D )) $J [ $D ] = $w ;} return $J ;} function
foreign_keys ( $R ){ $J = array (); foreach ( get_rows ( " PRAGMA foreign_key_list( " . table ( $R ) . " ) " ) as $K ){ $r =& $J [ $K [ " id " ]]; if ( ! $r ) $r = $K ; $r [ " source " ][] = $K [ " from " ]; $r [ " target " ][] = $K [ " to " ];} return $J ;} function
view ( $D ){ global $g ; return
array ( " select " => preg_replace ( '~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\\s+~iU' , '' , $g -> result ( " SELECT sql FROM sqlite_master WHERE name = " . q ( $D ))));} function
collations (){ return ( isset ( $_GET [ " create " ]) ? get_vals ( " PRAGMA collation_list " , 1 ) : array ());} function
information_schema ( $m ){ return
false ;} function
error (){ global $g ; return
h ( $g -> error );} function
check_sqlite_name ( $D ){ global $g ; $Kc = " db|sdb|sqlite " ; if ( ! preg_match ( " ~^[^ \\ 0]* \\ .( $Kc ) \$ ~ " , $D )){ $g -> error = lang ( 21 , str_replace ( " | " , " , " , $Kc )); return
false ;} return
true ;} function
create_database ( $m , $pb ){ global $g ; if ( file_exists ( $m )){ $g -> error = lang ( 22 ); return
false ;} if ( ! check_sqlite_name ( $m )) return
false ; try { $A = new
Min_SQLite ( $m );} catch ( Exception $Ac ){ $g -> error = $Ac -> getMessage (); return
false ;} $A -> query ( 'PRAGMA encoding = "UTF-8"' ); $A -> query ( 'CREATE TABLE adminer (i)' ); $A -> query ( 'DROP TABLE adminer' ); return
true ;} function
drop_databases ( $l ){ global $g ; $g -> __construct ( " :memory: " ); foreach ( $l
as $m ){ if ( !@ unlink ( $m )){ $g -> error = lang ( 22 ); return
false ;}} return
true ;} function
rename_database ( $D , $pb ){ global $g ; if ( ! check_sqlite_name ( $D )) return
false ; $g -> __construct ( " :memory: " ); $g -> error = lang ( 22 ); return @ rename ( DB , $D );} function
auto_increment (){ return " PRIMARY KEY " . ( DRIVER == " sqlite " ? " AUTOINCREMENT " : " " );} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ $Hi = ( $R == " " || $bd ); foreach ( $q
as $p ){ if ( $p [ 0 ] != " " ||! $p [ 1 ] || $p [ 2 ]){ $Hi = true ; break ;}} $c = array (); $Bf = array (); foreach ( $q
as $p ){ if ( $p [ 1 ]){ $c [] = ( $Hi ? $p [ 1 ] : " ADD " . implode ( $p [ 1 ])); if ( $p [ 0 ] != " " ) $Bf [ $p [ 0 ]] = $p [ 1 ][ 0 ];}} if ( ! $Hi ){ foreach ( $c
as $X ){ if ( ! queries ( " ALTER TABLE " . table ( $R ) . " $X " )) return
false ;} if ( $R != $D &&! queries ( " ALTER TABLE " . table ( $R ) . " RENAME TO " . table ( $D ))) return
false ;} elseif ( ! recreate_table ( $R , $D , $c , $Bf , $bd )) return
false ; if ( $Ma ) queries ( " UPDATE sqlite_sequence SET seq = $Ma WHERE name = " . q ( $D )); return
true ;} function
recreate_table ( $R , $D , $q , $Bf , $bd , $x = array ()){ if ( $R != " " ){ if ( ! $q ){ foreach ( fields ( $R ) as $z => $p ){ if ( $x ) $p [ " auto_increment " ] = 0 ; $q [] = process_field ( $p , $p ); $Bf [ $z ] = idf_escape ( $z );}} $eg = false ; foreach ( $q
as $p ){ if ( $p [ 6 ]) $eg = true ;} $hc = array (); foreach ( $x
as $z => $X ){ if ( $X [ 2 ] == " DROP " ){ $hc [ $X [ 1 ]] = true ; unset ( $x [ $z ]);}} foreach ( indexes ( $R ) as $be => $w ){ $e = array (); foreach ( $w [ " columns " ] as $z => $d ){ if ( ! $Bf [ $d ]) continue
2 ; $e [] = $Bf [ $d ] . ( $w [ " descs " ][ $z ] ? " DESC " : " " );} if ( ! $hc [ $be ]){ if ( $w [ " type " ] != " PRIMARY " ||! $eg ) $x [] = array ( $w [ " type " ], $be , $e );}} foreach ( $x
as $z => $X ){ if ( $X [ 0 ] == " PRIMARY " ){ unset ( $x [ $z ]); $bd [] = " PRIMARY KEY ( " . implode ( " , " , $X [ 2 ]) . " ) " ;}} foreach ( foreign_keys ( $R ) as $be => $r ){ foreach ( $r [ " source " ] as $z => $d ){ if ( ! $Bf [ $d ]) continue
2 ; $r [ " source " ][ $z ] = idf_unescape ( $Bf [ $d ]);} if ( ! isset ( $bd [ " $be " ])) $bd [] = " " . format_foreign_key ( $r );} queries ( " BEGIN " );} foreach ( $q
as $z => $p ) $q [ $z ] = " " . implode ( $p ); $q = array_merge ( $q , array_filter ( $bd )); if ( ! queries ( " CREATE TABLE " . table ( $R != " " ? " adminer_ $D " : $D ) . " ( \n " . implode ( " , \n " , $q ) . " \n ) " )) return
false ; if ( $R != " " ){ if ( $Bf &&! queries ( " INSERT INTO " . table ( " adminer_ $D " ) . " ( " . implode ( " , " , $Bf ) . " ) SELECT " . implode ( " , " , array_map ( 'idf_escape' , array_keys ( $Bf ))) . " FROM " . table ( $R ))) return
false ; $si = array (); foreach ( triggers ( $R ) as $qi => $Yh ){ $pi = trigger ( $qi ); $si [] = " CREATE TRIGGER " . idf_escape ( $qi ) . " " . implode ( " " , $Yh ) . " ON " . table ( $D ) . " \n $pi[Statement] " ;} if ( ! queries ( " DROP TABLE " . table ( $R ))) return
false ; queries ( " ALTER TABLE " . table ( " adminer_ $D " ) . " RENAME TO " . table ( $D )); if ( ! alter_indexes ( $D , $x )) return
false ; foreach ( $si
as $pi ){ if ( ! queries ( $pi )) return
false ;} queries ( " COMMIT " );} return
true ;} function
index_sql ( $R , $U , $D , $e ){ return " CREATE $U " . ( $U != " INDEX " ? " INDEX " : " " ) . idf_escape ( $D != " " ? $D : uniqid ( $R . " _ " )) . " ON " . table ( $R ) . " $e " ;} function
alter_indexes ( $R , $c ){ foreach ( $c
as $dg ){ if ( $dg [ 0 ] == " PRIMARY " ) return
recreate_table ( $R , $R , array (), array (), array (), $c );} foreach ( array_reverse ( $c ) as $X ){ if ( ! queries ( $X [ 2 ] == " DROP " ? " DROP INDEX " . idf_escape ( $X [ 1 ]) : index_sql ( $R , $X [ 0 ], $X [ 1 ], " ( " . implode ( " , " , $X [ 2 ]) . " ) " ))) return
false ;} return
true ;} function
truncate_tables ( $T ){ return
apply_queries ( " DELETE FROM " , $T );} function
drop_views ( $Si ){ return
apply_queries ( " DROP VIEW " , $Si );} function
drop_tables ( $T ){ return
apply_queries ( " DROP TABLE " , $T );} function
move_tables ( $T , $Si , $Ph ){ return
false ;} function
trigger ( $D ){ global $g ; if ( $D == " " ) return
array ( " Statement " => " BEGIN \n \t ; \n END " ); $v = '(?:[^`"\\s]+|`[^`]*`|"[^"]*")+' ; $ri = trigger_options (); preg_match ( " ~^CREATE \\ s+TRIGGER \\ s* $v\\s *( " . implode ( " | " , $ri [ " Timing " ]) . " ) \\ s+([a-z]+)(?: \\ s+OF \\ s+( $v ))? \\ s+ON \\ s* $v\\s *(?:FOR \\ s+EACH \\ s+ROW \\ s)?(.*)~is " , $g -> result ( " SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = " . q ( $D )), $C ); $cf = $C [ 3 ]; return
array ( " Timing " => strtoupper ( $C [ 1 ]), " Event " => strtoupper ( $C [ 2 ]) . ( $cf ? " OF " : " " ), " Of " => ( $cf [ 0 ] == '`' || $cf [ 0 ] == '"' ? idf_unescape ( $cf ) : $cf ), " Trigger " => $D , " Statement " => $C [ 4 ],);} function
triggers ( $R ){ $J = array (); $ri = trigger_options (); foreach ( get_rows ( " SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q ( $R )) as $K ){ preg_match ( '~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(' . implode ( " | " , $ri [ " Timing " ]) . ')\\s*(.*)\\s+ON\\b~iU' , $K [ " sql " ], $C ); $J [ $K [ " name " ]] = array ( $C [ 1 ], $C [ 2 ]);} return $J ;} function
trigger_options (){ return
array ( " Timing " => array ( " BEFORE " , " AFTER " , " INSTEAD OF " ), " Event " => array ( " INSERT " , " UPDATE " , " UPDATE OF " , " DELETE " ), " Type " => array ( " FOR EACH ROW " ),);} function
begin (){ return
queries ( " BEGIN " );} function
last_id (){ global $g ; return $g -> result ( " SELECT LAST_INSERT_ROWID() " );} function
explain ( $g , $H ){ return $g -> query ( " EXPLAIN QUERY PLAN $H " );} function
found_rows ( $S , $Z ){} function
types (){ return
array ();} function
schemas (){ return
array ();} function
get_schema (){ return " " ;} function
set_schema ( $Ug ){ return
true ;} function
create_sql ( $R , $Ma , $Ah ){ global $g ; $J = $g -> result ( " SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = " . q ( $R )); foreach ( indexes ( $R ) as $D => $w ){ if ( $D == '' ) continue ; $J .= " ; \n \n " . index_sql ( $R , $w [ 'type' ], $D , " ( " . implode ( " , " , array_map ( 'idf_escape' , $w [ 'columns' ])) . " ) " );} return $J ;} function
truncate_sql ( $R ){ return " DELETE FROM " . table ( $R );} function
use_sql ( $k ){} function
trigger_sql ( $R ){ return
implode ( get_vals ( " SELECT sql || ';; \n ' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q ( $R )));} function
show_variables (){ global $g ; $J = array (); foreach ( array ( " auto_vacuum " , " cache_size " , " count_changes " , " default_cache_size " , " empty_result_callbacks " , " encoding " , " foreign_keys " , " full_column_names " , " fullfsync " , " journal_mode " , " journal_size_limit " , " legacy_file_format " , " locking_mode " , " page_size " , " max_page_count " , " read_uncommitted " , " recursive_triggers " , " reverse_unordered_selects " , " secure_delete " , " short_column_names " , " synchronous " , " temp_store " , " temp_store_directory " , " schema_version " , " integrity_check " , " quick_check " ) as $z ) $J [ $z ] = $g -> result ( " PRAGMA $z " ); return $J ;} function
show_status (){ $J = array (); foreach ( get_vals ( " PRAGMA compile_options " ) as $qf ){ list ( $z , $X ) = explode ( " = " , $qf , 2 ); $J [ $z ] = $X ;} return $J ;} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
support ( $Pc ){ return
preg_match ( '~^(columns|database|drop_col|dump|indexes|move_col|sql|status|table|trigger|variables|view|view_trigger)$~' , $Pc );} $y = " sqlite " ; $vi = array ( " integer " => 0 , " real " => 0 , " numeric " => 0 , " text " => 0 , " blob " => 0 ); $_h = array_keys ( $vi ); $Bi = array (); $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " LIKE " , " LIKE %% " , " IN " , " IS NULL " , " NOT LIKE " , " NOT IN " , " IS NOT NULL " , " SQL " ); $jd = array ( " hex " , " length " , " lower " , " round " , " unixepoch " , " upper " ); $pd = array ( " avg " , " count " , " count distinct " , " group_concat " , " max " , " min " , " sum " ); $mc = array ( array (), array ( " integer|real|numeric " => " +/- " , " text " => " || " ,));} $ec [ " pgsql " ] = " PostgreSQL " ; if ( isset ( $_GET [ " pgsql " ])){ $ag = array ( " PgSQL " , " PDO_PgSQL " ); define ( " DRIVER " , " pgsql " ); if ( extension_loaded ( " pgsql " )){ class
Min_DB { var $extension = " PgSQL " , $_link , $_result , $_string , $_database = true , $server_info , $affected_rows , $error ; function
_error ( $xc , $o ){ if ( ini_bool ( " html_errors " )) $o = html_entity_decode ( strip_tags ( $o )); $o = preg_replace ( '~^[^:]*: ~' , '' , $o ); $this -> error = $o ;} function
connect ( $O , $V , $G ){ global $b ; $m = $b -> database (); set_error_handler ( array ( $this , '_error' )); $this -> _string = " host=' " . str_replace ( " : " , " ' port=' " , addcslashes ( $O , " ' \\ " )) . " ' user=' " . addcslashes ( $V , " ' \\ " ) . " ' password=' " . addcslashes ( $G , " ' \\ " ) . " ' " ; $this -> _link =@ pg_connect ( " $this->_string dbname=' " . ( $m != " " ? addcslashes ( $m , " ' \\ " ) : " postgres " ) . " ' " , PGSQL_CONNECT_FORCE_NEW ); if ( ! $this -> _link && $m != " " ){ $this -> _database = false ; $this -> _link =@ pg_connect ( " $this->_string dbname='postgres' " , PGSQL_CONNECT_FORCE_NEW );} restore_error_handler (); if ( $this -> _link ){ $Qi = pg_version ( $this -> _link ); $this -> server_info = $Qi [ " server " ]; pg_set_client_encoding ( $this -> _link , " UTF8 " );} return ( bool ) $this -> _link ;} function
quote ( $Q ){ return " ' " . pg_escape_string ( $this -> _link , $Q ) . " ' " ;} function
value ( $X , $p ){ return ( $p [ " type " ] == " bytea " ? pg_unescape_bytea ( $X ) : $X );} function
quoteBinary ( $Q ){ return " ' " . pg_escape_bytea ( $this -> _link , $Q ) . " ' " ;} function
select_db ( $k ){ global $b ; if ( $k == $b -> database ()) return $this -> _database ; $J =@ pg_connect ( " $this->_string dbname=' " . addcslashes ( $k , " ' \\ " ) . " ' " , PGSQL_CONNECT_FORCE_NEW ); if ( $J ) $this -> _link = $J ; return $J ;} function
close (){ $this -> _link =@ pg_connect ( " $this->_string dbname='postgres' " );} function
query ( $H , $wi = false ){ $I =@ pg_query ( $this -> _link , $H ); $this -> error = " " ; if ( ! $I ){ $this -> error = pg_last_error ( $this -> _link ); return
false ;} elseif ( ! pg_num_fields ( $I )){ $this -> affected_rows = pg_affected_rows ( $I ); return
true ;} return
new
Min_Result ( $I );} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result (){ return $this -> _result ;} function
next_result (){ return
false ;} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! $I ||! $I -> num_rows ) return
false ; return
pg_fetch_result ( $I -> _result , 0 , $p );} function
warnings (){ return
h ( pg_last_notice ( $this -> _link ));}} class
Min_Result { var $_result , $_offset = 0 , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ; $this -> num_rows = pg_num_rows ( $I );} function
fetch_assoc (){ return
pg_fetch_assoc ( $this -> _result );} function
fetch_row (){ return
pg_fetch_row ( $this -> _result );} function
fetch_field (){ $d = $this -> _offset ++ ; $J = new
stdClass ; if ( function_exists ( 'pg_field_table' )) $J -> orgtable = pg_field_table ( $this -> _result , $d ); $J -> name = pg_field_name ( $this -> _result , $d ); $J -> orgname = $J -> name ; $J -> type = pg_field_type ( $this -> _result , $d ); $J -> charsetnr = ( $J -> type == " bytea " ? 63 : 0 ); return $J ;} function
__destruct (){ pg_free_result ( $this -> _result );}}} elseif ( extension_loaded ( " pdo_pgsql " )){ class
Min_DB
extends
Min_PDO { var $extension = " PDO_PgSQL " ; function
connect ( $O , $V , $G ){ global $b ; $m = $b -> database (); $Q = " pgsql:host=' " . str_replace ( " : " , " ' port=' " , addcslashes ( $O , " ' \\ " )) . " ' options='-c client_encoding=utf8' " ; $this -> dsn ( " $Q dbname=' " . ( $m != " " ? addcslashes ( $m , " ' \\ " ) : " postgres " ) . " ' " , $V , $G ); return
true ;} function
select_db ( $k ){ global $b ; return ( $b -> database () == $k );} function
value ( $X , $p ){ return $X ;} function
quoteBinary ( $Rg ){ return
q ( $Rg );} function
warnings (){ return '' ;} function
close (){}}} class
Min_Driver
extends
Min_SQL { function
insertUpdate ( $R , $L , $dg ){ global $g ; foreach ( $L
as $P ){ $Ci = array (); $Z = array (); foreach ( $P
as $z => $X ){ $Ci [] = " $z = $X " ; if ( isset ( $dg [ idf_unescape ( $z )])) $Z [] = " $z = $X " ;} if ( ! (( $Z && queries ( " UPDATE " . table ( $R ) . " SET " . implode ( " , " , $Ci ) . " WHERE " . implode ( " AND " , $Z )) && $g -> affected_rows ) || queries ( " INSERT INTO " . table ( $R ) . " ( " . implode ( " , " , array_keys ( $P )) . " ) VALUES ( " . implode ( " , " , $P ) . " ) " ))) return
false ;} return
true ;} function
convertSearch ( $v , $X , $p ){ return ( preg_match ( '~char|text' . ( is_numeric ( $X [ " val " ]) &&! preg_match ( '~LIKE~' , $X [ " op " ]) ? '|' . number_type () : '' ) . '~' , $p [ " type " ]) ? $v : " CAST( $v AS text) " );} function
value ( $X , $p ){ return $this -> _conn -> value ( $X , $p );} function
quoteBinary ( $Rg ){ return $this -> _conn -> quoteBinary ( $Rg );} function
warnings (){ return $this -> _conn -> warnings ();} function
tableHelp ( $D ){ $se = array ( " information_schema " => " infoschema " , " pg_catalog " => " catalog " ,); $A = $se [ $_GET [ " ns " ]]; if ( $A ) return " $A - " . str_replace ( " _ " , " - " , $D ) . " .html " ;}} function
idf_escape ( $v ){ return '"' . str_replace ( '"' , '""' , $v ) . '"' ;} function
table ( $v ){ return
idf_escape ( $v );} function
connect (){ global $b , $vi , $_h ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])){ if ( min_version ( 9 , 0 , $g )){ $g -> query ( " SET application_name = 'Adminer' " ); if ( min_version ( 9.2 , 0 , $g )){ $_h [ lang ( 23 )][] = " json " ; $vi [ " json " ] = 4294967295 ; if ( min_version ( 9.4 , 0 , $g )){ $_h [ lang ( 23 )][] = " jsonb " ; $vi [ " jsonb " ] = 4294967295 ;}}} return $g ;} return $g -> error ;} function
get_databases (){ return
get_vals ( " SELECT datname FROM pg_database WHERE has_database_privilege(datname, 'CONNECT') ORDER BY datname " );} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return " $H $Z " . ( $_ !== null ? $N . " LIMIT $_ " . ( $E ? " OFFSET $E " : " " ) : " " );} function
limit1 ( $R , $H , $Z , $N = " \n " ){ return ( preg_match ( '~^INTO~' , $H ) ? limit ( $H , $Z , 1 , 0 , $N ) : " $H WHERE ctid = (SELECT ctid FROM " . table ( $R ) . $Z . $N . " LIMIT 1) " );} function
db_collation ( $m , $qb ){ global $g ; return $g -> result ( " SHOW LC_COLLATE " );} function
engines (){ return
array ();} function
logged_user (){ global $g ; return $g -> result ( " SELECT user " );} function
tables_list (){ $H = " SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema() " ; if ( support ( 'materializedview' )) $H .= "
UNION ALL
SELECT matviewname , 'MATERIALIZED VIEW'
FROM pg_matviews
WHERE schemaname = current_schema () " ; $H .= "
ORDER BY 1 " ;return
get_key_vals ( $H );} function
count_tables ( $l ){ return
array ();} function
table_status ( $D = " " ){ $J = array (); foreach ( get_rows ( " SELECT c.relname AS \" Name \" , CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \" Engine \" , pg_relation_size(c.oid) AS \" Data_length \" , pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \" Index_length \" , obj_description(c.oid, 'pg_class') AS \" Comment \" , CASE WHEN c.relhasoids THEN 'oid' ELSE '' END AS \" Oid \" , c.reltuples as \" Rows \" , n.nspname
FROM pg_class c
JOIN pg_namespace n ON ( n . nspname = current_schema () AND n . oid = c . relnamespace )
WHERE relkind IN ( 'r' , 'm' , 'v' , 'f' )
" .( $D != " " ? " AND relname = " .q( $D ): " ORDER BY relname " ))as $K ) $J[$K["Name"] ]= $K ;return( $D != " " ? $J[$D] : $J );}function
is_view ( $S ){ return
in_array ( $S [ " Engine " ], array ( " view " , " materialized view " ));} function
fk_support ( $S ){ return
true ;} function
fields ( $R ){ $J = array (); $Da = array ( 'timestamp without time zone' => 'timestamp' , 'timestamp with time zone' => 'timestamptz' ,); foreach ( get_rows ( " SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment
FROM pg_class c
JOIN pg_namespace n ON c . relnamespace = n . oid
JOIN pg_attribute a ON c . oid = a . attrelid
LEFT JOIN pg_attrdef d ON c . oid = d . adrelid AND a . attnum = d . adnum
WHERE c . relname = " .q( $R ). "
AND n . nspname = current_schema ()
AND NOT a . attisdropped
AND a . attnum > 0
ORDER BY a . attnum " )as $K ) { preg_match('~([^([]+)( \ ((.*) \ ))?([a-z ]+)?(( \ [[0-9]*])*) $ ~', $K["full_type"] , $C );list(, $U , $pe , $K["length"] , $xa , $Ga )= $C ; $K["length"] .= $Ga ; $eb = $U . $xa ;if(isset( $Da[$eb] )) { $K [ " type " ] = $Da [ $eb ]; $K [ " full_type " ] = $K [ " type " ] . $pe . $Ga ; } else { $K [ " type " ] = $U ; $K [ " full_type " ] = $K [ " type " ] . $pe . $xa . $Ga ; } $K["null"] =! $K["attnotnull"] ; $K["auto_increment"] =preg_match('~^nextval \\ (~i', $K["default"] ); $K["privileges"] =array( " insert " =>1, " select " =>1, " update " =>1);if(preg_match('~(.+)::[^)]+(.*)~', $K["default"] , $C )) $K["default"] =( $C[1] == " NULL " ?null:(( $C[1] [0]== " ' " ?idf_unescape( $C[1] ): $C[1] ). $C[2] )); $J[$K["field"] ]= $K ;}return $J ;}function
indexes ( $R , $h = null ){ global $g ; if ( ! is_object ( $h )) $h = $g ; $J = array (); $Ih = $h -> result ( " SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q ( $R )); $e = get_key_vals ( " SELECT attnum, attname FROM pg_attribute WHERE attrelid = $Ih AND attnum > 0 " , $h ); foreach ( get_rows ( " SELECT relname, indisunique::int, indisprimary::int, indkey, indoption , (indpred IS NOT NULL)::int as indispartial FROM pg_index i, pg_class ci WHERE i.indrelid = $Ih AND ci.oid = i.indexrelid " , $h ) as $K ){ $Bg = $K [ " relname " ]; $J [ $Bg ][ " type " ] = ( $K [ " indispartial " ] ? " INDEX " : ( $K [ " indisprimary " ] ? " PRIMARY " : ( $K [ " indisunique " ] ? " UNIQUE " : " INDEX " ))); $J [ $Bg ][ " columns " ] = array (); foreach ( explode ( " " , $K [ " indkey " ]) as $Id ) $J [ $Bg ][ " columns " ][] = $e [ $Id ]; $J [ $Bg ][ " descs " ] = array (); foreach ( explode ( " " , $K [ " indoption " ]) as $Jd ) $J [ $Bg ][ " descs " ][] = ( $Jd & 1 ? '1' : null ); $J [ $Bg ][ " lengths " ] = array ();} return $J ;} function
foreign_keys ( $R ){ global $jf ; $J = array (); foreach ( get_rows ( " SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
FROM pg_constraint
WHERE conrelid = ( SELECT pc . oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON ( pn . oid = pc . relnamespace ) WHERE pc . relname = " .q( $R ). " AND pn . nspname = current_schema ())
AND contype = 'f' :: char
ORDER BY conkey , conname " )as $K ) { if(preg_match('~FOREIGN KEY \ s* \ ((.+) \ ) \ s*REFERENCES (.+) \ ((.+) \ )(.*) $ ~iA', $K['definition'] , $C )) { $K [ 'source' ] = array_map ( 'trim' , explode ( ',' , $C [ 1 ])); if ( preg_match ( '~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~' , $C [ 2 ], $ye )){ $K [ 'ns' ] = str_replace ( '""' , '"' , preg_replace ( '~^"(.+)"$~' , '\1' , $ye [ 2 ])); $K [ 'table' ] = str_replace ( '""' , '"' , preg_replace ( '~^"(.+)"$~' , '\1' , $ye [ 4 ])); } $K['target'] =array_map('trim',explode(',', $C[3] )); $K['on_delete'] =(preg_match( " ~ ON DELETE ( $jf ) ~ " , $C[4] , $ye )? $ye[1] :'NO ACTION'); $K['on_update'] =(preg_match( " ~ ON UPDATE ( $jf ) ~ " , $C[4] , $ye )? $ye[1] :'NO ACTION'); $J[$K['conname'] ]= $K ;}}return $J ;}function
view ( $D ){ global $g ; return
array ( " select " => trim ( $g -> result ( " SELECT view_definition
FROM information_schema . views
WHERE table_schema = current_schema () AND table_name = " .q( $D ))));}function
collations (){ return
array ();} function
information_schema ( $m ){ return ( $m == " information_schema " );} function
error (){ global $g ; $J = h ( $g -> error ); if ( preg_match ( '~^(.*\\n)?([^\\n]*)\\n( *)\\^(\\n.*)?$~s' , $J , $C )) $J = $C [ 1 ] . preg_replace ( '~((?:[^&]|&[^;]*;){' . strlen ( $C [ 3 ]) . '})(.*)~' , '\\1<b>\\2</b>' , $C [ 2 ]) . $C [ 4 ]; return
nl_br ( $J );} function
create_database ( $m , $pb ){ return
queries ( " CREATE DATABASE " . idf_escape ( $m ) . ( $pb ? " ENCODING " . idf_escape ( $pb ) : " " ));} function
drop_databases ( $l ){ global $g ; $g -> close (); return
apply_queries ( " DROP DATABASE " , $l , 'idf_escape' );} function
rename_database ( $D , $pb ){ return
queries ( " ALTER DATABASE " . idf_escape ( DB ) . " RENAME TO " . idf_escape ( $D ));} function
auto_increment (){ return " " ;} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ $c = array (); $og = array (); foreach ( $q
as $p ){ $d = idf_escape ( $p [ 0 ]); $X = $p [ 1 ]; if ( ! $X ) $c [] = " DROP $d " ; else { $Mi = $X [ 5 ]; unset ( $X [ 5 ]); if ( isset ( $X [ 6 ]) && $p [ 0 ] == " " ) $X [ 1 ] = ( $X [ 1 ] == " bigint " ? " big " : " " ) . " serial " ; if ( $p [ 0 ] == " " ) $c [] = ( $R != " " ? " ADD " : " " ) . implode ( $X ); else { if ( $d != $X [ 0 ]) $og [] = " ALTER TABLE " . table ( $R ) . " RENAME $d TO $X[0] " ; $c [] = " ALTER $d TYPE $X[1] " ; if ( ! $X [ 6 ]){ $c [] = " ALTER $d " . ( $X [ 3 ] ? " SET $X[3] " : " DROP DEFAULT " ); $c [] = " ALTER $d " . ( $X [ 2 ] == " NULL " ? " DROP NOT " : " SET " ) . $X [ 2 ];}} if ( $p [ 0 ] != " " || $Mi != " " ) $og [] = " COMMENT ON COLUMN " . table ( $R ) . " . $X[0] IS " . ( $Mi != " " ? substr ( $Mi , 9 ) : " '' " );}} $c = array_merge ( $c , $bd ); if ( $R == " " ) array_unshift ( $og , " CREATE TABLE " . table ( $D ) . " ( \n " . implode ( " , \n " , $c ) . " \n ) " ); elseif ( $c ) array_unshift ( $og , " ALTER TABLE " . table ( $R ) . " \n " . implode ( " , \n " , $c )); if ( $R != " " && $R != $D ) $og [] = " ALTER TABLE " . table ( $R ) . " RENAME TO " . table ( $D ); if ( $R != " " || $vb != " " ) $og [] = " COMMENT ON TABLE " . table ( $D ) . " IS " . q ( $vb ); if ( $Ma != " " ){} foreach ( $og
as $H ){ if ( ! queries ( $H )) return
false ;} return
true ;} function
alter_indexes ( $R , $c ){ $i = array (); $fc = array (); $og = array (); foreach ( $c
as $X ){ if ( $X [ 0 ] != " INDEX " ) $i [] = ( $X [ 2 ] == " DROP " ? " \n DROP CONSTRAINT " . idf_escape ( $X [ 1 ]) : " \n ADD " . ( $X [ 1 ] != " " ? " CONSTRAINT " . idf_escape ( $X [ 1 ]) : " " ) . " $X[0] " . ( $X [ 0 ] == " PRIMARY " ? " KEY " : " " ) . " ( " . implode ( " , " , $X [ 2 ]) . " ) " ); elseif ( $X [ 2 ] == " DROP " ) $fc [] = idf_escape ( $X [ 1 ]); else $og [] = " CREATE INDEX " . idf_escape ( $X [ 1 ] != " " ? $X [ 1 ] : uniqid ( $R . " _ " )) . " ON " . table ( $R ) . " ( " . implode ( " , " , $X [ 2 ]) . " ) " ;} if ( $i ) array_unshift ( $og , " ALTER TABLE " . table ( $R ) . implode ( " , " , $i )); if ( $fc ) array_unshift ( $og , " DROP INDEX " . implode ( " , " , $fc )); foreach ( $og
as $H ){ if ( ! queries ( $H )) return
false ;} return
true ;} function
truncate_tables ( $T ){ return
queries ( " TRUNCATE " . implode ( " , " , array_map ( 'table' , $T ))); return
true ;} function
drop_views ( $Si ){ return
drop_tables ( $Si );} function
drop_tables ( $T ){ foreach ( $T
as $R ){ $xh = table_status ( $R ); if ( ! queries ( " DROP " . strtoupper ( $xh [ " Engine " ]) . " " . table ( $R ))) return
false ;} return
true ;} function
move_tables ( $T , $Si , $Ph ){ foreach ( array_merge ( $T , $Si ) as $R ){ $xh = table_status ( $R ); if ( ! queries ( " ALTER " . strtoupper ( $xh [ " Engine " ]) . " " . table ( $R ) . " SET SCHEMA " . idf_escape ( $Ph ))) return
false ;} return
true ;} function
trigger ( $D , $R = null ){ if ( $D == " " ) return
array ( " Statement " => " EXECUTE PROCEDURE () " ); if ( $R === null ) $R = $_GET [ 'trigger' ]; $L = get_rows ( 'SELECT t.trigger_name AS "Trigger", t.action_timing AS "Timing", (SELECT STRING_AGG(event_manipulation, \' OR \') FROM information_schema.triggers WHERE event_object_table = t.event_object_table AND trigger_name = t.trigger_name ) AS "Events", t.event_manipulation AS "Event", \'FOR EACH \' || t.action_orientation AS "Type", t.action_statement AS "Statement" FROM information_schema.triggers t WHERE t.event_object_table = ' . q ( $R ) . ' AND t.trigger_name = ' . q ( $D )); return
reset ( $L );} function
triggers ( $R ){ $J = array (); foreach ( get_rows ( " SELECT * FROM information_schema.triggers WHERE event_object_table = " . q ( $R )) as $K ) $J [ $K [ " trigger_name " ]] = array ( $K [ " action_timing " ], $K [ " event_manipulation " ]); return $J ;} function
trigger_options (){ return
array ( " Timing " => array ( " BEFORE " , " AFTER " ), " Event " => array ( " INSERT " , " UPDATE " , " DELETE " ), " Type " => array ( " FOR EACH ROW " , " FOR EACH STATEMENT " ),);} function
routine ( $D , $U ){ $L = get_rows ( ' SELECT routine_definition AS definition , LOWER ( external_language ) AS language , *
FROM information_schema . routines
WHERE routine_schema = current_schema () AND specific_name = '.q($D));$J=$L[0];$J["returns"]=array("type"=>$J["type_udt_name"]);$J["fields"]=get_rows(' SELECT parameter_name AS field , data_type AS type , character_maximum_length AS length , parameter_mode AS inout
FROM information_schema . parameters
WHERE specific_schema = current_schema () AND specific_name = '.q($D).'
ORDER BY ordinal_position ' ); return $J ;} function
routines (){ return
get_rows ( ' SELECT specific_name AS " SPECIFIC_NAME " , routine_type AS " ROUTINE_TYPE " , routine_name AS " ROUTINE_NAME " , type_udt_name AS " DTD_IDENTIFIER "
FROM information_schema . routines
WHERE routine_schema = current_schema ()
ORDER BY SPECIFIC_NAME ' );} function
routine_languages (){ return
get_vals ( " SELECT LOWER(lanname) FROM pg_catalog.pg_language " );} function
routine_id ( $D , $K ){ $J = array (); foreach ( $K [ " fields " ] as $p ) $J [] = $p [ " type " ]; return
idf_escape ( $D ) . " ( " . implode ( " , " , $J ) . " ) " ;} function
last_id (){ return
0 ;} function
explain ( $g , $H ){ return $g -> query ( " EXPLAIN $H " );} function
found_rows ( $S , $Z ){ global $g ; if ( preg_match ( " ~ rows=([0-9]+)~ " , $g -> result ( " EXPLAIN SELECT * FROM " . idf_escape ( $S [ " Name " ]) . ( $Z ? " WHERE " . implode ( " AND " , $Z ) : " " )), $Ag )) return $Ag [ 1 ]; return
false ;} function
types (){ return
get_vals ( " SELECT typname
FROM pg_type
WHERE typnamespace = ( SELECT oid FROM pg_namespace WHERE nspname = current_schema ())
AND typtype IN ( 'b' , 'd' , 'e' )
AND typelem = 0 " );}function
schemas (){ return
get_vals ( " SELECT nspname FROM pg_namespace ORDER BY nspname " );} function
get_schema (){ global $g ; return $g -> result ( " SELECT current_schema() " );} function
set_schema ( $Tg ){ global $g , $vi , $_h ; $J = $g -> query ( " SET search_path TO " . idf_escape ( $Tg )); foreach ( types () as $U ){ if ( ! isset ( $vi [ $U ])){ $vi [ $U ] = 0 ; $_h [ lang ( 24 )][] = $U ;}} return $J ;} function
create_sql ( $R , $Ma , $Ah ){ global $g ; $J = '' ; $Jg = array (); $dh = array (); $xh = table_status ( $R ); $q = fields ( $R ); $x = indexes ( $R ); ksort ( $x ); $Zc = foreign_keys ( $R ); ksort ( $Zc ); if ( ! $xh || empty ( $q )) return
false ; $J = " CREATE TABLE " . idf_escape ( $xh [ 'nspname' ]) . " . " . idf_escape ( $xh [ 'Name' ]) . " ( \n " ; foreach ( $q
as $Rc => $p ){ $Kf = idf_escape ( $p [ 'field' ]) . ' ' . $p [ 'full_type' ] . default_value ( $p ) . ( $p [ 'attnotnull' ] ? " NOT NULL " : " " ); $Jg [] = $Kf ; if ( preg_match ( '~nextval\(\'([^\']+)\'\)~' , $p [ 'default' ], $ze )){ $ch = $ze [ 1 ]; $ph = reset ( get_rows ( min_version ( 10 ) ? " SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = " . q ( $ch ) : " SELECT * FROM $ch " )); $dh [] = ( $Ah == " DROP+CREATE " ? " DROP SEQUENCE IF EXISTS $ch ; \n " : " " ) . " CREATE SEQUENCE $ch INCREMENT $ph[increment_by] MINVALUE $ph[min_value] MAXVALUE $ph[max_value] START " . ( $Ma ? $ph [ 'last_value' ] : 1 ) . " CACHE $ph[cache_value] ; " ;}} if ( ! empty ( $dh )) $J = implode ( " \n \n " , $dh ) . " \n \n $J " ; foreach ( $x
as $Dd => $w ){ switch ( $w [ 'type' ]){ case 'UNIQUE' : $Jg [] = " CONSTRAINT " . idf_escape ( $Dd ) . " UNIQUE ( " . implode ( ', ' , array_map ( 'idf_escape' , $w [ 'columns' ])) . " ) " ; break ; case 'PRIMARY' : $Jg [] = " CONSTRAINT " . idf_escape ( $Dd ) . " PRIMARY KEY ( " . implode ( ', ' , array_map ( 'idf_escape' , $w [ 'columns' ])) . " ) " ; break ;}} foreach ( $Zc
as $Yc => $Xc ) $Jg [] = " CONSTRAINT " . idf_escape ( $Yc ) . " $Xc[definition] " . ( $Xc [ 'deferrable' ] ? 'DEFERRABLE' : 'NOT DEFERRABLE' ); $J .= implode ( " , \n " , $Jg ) . " \n ) WITH (oids = " . ( $xh [ 'Oid' ] ? 'true' : 'false' ) . " ); " ; foreach ( $x
as $Dd => $w ){ if ( $w [ 'type' ] == 'INDEX' ) $J .= " \n \n CREATE INDEX " . idf_escape ( $Dd ) . " ON " . idf_escape ( $xh [ 'nspname' ]) . " . " . idf_escape ( $xh [ 'Name' ]) . " USING btree ( " . implode ( ', ' , array_map ( 'idf_escape' , $w [ 'columns' ])) . " ); " ;} if ( $xh [ 'Comment' ]) $J .= " \n \n COMMENT ON TABLE " . idf_escape ( $xh [ 'nspname' ]) . " . " . idf_escape ( $xh [ 'Name' ]) . " IS " . q ( $xh [ 'Comment' ]) . " ; " ; foreach ( $q
as $Rc => $p ){ if ( $p [ 'comment' ]) $J .= " \n \n COMMENT ON COLUMN " . idf_escape ( $xh [ 'nspname' ]) . " . " . idf_escape ( $xh [ 'Name' ]) . " . " . idf_escape ( $Rc ) . " IS " . q ( $p [ 'comment' ]) . " ; " ;} return
rtrim ( $J , ';' );} function
truncate_sql ( $R ){ return " TRUNCATE " . table ( $R );} function
trigger_sql ( $R ){ $xh = table_status ( $R ); $J = " " ; foreach ( triggers ( $R ) as $oi => $ni ){ $pi = trigger ( $oi , $xh [ 'Name' ]); $J .= " \n CREATE TRIGGER " . idf_escape ( $pi [ 'Trigger' ]) . " $pi[Timing] $pi[Events] ON " . idf_escape ( $xh [ " nspname " ]) . " . " . idf_escape ( $xh [ 'Name' ]) . " $pi[Type] $pi[Statement] ;; \n " ;} return $J ;} function
use_sql ( $k ){ return " \ connect " . idf_escape ( $k );} function
show_variables (){ return
get_key_vals ( " SHOW ALL " );} function
process_list (){ return
get_rows ( " SELECT * FROM pg_stat_activity ORDER BY " . ( min_version ( 9.2 ) ? " pid " : " procpid " ));} function
show_status (){} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
support ( $Pc ){ return
preg_match ( '~^(database|table|columns|sql|indexes|comment|view|' . ( min_version ( 9.3 ) ? 'materializedview|' : '' ) . 'scheme|routine|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~' , $Pc );} function
kill_process ( $X ){ return
queries ( " SELECT pg_terminate_backend( " . number ( $X ) . " ) " );} function
connection_id (){ return " SELECT pg_backend_pid() " ;} function
max_connections (){ global $g ; return $g -> result ( " SHOW max_connections " );} $y = " pgsql " ; $vi = array (); $_h = array (); foreach ( array ( lang ( 25 ) => array ( " smallint " => 5 , " integer " => 10 , " bigint " => 19 , " boolean " => 1 , " numeric " => 0 , " real " => 7 , " double precision " => 16 , " money " => 20 ), lang ( 26 ) => array ( " date " => 13 , " time " => 17 , " timestamp " => 20 , " timestamptz " => 21 , " interval " => 0 ), lang ( 23 ) => array ( " character " => 0 , " character varying " => 0 , " text " => 0 , " tsquery " => 0 , " tsvector " => 0 , " uuid " => 0 , " xml " => 0 ), lang ( 27 ) => array ( " bit " => 0 , " bit varying " => 0 , " bytea " => 0 ), lang ( 28 ) => array ( " cidr " => 43 , " inet " => 43 , " macaddr " => 17 , " txid_snapshot " => 0 ), lang ( 29 ) => array ( " box " => 0 , " circle " => 0 , " line " => 0 , " lseg " => 0 , " path " => 0 , " point " => 0 , " polygon " => 0 ),) as $z => $X ){ $vi += $X ; $_h [ $z ] = array_keys ( $X );} $Bi = array (); $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " ~ " , " !~ " , " LIKE " , " LIKE %% " , " ILIKE " , " ILIKE %% " , " IN " , " IS NULL " , " NOT LIKE " , " NOT IN " , " IS NOT NULL " ); $jd = array ( " char_length " , " lower " , " round " , " to_hex " , " to_timestamp " , " upper " ); $pd = array ( " avg " , " count " , " count distinct " , " max " , " min " , " sum " ); $mc = array ( array ( " char " => " md5 " , " date|time " => " now " ,), array ( number_type () => " +/- " , " date|time " => " + interval/- interval " , " char|text " => " || " ,));} $ec [ " oracle " ] = " Oracle (beta) " ; if ( isset ( $_GET [ " oracle " ])){ $ag = array ( " OCI8 " , " PDO_OCI " ); define ( " DRIVER " , " oracle " ); if ( extension_loaded ( " oci8 " )){ class
Min_DB { var $extension = " oci8 " , $_link , $_result , $server_info , $affected_rows , $errno , $error ; function
_error ( $xc , $o ){ if ( ini_bool ( " html_errors " )) $o = html_entity_decode ( strip_tags ( $o )); $o = preg_replace ( '~^[^:]*: ~' , '' , $o ); $this -> error = $o ;} function
connect ( $O , $V , $G ){ $this -> _link =@ oci_new_connect ( $V , $G , $O , " AL32UTF8 " ); if ( $this -> _link ){ $this -> server_info = oci_server_version ( $this -> _link ); return
true ;} $o = oci_error (); $this -> error = $o [ " message " ]; return
false ;} function
quote ( $Q ){ return " ' " . str_replace ( " ' " , " '' " , $Q ) . " ' " ;} function
select_db ( $k ){ return
true ;} function
query ( $H , $wi = false ){ $I = oci_parse ( $this -> _link , $H ); $this -> error = " " ; if ( ! $I ){ $o = oci_error ( $this -> _link ); $this -> errno = $o [ " code " ]; $this -> error = $o [ " message " ]; return
false ;} set_error_handler ( array ( $this , '_error' )); $J =@ oci_execute ( $I ); restore_error_handler (); if ( $J ){ if ( oci_num_fields ( $I )) return
new
Min_Result ( $I ); $this -> affected_rows = oci_num_rows ( $I );} return $J ;} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result (){ return $this -> _result ;} function
next_result (){ return
false ;} function
result ( $H , $p = 1 ){ $I = $this -> query ( $H ); if ( ! is_object ( $I ) ||! oci_fetch ( $I -> _result )) return
false ; return
oci_result ( $I -> _result , $p );}} class
Min_Result { var $_result , $_offset = 1 , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ;} function
_convert ( $K ){ foreach (( array ) $K
as $z => $X ){ if ( is_a ( $X , 'OCI-Lob' )) $K [ $z ] = $X -> load ();} return $K ;} function
fetch_assoc (){ return $this -> _convert ( oci_fetch_assoc ( $this -> _result ));} function
fetch_row (){ return $this -> _convert ( oci_fetch_row ( $this -> _result ));} function
fetch_field (){ $d = $this -> _offset ++ ; $J = new
stdClass ; $J -> name = oci_field_name ( $this -> _result , $d ); $J -> orgname = $J -> name ; $J -> type = oci_field_type ( $this -> _result , $d ); $J -> charsetnr = ( preg_match ( " ~raw|blob|bfile~ " , $J -> type ) ? 63 : 0 ); return $J ;} function
__destruct (){ oci_free_statement ( $this -> _result );}}} elseif ( extension_loaded ( " pdo_oci " )){ class
Min_DB
extends
Min_PDO { var $extension = " PDO_OCI " ; function
connect ( $O , $V , $G ){ $this -> dsn ( " oci:dbname=// $O ;charset=AL32UTF8 " , $V , $G ); return
true ;} function
select_db ( $k ){ return
true ;}}} class
Min_Driver
extends
Min_SQL { function
begin (){ return
true ;}} function
idf_escape ( $v ){ return '"' . str_replace ( '"' , '""' , $v ) . '"' ;} function
table ( $v ){ return
idf_escape ( $v );} function
connect (){ global $b ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])) return $g ; return $g -> error ;} function
get_databases (){ return
get_vals ( " SELECT tablespace_name FROM user_tablespaces " );} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return ( $E ? " * FROM (SELECT t.*, rownum AS rnum FROM (SELECT $H $Z ) t WHERE rownum <= " . ( $_ + $E ) . " ) WHERE rnum > $E " : ( $_ !== null ? " * FROM (SELECT $H $Z ) WHERE rownum <= " . ( $_ + $E ) : " $H $Z " ));} function
limit1 ( $R , $H , $Z , $N = " \n " ){ return " $H $Z " ;} function
db_collation ( $m , $qb ){ global $g ; return $g -> result ( " SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET' " );} function
engines (){ return
array ();} function
logged_user (){ global $g ; return $g -> result ( " SELECT USER FROM DUAL " );} function
tables_list (){ return
get_key_vals ( " SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q ( DB ) . "
UNION SELECT view_name , 'view' FROM user_views
ORDER BY 1 " );}function
count_tables ( $l ){ return
array ();} function
table_status ( $D = " " ){ $J = array (); $Vg = q ( $D ); foreach ( get_rows ( 'SELECT table_name "Name", \'table\' "Engine", avg_row_len * num_rows "Data_length", num_rows "Rows" FROM all_tables WHERE tablespace_name = ' . q ( DB ) . ( $D != " " ? " AND table_name = $Vg " : " " ) . "
UNION SELECT view_name , 'view' , 0 , 0 FROM user_views " .( $D != " " ? " WHERE view_name = $Vg " : " " ). "
ORDER BY 1 " )as $K ) { if( $D != " " )return $K ; $J[$K["Name"] ]= $K ;}return $J ;}function
is_view ( $S ){ return $S [ " Engine " ] == " view " ;} function
fk_support ( $S ){ return
true ;} function
fields ( $R ){ $J = array (); foreach ( get_rows ( " SELECT * FROM all_tab_columns WHERE table_name = " . q ( $R ) . " ORDER BY column_id " ) as $K ){ $U = $K [ " DATA_TYPE " ]; $pe = " $K[DATA_PRECISION] , $K[DATA_SCALE] " ; if ( $pe == " , " ) $pe = $K [ " DATA_LENGTH " ]; $J [ $K [ " COLUMN_NAME " ]] = array ( " field " => $K [ " COLUMN_NAME " ], " full_type " => $U . ( $pe ? " ( $pe ) " : " " ), " type " => strtolower ( $U ), " length " => $pe , " default " => $K [ " DATA_DEFAULT " ], " null " => ( $K [ " NULLABLE " ] == " Y " ), " privileges " => array ( " insert " => 1 , " select " => 1 , " update " => 1 ),);} return $J ;} function
indexes ( $R , $h = null ){ $J = array (); foreach ( get_rows ( " SELECT uic.*, uc.constraint_type
FROM user_ind_columns uic
LEFT JOIN user_constraints uc ON uic . index_name = uc . constraint_name AND uic . table_name = uc . table_name
WHERE uic . table_name = " .q( $R ). "
ORDER BY uc . constraint_type , uic . column_position " , $h )as $K ) { $Dd = $K [ " INDEX_NAME " ]; $J [ $Dd ][ " type " ] = ( $K [ " CONSTRAINT_TYPE " ] == " P " ? " PRIMARY " : ( $K [ " CONSTRAINT_TYPE " ] == " U " ? " UNIQUE " : " INDEX " )); $J [ $Dd ][ " columns " ][] = $K [ " COLUMN_NAME " ]; $J [ $Dd ][ " lengths " ][] = ( $K [ " CHAR_LENGTH " ] && $K [ " CHAR_LENGTH " ] != $K [ " COLUMN_LENGTH " ] ? $K [ " CHAR_LENGTH " ] : null ); $J [ $Dd ][ " descs " ][] = ( $K [ " DESCEND " ] ? '1' : null ); } return $J ;}function
view ( $D ){ $L = get_rows ( 'SELECT text "select" FROM user_views WHERE view_name = ' . q ( $D )); return
reset ( $L );} function
collations (){ return
array ();} function
information_schema ( $m ){ return
false ;} function
error (){ global $g ; return
h ( $g -> error );} function
explain ( $g , $H ){ $g -> query ( " EXPLAIN PLAN FOR $H " ); return $g -> query ( " SELECT * FROM plan_table " );} function
found_rows ( $S , $Z ){} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ $c = $fc = array (); foreach ( $q
as $p ){ $X = $p [ 1 ]; if ( $X && $p [ 0 ] != " " && idf_escape ( $p [ 0 ]) != $X [ 0 ]) queries ( " ALTER TABLE " . table ( $R ) . " RENAME COLUMN " . idf_escape ( $p [ 0 ]) . " TO $X[0] " ); if ( $X ) $c [] = ( $R != " " ? ( $p [ 0 ] != " " ? " MODIFY ( " : " ADD ( " ) : " " ) . implode ( $X ) . ( $R != " " ? " ) " : " " ); else $fc [] = idf_escape ( $p [ 0 ]);} if ( $R == " " ) return
queries ( " CREATE TABLE " . table ( $D ) . " ( \n " . implode ( " , \n " , $c ) . " \n ) " ); return ( ! $c || queries ( " ALTER TABLE " . table ( $R ) . " \n " . implode ( " \n " , $c ))) && ( ! $fc || queries ( " ALTER TABLE " . table ( $R ) . " DROP ( " . implode ( " , " , $fc ) . " ) " )) && ( $R == $D || queries ( " ALTER TABLE " . table ( $R ) . " RENAME TO " . table ( $D )));} function
foreign_keys ( $R ){ $J = array (); $H = " SELECT c_list.CONSTRAINT_NAME as NAME,
c_src . COLUMN_NAME as SRC_COLUMN ,
c_dest . OWNER as DEST_DB ,
c_dest . TABLE_NAME as DEST_TABLE ,
c_dest . COLUMN_NAME as DEST_COLUMN ,
c_list . DELETE_RULE as ON_DELETE
FROM ALL_CONSTRAINTS c_list , ALL_CONS_COLUMNS c_src , ALL_CONS_COLUMNS c_dest
WHERE c_list . CONSTRAINT_NAME = c_src . CONSTRAINT_NAME
AND c_list . R_CONSTRAINT_NAME = c_dest . CONSTRAINT_NAME
AND c_list . CONSTRAINT_TYPE = 'R'
AND c_src . TABLE_NAME = " .q( $R );foreach(get_rows( $H )as $K ) $J[$K['NAME'] ]=array( " db " => $K['DEST_DB'] , " table " => $K['DEST_TABLE'] , " source " =>array( $K['SRC_COLUMN'] ), " target " =>array( $K['DEST_COLUMN'] ), " on_delete " => $K['ON_DELETE'] , " on_update " =>null,);return $J ;}function
truncate_tables ( $T ){ return
apply_queries ( " TRUNCATE TABLE " , $T );} function
drop_views ( $Si ){ return
apply_queries ( " DROP VIEW " , $Si );} function
drop_tables ( $T ){ return
apply_queries ( " DROP TABLE " , $T );} function
last_id (){ return
0 ;} function
schemas (){ return
get_vals ( " SELECT DISTINCT owner FROM dba_segments WHERE owner IN (SELECT username FROM dba_users WHERE default_tablespace NOT IN ('SYSTEM','SYSAUX')) " );} function
get_schema (){ global $g ; return $g -> result ( " SELECT sys_context('USERENV', 'SESSION_USER') FROM dual " );} function
set_schema ( $Ug ){ global $g ; return $g -> query ( " ALTER SESSION SET CURRENT_SCHEMA = " . idf_escape ( $Ug ));} function
show_variables (){ return
get_key_vals ( 'SELECT name, display_value FROM v$parameter' );} function
process_list (){ return
get_rows ( ' SELECT sess . process AS " process " , sess . username AS " user " , sess . schemaname AS " schema " , sess . status AS " status " , sess . wait_class AS " wait_class " , sess . seconds_in_wait AS " seconds_in_wait " , sql . sql_text AS " sql_text " , sess . machine AS " machine " , sess . port AS " port "
FROM v $session sess LEFT OUTER JOIN v $sql sql
ON sql . sql_id = sess . sql_id
WHERE sess . type = \ ' USER\ '
ORDER BY PROCESS
' );} function
show_status (){ $L = get_rows ( 'SELECT * FROM v$instance' ); return
reset ( $L );} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
support ( $Pc ){ return
preg_match ( '~^(columns|database|drop_col|indexes|processlist|scheme|sql|status|table|variables|view|view_trigger)$~' , $Pc );} $y = " oracle " ; $vi = array (); $_h = array (); foreach ( array ( lang ( 25 ) => array ( " number " => 38 , " binary_float " => 12 , " binary_double " => 21 ), lang ( 26 ) => array ( " date " => 10 , " timestamp " => 29 , " interval year " => 12 , " interval day " => 28 ), lang ( 23 ) => array ( " char " => 2000 , " varchar2 " => 4000 , " nchar " => 2000 , " nvarchar2 " => 4000 , " clob " => 4294967295 , " nclob " => 4294967295 ), lang ( 27 ) => array ( " raw " => 2000 , " long raw " => 2147483648 , " blob " => 4294967295 , " bfile " => 4294967296 ),) as $z => $X ){ $vi += $X ; $_h [ $z ] = array_keys ( $X );} $Bi = array (); $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " LIKE " , " LIKE %% " , " IN " , " IS NULL " , " NOT LIKE " , " NOT REGEXP " , " NOT IN " , " IS NOT NULL " , " SQL " ); $jd = array ( " length " , " lower " , " round " , " upper " ); $pd = array ( " avg " , " count " , " count distinct " , " max " , " min " , " sum " ); $mc = array ( array ( " date " => " current_date " , " timestamp " => " current_timestamp " ,), array ( " number|float|double " => " +/- " , " date|timestamp " => " + interval/- interval " , " char|clob " => " || " ,));} $ec [ " mssql " ] = " MS SQL (beta) " ; if ( isset ( $_GET [ " mssql " ])){ $ag = array ( " SQLSRV " , " MSSQL " , " PDO_DBLIB " ); define ( " DRIVER " , " mssql " ); if ( extension_loaded ( " sqlsrv " )){ class
Min_DB { var $extension = " sqlsrv " , $_link , $_result , $server_info , $affected_rows , $errno , $error ; function
_get_error (){ $this -> error = " " ; foreach ( sqlsrv_errors () as $o ){ $this -> errno = $o [ " code " ]; $this -> error .= " $o[message] \n " ;} $this -> error = rtrim ( $this -> error );} function
connect ( $O , $V , $G ){ $this -> _link =@ sqlsrv_connect ( $O , array ( " UID " => $V , " PWD " => $G , " CharacterSet " => " UTF-8 " )); if ( $this -> _link ){ $Kd = sqlsrv_server_info ( $this -> _link ); $this -> server_info = $Kd [ 'SQLServerVersion' ];} else $this -> _get_error (); return ( bool ) $this -> _link ;} function
quote ( $Q ){ return " ' " . str_replace ( " ' " , " '' " , $Q ) . " ' " ;} function
select_db ( $k ){ return $this -> query ( " USE " . idf_escape ( $k ));} function
query ( $H , $wi = false ){ $I = sqlsrv_query ( $this -> _link , $H ); $this -> error = " " ; if ( ! $I ){ $this -> _get_error (); return
false ;} return $this -> store_result ( $I );} function
multi_query ( $H ){ $this -> _result = sqlsrv_query ( $this -> _link , $H ); $this -> error = " " ; if ( ! $this -> _result ){ $this -> _get_error (); return
false ;} return
true ;} function
store_result ( $I = null ){ if ( ! $I ) $I = $this -> _result ; if ( ! $I ) return
false ; if ( sqlsrv_field_metadata ( $I )) return
new
Min_Result ( $I ); $this -> affected_rows = sqlsrv_rows_affected ( $I ); return
true ;} function
next_result (){ return $this -> _result ? sqlsrv_next_result ( $this -> _result ) : null ;} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! is_object ( $I )) return
false ; $K = $I -> fetch_row (); return $K [ $p ];}} class
Min_Result { var $_result , $_offset = 0 , $_fields , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ;} function
_convert ( $K ){ foreach (( array ) $K
as $z => $X ){ if ( is_a ( $X , 'DateTime' )) $K [ $z ] = $X -> format ( " Y-m-d H:i:s " );} return $K ;} function
fetch_assoc (){ return $this -> _convert ( sqlsrv_fetch_array ( $this -> _result , SQLSRV_FETCH_ASSOC ));} function
fetch_row (){ return $this -> _convert ( sqlsrv_fetch_array ( $this -> _result , SQLSRV_FETCH_NUMERIC ));} function
fetch_field (){ if ( ! $this -> _fields ) $this -> _fields = sqlsrv_field_metadata ( $this -> _result ); $p = $this -> _fields [ $this -> _offset ++ ]; $J = new
stdClass ; $J -> name = $p [ " Name " ]; $J -> orgname = $p [ " Name " ]; $J -> type = ( $p [ " Type " ] == 1 ? 254 : 0 ); return $J ;} function
seek ( $E ){ for ( $t = 0 ; $t < $E ; $t ++ ) sqlsrv_fetch ( $this -> _result );} function
__destruct (){ sqlsrv_free_stmt ( $this -> _result );}}} elseif ( extension_loaded ( " mssql " )){ class
Min_DB { var $extension = " MSSQL " , $_link , $_result , $server_info , $affected_rows , $error ; function
connect ( $O , $V , $G ){ $this -> _link =@ mssql_connect ( $O , $V , $G ); if ( $this -> _link ){ $I = $this -> query ( " SELECT SERVERPROPERTY('ProductLevel'), SERVERPROPERTY('Edition') " ); $K = $I -> fetch_row (); $this -> server_info = $this -> result ( " sp_server_info 2 " , 2 ) . " [ $K[0] ] $K[1] " ;} else $this -> error = mssql_get_last_message (); return ( bool ) $this -> _link ;} function
quote ( $Q ){ return " ' " . str_replace ( " ' " , " '' " , $Q ) . " ' " ;} function
select_db ( $k ){ return
mssql_select_db ( $k );} function
query ( $H , $wi = false ){ $I =@ mssql_query ( $H , $this -> _link ); $this -> error = " " ; if ( ! $I ){ $this -> error = mssql_get_last_message (); return
false ;} if ( $I === true ){ $this -> affected_rows = mssql_rows_affected ( $this -> _link ); return
true ;} return
new
Min_Result ( $I );} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result (){ return $this -> _result ;} function
next_result (){ return
mssql_next_result ( $this -> _result -> _result );} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! is_object ( $I )) return
false ; return
mssql_result ( $I -> _result , 0 , $p );}} class
Min_Result { var $_result , $_offset = 0 , $_fields , $num_rows ; function
__construct ( $I ){ $this -> _result = $I ; $this -> num_rows = mssql_num_rows ( $I );} function
fetch_assoc (){ return
mssql_fetch_assoc ( $this -> _result );} function
fetch_row (){ return
mssql_fetch_row ( $this -> _result );} function
num_rows (){ return
mssql_num_rows ( $this -> _result );} function
fetch_field (){ $J = mssql_fetch_field ( $this -> _result ); $J -> orgtable = $J -> table ; $J -> orgname = $J -> name ; return $J ;} function
seek ( $E ){ mssql_data_seek ( $this -> _result , $E );} function
__destruct (){ mssql_free_result ( $this -> _result );}}} elseif ( extension_loaded ( " pdo_dblib " )){ class
Min_DB
extends
Min_PDO { var $extension = " PDO_DBLIB " ; function
connect ( $O , $V , $G ){ $this -> dsn ( " dblib:charset=utf8;host= " . str_replace ( " : " , " ;unix_socket= " , preg_replace ( '~:(\\d)~' , ';port=\\1' , $O )), $V , $G ); return
true ;} function
select_db ( $k ){ return $this -> query ( " USE " . idf_escape ( $k ));}}} class
Min_Driver
extends
Min_SQL { function
insertUpdate ( $R , $L , $dg ){ foreach ( $L
as $P ){ $Ci = array (); $Z = array (); foreach ( $P
as $z => $X ){ $Ci [] = " $z = $X " ; if ( isset ( $dg [ idf_unescape ( $z )])) $Z [] = " $z = $X " ;} if ( ! queries ( " MERGE " . table ( $R ) . " USING (VALUES( " . implode ( " , " , $P ) . " )) AS source (c " . implode ( " , c " , range ( 1 , count ( $P ))) . " ) ON " . implode ( " AND " , $Z ) . " WHEN MATCHED THEN UPDATE SET " . implode ( " , " , $Ci ) . " WHEN NOT MATCHED THEN INSERT ( " . implode ( " , " , array_keys ( $P )) . " ) VALUES ( " . implode ( " , " , $P ) . " ); " )) return
false ;} return
true ;} function
begin (){ return
queries ( " BEGIN TRANSACTION " );}} function
idf_escape ( $v ){ return " [ " . str_replace ( " ] " , " ]] " , $v ) . " ] " ;} function
table ( $v ){ return ( $_GET [ " ns " ] != " " ? idf_escape ( $_GET [ " ns " ]) . " . " : " " ) . idf_escape ( $v );} function
connect (){ global $b ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])) return $g ; return $g -> error ;} function
get_databases (){ return
get_vals ( " SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb') " );} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return ( $_ !== null ? " TOP ( " . ( $_ + $E ) . " ) " : " " ) . " $H $Z " ;} function
limit1 ( $R , $H , $Z , $N = " \n " ){ return
limit ( $H , $Z , 1 , 0 , $N );} function
db_collation ( $m , $qb ){ global $g ; return $g -> result ( " SELECT collation_name FROM sys.databases WHERE name = " . q ( $m ));} function
engines (){ return
array ();} function
logged_user (){ global $g ; return $g -> result ( " SELECT SUSER_NAME() " );} function
tables_list (){ return
get_key_vals ( " SELECT name, type_desc FROM sys.all_objects WHERE schema_id = SCHEMA_ID( " . q ( get_schema ()) . " ) AND type IN ('S', 'U', 'V') ORDER BY name " );} function
count_tables ( $l ){ global $g ; $J = array (); foreach ( $l
as $m ){ $g -> select_db ( $m ); $J [ $m ] = $g -> result ( " SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES " );} return $J ;} function
table_status ( $D = " " ){ $J = array (); foreach ( get_rows ( " SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID( " . q ( get_schema ()) . " ) AND type IN ('S', 'U', 'V') " . ( $D != " " ? " AND name = " . q ( $D ) : " ORDER BY name " )) as $K ){ if ( $D != " " ) return $K ; $J [ $K [ " Name " ]] = $K ;} return $J ;} function
is_view ( $S ){ return $S [ " Engine " ] == " VIEW " ;} function
fk_support ( $S ){ return
true ;} function
fields ( $R ){ $J = array (); foreach ( get_rows ( " SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, CAST(d.definition as text) [default]
FROM sys . all_columns c
JOIN sys . all_objects o ON c . object_id = o . object_id
JOIN sys . types t ON c . user_type_id = t . user_type_id
LEFT JOIN sys . default_constraints d ON c . default_object_id = d . parent_column_id
WHERE o . schema_id = SCHEMA_ID ( " .q(get_schema()). " ) AND o . type IN ( 'S' , 'U' , 'V' ) AND o . name = " .q( $R ))as $K ) { $U = $K [ " type " ]; $pe = ( preg_match ( " ~char|binary~ " , $U ) ? $K [ " max_length " ] : ( $U == " decimal " ? " $K[precision] , $K[scale] " : " " )); $J [ $K [ " name " ]] = array ( " field " => $K [ " name " ], " full_type " => $U . ( $pe ? " ( $pe ) " : " " ), " type " => $U , " length " => $pe , " default " => $K [ " default " ], " null " => $K [ " is_nullable " ], " auto_increment " => $K [ " is_identity " ], " collation " => $K [ " collation_name " ], " privileges " => array ( " insert " => 1 , " select " => 1 , " update " => 1 ), " primary " => $K [ " is_identity " ],); } return $J ;}function
indexes ( $R , $h = null ){ $J = array (); foreach ( get_rows ( " SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
FROM sys . indexes i
INNER JOIN sys . index_columns ic ON i . object_id = ic . object_id AND i . index_id = ic . index_id
INNER JOIN sys . columns c ON ic . object_id = c . object_id AND ic . column_id = c . column_id
WHERE OBJECT_NAME ( i . object_id ) = " .q( $R ), $h )as $K ) { $D = $K [ " name " ]; $J [ $D ][ " type " ] = ( $K [ " is_primary_key " ] ? " PRIMARY " : ( $K [ " is_unique " ] ? " UNIQUE " : " INDEX " )); $J [ $D ][ " lengths " ] = array (); $J [ $D ][ " columns " ][ $K [ " key_ordinal " ]] = $K [ " column_name " ]; $J [ $D ][ " descs " ][ $K [ " key_ordinal " ]] = ( $K [ " is_descending_key " ] ? '1' : null ); } return $J ;}function
view ( $D ){ global $g ; return
array ( " select " => preg_replace ( '~^(?:[^[]|\\[[^]]*])*\\s+AS\\s+~isU' , '' , $g -> result ( " SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = SCHEMA_NAME() AND TABLE_NAME = " . q ( $D ))));} function
collations (){ $J = array (); foreach ( get_vals ( " SELECT name FROM fn_helpcollations() " ) as $pb ) $J [ preg_replace ( '~_.*~' , '' , $pb )][] = $pb ; return $J ;} function
information_schema ( $m ){ return
false ;} function
error (){ global $g ; return
nl_br ( h ( preg_replace ( '~^(\\[[^]]*])+~m' , '' , $g -> error )));} function
create_database ( $m , $pb ){ return
queries ( " CREATE DATABASE " . idf_escape ( $m ) . ( preg_match ( '~^[a-z0-9_]+$~i' , $pb ) ? " COLLATE $pb " : " " ));} function
drop_databases ( $l ){ return
queries ( " DROP DATABASE " . implode ( " , " , array_map ( 'idf_escape' , $l )));} function
rename_database ( $D , $pb ){ if ( preg_match ( '~^[a-z0-9_]+$~i' , $pb )) queries ( " ALTER DATABASE " . idf_escape ( DB ) . " COLLATE $pb " ); queries ( " ALTER DATABASE " . idf_escape ( DB ) . " MODIFY NAME = " . idf_escape ( $D )); return
true ;} function
auto_increment (){ return " IDENTITY " . ( $_POST [ " Auto_increment " ] != " " ? " ( " . number ( $_POST [ " Auto_increment " ]) . " ,1) " : " " ) . " PRIMARY KEY " ;} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ $c = array (); foreach ( $q
as $p ){ $d = idf_escape ( $p [ 0 ]); $X = $p [ 1 ]; if ( ! $X ) $c [ " DROP " ][] = " COLUMN $d " ; else { $X [ 1 ] = preg_replace ( " ~( COLLATE )'( \\ w+)'~ " , " \\ 1 \\ 2 " , $X [ 1 ]); if ( $p [ 0 ] == " " ) $c [ " ADD " ][] = " \n " . implode ( " " , $X ) . ( $R == " " ? substr ( $bd [ $X [ 0 ]], 16 + strlen ( $X [ 0 ])) : " " ); else { unset ( $X [ 6 ]); if ( $d != $X [ 0 ]) queries ( " EXEC sp_rename " . q ( table ( $R ) . " . $d " ) . " , " . q ( idf_unescape ( $X [ 0 ])) . " , 'COLUMN' " ); $c [ " ALTER COLUMN " . implode ( " " , $X )][] = " " ;}}} if ( $R == " " ) return
queries ( " CREATE TABLE " . table ( $D ) . " ( " . implode ( " , " ,( array ) $c [ " ADD " ]) . " \n ) " ); if ( $R != $D ) queries ( " EXEC sp_rename " . q ( table ( $R )) . " , " . q ( $D )); if ( $bd ) $c [ " " ] = $bd ; foreach ( $c
as $z => $X ){ if ( ! queries ( " ALTER TABLE " . idf_escape ( $D ) . " $z " . implode ( " , " , $X ))) return
false ;} return
true ;} function
alter_indexes ( $R , $c ){ $w = array (); $fc = array (); foreach ( $c
as $X ){ if ( $X [ 2 ] == " DROP " ){ if ( $X [ 0 ] == " PRIMARY " ) $fc [] = idf_escape ( $X [ 1 ]); else $w [] = idf_escape ( $X [ 1 ]) . " ON " . table ( $R );} elseif ( ! queries (( $X [ 0 ] != " PRIMARY " ? " CREATE $X[0] " . ( $X [ 0 ] != " INDEX " ? " INDEX " : " " ) . idf_escape ( $X [ 1 ] != " " ? $X [ 1 ] : uniqid ( $R . " _ " )) . " ON " . table ( $R ) : " ALTER TABLE " . table ( $R ) . " ADD PRIMARY KEY " ) . " ( " . implode ( " , " , $X [ 2 ]) . " ) " )) return
false ;} return ( ! $w || queries ( " DROP INDEX " . implode ( " , " , $w ))) && ( ! $fc || queries ( " ALTER TABLE " . table ( $R ) . " DROP " . implode ( " , " , $fc )));} function
last_id (){ global $g ; return $g -> result ( " SELECT SCOPE_IDENTITY() " );} function
explain ( $g , $H ){ $g -> query ( " SET SHOWPLAN_ALL ON " ); $J = $g -> query ( $H ); $g -> query ( " SET SHOWPLAN_ALL OFF " ); return $J ;} function
found_rows ( $S , $Z ){} function
foreign_keys ( $R ){ $J = array (); foreach ( get_rows ( " EXEC sp_fkeys @fktable_name = " . q ( $R )) as $K ){ $r =& $J [ $K [ " FK_NAME " ]]; $r [ " table " ] = $K [ " PKTABLE_NAME " ]; $r [ " source " ][] = $K [ " FKCOLUMN_NAME " ]; $r [ " target " ][] = $K [ " PKCOLUMN_NAME " ];} return $J ;} function
truncate_tables ( $T ){ return
apply_queries ( " TRUNCATE TABLE " , $T );} function
drop_views ( $Si ){ return
queries ( " DROP VIEW " . implode ( " , " , array_map ( 'table' , $Si )));} function
drop_tables ( $T ){ return
queries ( " DROP TABLE " . implode ( " , " , array_map ( 'table' , $T )));} function
move_tables ( $T , $Si , $Ph ){ return
apply_queries ( " ALTER SCHEMA " . idf_escape ( $Ph ) . " TRANSFER " , array_merge ( $T , $Si ));} function
trigger ( $D ){ if ( $D == " " ) return
array (); $L = get_rows ( " SELECT s.name [Trigger],
CASE WHEN OBJECTPROPERTY ( s . id , 'ExecIsInsertTrigger' ) = 1 THEN 'INSERT' WHEN OBJECTPROPERTY ( s . id , 'ExecIsUpdateTrigger' ) = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY ( s . id , 'ExecIsDeleteTrigger' ) = 1 THEN 'DELETE' END [ Event ],
CASE WHEN OBJECTPROPERTY ( s . id , 'ExecIsInsteadOfTrigger' ) = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END [ Timing ],
c . text
FROM sysobjects s
JOIN syscomments c ON s . id = c . id
WHERE s . xtype = 'TR' AND s . name = " .q( $D )); $J =reset( $L );if( $J ) $J["Statement"] =preg_replace('~^.+ \\ s+AS \\ s+~isU','', $J["text"] );return $J ;}function
triggers ( $R ){ $J = array (); foreach ( get_rows ( " SELECT sys1.name,
CASE WHEN OBJECTPROPERTY ( sys1 . id , 'ExecIsInsertTrigger' ) = 1 THEN 'INSERT' WHEN OBJECTPROPERTY ( sys1 . id , 'ExecIsUpdateTrigger' ) = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY ( sys1 . id , 'ExecIsDeleteTrigger' ) = 1 THEN 'DELETE' END [ Event ],
CASE WHEN OBJECTPROPERTY ( sys1 . id , 'ExecIsInsteadOfTrigger' ) = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END [ Timing ]
FROM sysobjects sys1
JOIN sysobjects sys2 ON sys1 . parent_obj = sys2 . id
WHERE sys1 . xtype = 'TR' AND sys2 . name = " .q( $R ))as $K ) $J[$K["name"] ]=array( $K["Timing"] , $K["Event"] );return $J ;}function
trigger_options (){ return
array ( " Timing " => array ( " AFTER " , " INSTEAD OF " ), " Event " => array ( " INSERT " , " UPDATE " , " DELETE " ), " Type " => array ( " AS " ),);} function
schemas (){ return
get_vals ( " SELECT name FROM sys.schemas " );} function
get_schema (){ global $g ; if ( $_GET [ " ns " ] != " " ) return $_GET [ " ns " ]; return $g -> result ( " SELECT SCHEMA_NAME() " );} function
set_schema ( $Tg ){ return
true ;} function
use_sql ( $k ){ return " USE " . idf_escape ( $k );} function
show_variables (){ return
array ();} function
show_status (){ return
array ();} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
support ( $Pc ){ return
preg_match ( '~^(columns|database|drop_col|indexes|scheme|sql|table|trigger|view|view_trigger)$~' , $Pc );} $y = " mssql " ; $vi = array (); $_h = array (); foreach ( array ( lang ( 25 ) => array ( " tinyint " => 3 , " smallint " => 5 , " int " => 10 , " bigint " => 20 , " bit " => 1 , " decimal " => 0 , " real " => 12 , " float " => 53 , " smallmoney " => 10 , " money " => 20 ), lang ( 26 ) => array ( " date " => 10 , " smalldatetime " => 19 , " datetime " => 19 , " datetime2 " => 19 , " time " => 8 , " datetimeoffset " => 10 ), lang ( 23 ) => array ( " char " => 8000 , " varchar " => 8000 , " text " => 2147483647 , " nchar " => 4000 , " nvarchar " => 4000 , " ntext " => 1073741823 ), lang ( 27 ) => array ( " binary " => 8000 , " varbinary " => 8000 , " image " => 2147483647 ),) as $z => $X ){ $vi += $X ; $_h [ $z ] = array_keys ( $X );} $Bi = array (); $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " LIKE " , " LIKE %% " , " IN " , " IS NULL " , " NOT LIKE " , " NOT IN " , " IS NOT NULL " ); $jd = array ( " len " , " lower " , " round " , " upper " ); $pd = array ( " avg " , " count " , " count distinct " , " max " , " min " , " sum " ); $mc = array ( array ( " date|time " => " getdate " ,), array ( " int|decimal|real|float|money|datetime " => " +/- " , " char|text " => " + " ,));} $ec [ 'firebird' ] = 'Firebird (alpha)' ; if ( isset ( $_GET [ " firebird " ])){ $ag = array ( " interbase " ); define ( " DRIVER " , " firebird " ); if ( extension_loaded ( " interbase " )){ class
Min_DB { var $extension = " Firebird " , $server_info , $affected_rows , $errno , $error , $_link , $_result ; function
connect ( $O , $V , $G ){ $this -> _link = ibase_connect ( $O , $V , $G ); if ( $this -> _link ){ $Fi = explode ( ':' , $O ); $this -> service_link = ibase_service_attach ( $Fi [ 0 ], $V , $G ); $this -> server_info = ibase_server_info ( $this -> service_link , IBASE_SVC_SERVER_VERSION );} else { $this -> errno = ibase_errcode (); $this -> error = ibase_errmsg ();} return ( bool ) $this -> _link ;} function
quote ( $Q ){ return " ' " . str_replace ( " ' " , " '' " , $Q ) . " ' " ;} function
select_db ( $k ){ return ( $k == " domain " );} function
query ( $H , $wi = false ){ $I = ibase_query ( $H , $this -> _link ); if ( ! $I ){ $this -> errno = ibase_errcode (); $this -> error = ibase_errmsg (); return
false ;} $this -> error = " " ; if ( $I === true ){ $this -> affected_rows = ibase_affected_rows ( $this -> _link ); return
true ;} return
new
Min_Result ( $I );} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result (){ return $this -> _result ;} function
next_result (){ return
false ;} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! $I ||! $I -> num_rows ) return
false ; $K = $I -> fetch_row (); return $K [ $p ];}} class
Min_Result { var $num_rows , $_result , $_offset = 0 ; function
__construct ( $I ){ $this -> _result = $I ;} function
fetch_assoc (){ return
ibase_fetch_assoc ( $this -> _result );} function
fetch_row (){ return
ibase_fetch_row ( $this -> _result );} function
fetch_field (){ $p = ibase_field_info ( $this -> _result , $this -> _offset ++ ); return ( object ) array ( 'name' => $p [ 'name' ], 'orgname' => $p [ 'name' ], 'type' => $p [ 'type' ], 'charsetnr' => $p [ 'length' ],);} function
__destruct (){ ibase_free_result ( $this -> _result );}}} class
Min_Driver
extends
Min_SQL {} function
idf_escape ( $v ){ return '"' . str_replace ( '"' , '""' , $v ) . '"' ;} function
table ( $v ){ return
idf_escape ( $v );} function
connect (){ global $b ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])) return $g ; return $g -> error ;} function
get_databases ( $ad ){ return
array ( " domain " );} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ $J = '' ; $J .= ( $_ !== null ? $N . " FIRST $_ " . ( $E ? " SKIP $E " : " " ) : " " ); $J .= " $H $Z " ; return $J ;} function
limit1 ( $R , $H , $Z , $N = " \n " ){ return
limit ( $H , $Z , 1 , 0 , $N );} function
db_collation ( $m , $qb ){} function
engines (){ return
array ();} function
logged_user (){ global $b ; $j = $b -> credentials (); return $j [ 1 ];} function
tables_list (){ global $g ; $H = 'SELECT RDB$RELATION_NAME FROM rdb$relations WHERE rdb$system_flag = 0' ; $I = ibase_query ( $g -> _link , $H ); $J = array (); while ( $K = ibase_fetch_assoc ( $I )) $J [ $K [ 'RDB$RELATION_NAME' ]] = 'table' ; ksort ( $J ); return $J ;} function
count_tables ( $l ){ return
array ();} function
table_status ( $D = " " , $Oc = false ){ global $g ; $J = array (); $Lb = tables_list (); foreach ( $Lb
as $w => $X ){ $w = trim ( $w ); $J [ $w ] = array ( 'Name' => $w , 'Engine' => 'standard' ,); if ( $D == $w ) return $J [ $w ];} return $J ;} function
is_view ( $S ){ return
false ;} function
fk_support ( $S ){ return
preg_match ( '~InnoDB|IBMDB2I~i' , $S [ " Engine " ]);} function
fields ( $R ){ global $g ; $J = array (); $H = ' SELECT r . RDB $FIELD_NAME AS field_name ,
r . RDB $DESCRIPTION AS field_description ,
r . RDB $DEFAULT_VALUE AS field_default_value ,
r . RDB $NULL_FLAG AS field_not_null_constraint ,
f . RDB $FIELD_LENGTH AS field_length ,
f . RDB $FIELD_PRECISION AS field_precision ,
f . RDB $FIELD_SCALE AS field_scale ,
CASE f . RDB $FIELD_TYPE
WHEN 261 THEN \ ' BLOB\ '
WHEN 14 THEN \ ' CHAR\ '
WHEN 40 THEN \ ' CSTRING\ '
WHEN 11 THEN \ ' D_FLOAT\ '
WHEN 27 THEN \ ' DOUBLE\ '
WHEN 10 THEN \ ' FLOAT\ '
WHEN 16 THEN \ ' INT64\ '
WHEN 8 THEN \ ' INTEGER\ '
WHEN 9 THEN \ ' QUAD\ '
WHEN 7 THEN \ ' SMALLINT\ '
WHEN 12 THEN \ ' DATE\ '
WHEN 13 THEN \ ' TIME\ '
WHEN 35 THEN \ ' TIMESTAMP\ '
WHEN 37 THEN \ ' VARCHAR\ '
ELSE \ ' UNKNOWN\ '
END AS field_type ,
f . RDB $FIELD_SUB_TYPE AS field_subtype ,
coll . RDB $COLLATION_NAME AS field_collation ,
cset . RDB $CHARACTER_SET_NAME AS field_charset
FROM RDB $RELATION_FIELDS r
LEFT JOIN RDB $FIELDS f ON r . RDB $FIELD_SOURCE = f . RDB $FIELD_NAME
LEFT JOIN RDB $COLLATIONS coll ON f . RDB $COLLATION_ID = coll . RDB $COLLATION_ID
LEFT JOIN RDB $CHARACTER_SETS cset ON f . RDB $CHARACTER_SET_ID = cset . RDB $CHARACTER_SET_ID
WHERE r . RDB $RELATION_NAME = '.q($R).'
ORDER BY r . RDB $FIELD_POSITION ';$I=ibase_query($g->_link,$H);while($K=ibase_fetch_assoc($I))$J[trim($K[' FIELD_NAME '])]=array("field"=>trim($K["FIELD_NAME"]),"full_type"=>trim($K["FIELD_TYPE"]),"type"=>trim($K["FIELD_SUB_TYPE"]),"default"=>trim($K[' FIELD_DEFAULT_VALUE ']),"null"=>(trim($K["FIELD_NOT_NULL_CONSTRAINT"])=="YES"),"auto_increment"=>' 0 ' , " collation " => trim ( $K [ " FIELD_COLLATION " ]), " privileges " => array ( " insert " => 1 , " select " => 1 , " update " => 1 ), " comment " => trim ( $K [ " FIELD_DESCRIPTION " ]),); return $J ;} function
indexes ( $R , $h = null ){ $J = array (); return $J ;} function
foreign_keys ( $R ){ return
array ();} function
collations (){ return
array ();} function
information_schema ( $m ){ return
false ;} function
error (){ global $g ; return
h ( $g -> error );} function
types (){ return
array ();} function
schemas (){ return
array ();} function
get_schema (){ return " " ;} function
set_schema ( $Tg ){ return
true ;} function
support ( $Pc ){ return
preg_match ( " ~^(columns|sql|status|table) $ ~ " , $Pc );} $y = " firebird " ; $of = array ( " = " ); $jd = array (); $pd = array (); $mc = array ();} $ec [ " simpledb " ] = " SimpleDB " ; if ( isset ( $_GET [ " simpledb " ])){ $ag = array ( " SimpleXML + allow_url_fopen " ); define ( " DRIVER " , " simpledb " ); if ( class_exists ( 'SimpleXMLElement' ) && ini_bool ( 'allow_url_fopen' )){ class
Min_DB { var $extension = " SimpleXML " , $server_info = '2009-04-15' , $error , $timeout , $next , $affected_rows , $_result ; function
select_db ( $k ){ return ( $k == " domain " );} function
query ( $H , $wi = false ){ $Hf = array ( 'SelectExpression' => $H , 'ConsistentRead' => 'true' ); if ( $this -> next ) $Hf [ 'NextToken' ] = $this -> next ; $I = sdb_request_all ( 'Select' , 'Item' , $Hf , $this -> timeout ); if ( $I === false ) return $I ; if ( preg_match ( '~^\s*SELECT\s+COUNT\(~i' , $H )){ $Dh = 0 ; foreach ( $I
as $Wd ) $Dh += $Wd -> Attribute -> Value ; $I = array (( object ) array ( 'Attribute' => array (( object ) array ( 'Name' => 'Count' , 'Value' => $Dh ,))));} return
new
Min_Result ( $I );} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
store_result (){ return $this -> _result ;} function
next_result (){ return
false ;} function
quote ( $Q ){ return " ' " . str_replace ( " ' " , " '' " , $Q ) . " ' " ;}} class
Min_Result { var $num_rows , $_rows = array (), $_offset = 0 ; function
__construct ( $I ){ foreach ( $I
as $Wd ){ $K = array (); if ( $Wd -> Name != '' ) $K [ 'itemName()' ] = ( string ) $Wd -> Name ; foreach ( $Wd -> Attribute
as $Ja ){ $D = $this -> _processValue ( $Ja -> Name ); $Y = $this -> _processValue ( $Ja -> Value ); if ( isset ( $K [ $D ])){ $K [ $D ] = ( array ) $K [ $D ]; $K [ $D ][] = $Y ;} else $K [ $D ] = $Y ;} $this -> _rows [] = $K ; foreach ( $K
as $z => $X ){ if ( ! isset ( $this -> _rows [ 0 ][ $z ])) $this -> _rows [ 0 ][ $z ] = null ;}} $this -> num_rows = count ( $this -> _rows );} function
_processValue ( $pc ){ return ( is_object ( $pc ) && $pc [ 'encoding' ] == 'base64' ? base64_decode ( $pc ) : ( string ) $pc );} function
fetch_assoc (){ $K = current ( $this -> _rows ); if ( ! $K ) return $K ; $J = array (); foreach ( $this -> _rows [ 0 ] as $z => $X ) $J [ $z ] = $K [ $z ]; next ( $this -> _rows ); return $J ;} function
fetch_row (){ $J = $this -> fetch_assoc (); if ( ! $J ) return $J ; return
array_values ( $J );} function
fetch_field (){ $ce = array_keys ( $this -> _rows [ 0 ]); return ( object ) array ( 'name' => $ce [ $this -> _offset ++ ]);}}} class
Min_Driver
extends
Min_SQL { public $dg = " itemName() " ; function
_chunkRequest ( $Ad , $wa , $Hf , $Ec = array ()){ global $g ; foreach ( array_chunk ( $Ad , 25 ) as $ib ){ $If = $Hf ; foreach ( $ib
as $t => $u ){ $If [ " Item. $t .ItemName " ] = $u ; foreach ( $Ec
as $z => $X ) $If [ " Item. $t . $z " ] = $X ;} if ( ! sdb_request ( $wa , $If )) return
false ;} $g -> affected_rows = count ( $Ad ); return
true ;} function
_extractIds ( $R , $pg , $_ ){ $J = array (); if ( preg_match_all ( " ~itemName \ ( \ ) = (('[^']*+')+)~ " , $pg , $ze )) $J = array_map ( 'idf_unescape' , $ze [ 1 ]); else { foreach ( sdb_request_all ( 'Select' , 'Item' , array ( 'SelectExpression' => 'SELECT itemName() FROM ' . table ( $R ) . $pg . ( $_ ? " LIMIT 1 " : " " ))) as $Wd ) $J [] = $Wd -> Name ;} return $J ;} function
select ( $R , $M , $Z , $md , $tf = array (), $_ = 1 , $F = 0 , $fg = false ){ global $g ; $g -> next = $_GET [ " next " ]; $J = parent :: select ( $R , $M , $Z , $md , $tf , $_ , $F , $fg ); $g -> next = 0 ; return $J ;} function
delete ( $R , $pg , $_ = 0 ){ return $this -> _chunkRequest ( $this -> _extractIds ( $R , $pg , $_ ), 'BatchDeleteAttributes' , array ( 'DomainName' => $R ));} function
update ( $R , $P , $pg , $_ = 0 , $N = " \n " ){ $Ub = array (); $Od = array (); $t = 0 ; $Ad = $this -> _extractIds ( $R , $pg , $_ ); $u = idf_unescape ( $P [ " `itemName()` " ]); unset ( $P [ " `itemName()` " ]); foreach ( $P
as $z => $X ){ $z = idf_unescape ( $z ); if ( $X == " NULL " || ( $u != " " && array ( $u ) != $Ad )) $Ub [ " Attribute. " . count ( $Ub ) . " .Name " ] = $z ; if ( $X != " NULL " ){ foreach (( array ) $X
as $Yd => $W ){ $Od [ " Attribute. $t .Name " ] = $z ; $Od [ " Attribute. $t .Value " ] = ( is_array ( $X ) ? $W : idf_unescape ( $W )); if ( ! $Yd ) $Od [ " Attribute. $t .Replace " ] = " true " ; $t ++ ;}}} $Hf = array ( 'DomainName' => $R ); return ( ! $Od || $this -> _chunkRequest (( $u != " " ? array ( $u ) : $Ad ), 'BatchPutAttributes' , $Hf , $Od )) && ( ! $Ub || $this -> _chunkRequest ( $Ad , 'BatchDeleteAttributes' , $Hf , $Ub ));} function
insert ( $R , $P ){ $Hf = array ( " DomainName " => $R ); $t = 0 ; foreach ( $P
as $D => $Y ){ if ( $Y != " NULL " ){ $D = idf_unescape ( $D ); if ( $D == " itemName() " ) $Hf [ " ItemName " ] = idf_unescape ( $Y ); else { foreach (( array ) $Y
as $X ){ $Hf [ " Attribute. $t .Name " ] = $D ; $Hf [ " Attribute. $t .Value " ] = ( is_array ( $Y ) ? $X : idf_unescape ( $Y )); $t ++ ;}}}} return
sdb_request ( 'PutAttributes' , $Hf );} function
insertUpdate ( $R , $L , $dg ){ foreach ( $L
as $P ){ if ( ! $this -> update ( $R , $P , " WHERE `itemName()` = " . q ( $P [ " `itemName()` " ]))) return
false ;} return
true ;} function
begin (){ return
false ;} function
commit (){ return
false ;} function
rollback (){ return
false ;}} function
connect (){ return
new
Min_DB ;} function
support ( $Pc ){ return
preg_match ( '~sql~' , $Pc );} function
logged_user (){ global $b ; $j = $b -> credentials (); return $j [ 1 ];} function
get_databases (){ return
array ( " domain " );} function
collations (){ return
array ();} function
db_collation ( $m , $qb ){} function
tables_list (){ global $g ; $J = array (); foreach ( sdb_request_all ( 'ListDomains' , 'DomainName' ) as $R ) $J [( string ) $R ] = 'table' ; if ( $g -> error && defined ( " PAGE_HEADER " )) echo " <p class='error'> " . error () . " \n " ; return $J ;} function
table_status ( $D = " " , $Oc = false ){ $J = array (); foreach (( $D != " " ? array ( $D => true ) : tables_list ()) as $R => $U ){ $K = array ( " Name " => $R , " Auto_increment " => " " ); if ( ! $Oc ){ $Le = sdb_request ( 'DomainMetadata' , array ( 'DomainName' => $R )); if ( $Le ){ foreach ( array ( " Rows " => " ItemCount " , " Data_length " => " ItemNamesSizeBytes " , " Index_length " => " AttributeValuesSizeBytes " , " Data_free " => " AttributeNamesSizeBytes " ,) as $z => $X ) $K [ $z ] = ( string ) $Le -> $X ;}} if ( $D != " " ) return $K ; $J [ $R ] = $K ;} return $J ;} function
explain ( $g , $H ){} function
error (){ global $g ; return
h ( $g -> error );} function
information_schema (){} function
is_view ( $S ){} function
indexes ( $R , $h = null ){ return
array ( array ( " type " => " PRIMARY " , " columns " => array ( " itemName() " )),);} function
fields ( $R ){ return
fields_from_edit ();} function
foreign_keys ( $R ){ return
array ();} function
table ( $v ){ return
idf_escape ( $v );} function
idf_escape ( $v ){ return " ` " . str_replace ( " ` " , " `` " , $v ) . " ` " ;} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return " $H $Z " . ( $_ !== null ? $N . " LIMIT $_ " : " " );} function
unconvert_field ( $p , $J ){ return $J ;} function
fk_support ( $S ){} function
engines (){ return
array ();} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ return ( $R == " " && sdb_request ( 'CreateDomain' , array ( 'DomainName' => $D )));} function
drop_tables ( $T ){ foreach ( $T
as $R ){ if ( ! sdb_request ( 'DeleteDomain' , array ( 'DomainName' => $R ))) return
false ;} return
true ;} function
count_tables ( $l ){ foreach ( $l
as $m ) return
array ( $m => count ( tables_list ()));} function
found_rows ( $S , $Z ){ return ( $Z ? null : $S [ " Rows " ]);} function
last_id (){} function
hmac ( $Ca , $Lb , $z , $tg = false ){ $Va = 64 ; if ( strlen ( $z ) > $Va ) $z = pack ( " H* " , $Ca ( $z )); $z = str_pad ( $z , $Va , " \0 " ); $Zd = $z ^ str_repeat ( " \x36 " , $Va ); $ae = $z ^ str_repeat ( " \x5C " , $Va ); $J = $Ca ( $ae . pack ( " H* " , $Ca ( $Zd . $Lb ))); if ( $tg ) $J = pack ( " H* " , $J ); return $J ;} function
sdb_request ( $wa , $Hf = array ()){ global $b , $g ; list ( $yd , $Hf [ 'AWSAccessKeyId' ], $Wg ) = $b -> credentials (); $Hf [ 'Action' ] = $wa ; $Hf [ 'Timestamp' ] = gmdate ( 'Y-m-d\TH:i:s+00:00' ); $Hf [ 'Version' ] = '2009-04-15' ; $Hf [ 'SignatureVersion' ] = 2 ; $Hf [ 'SignatureMethod' ] = 'HmacSHA1' ; ksort ( $Hf ); $H = '' ; foreach ( $Hf
as $z => $X ) $H .= '&' . rawurlencode ( $z ) . '=' . rawurlencode ( $X ); $H = str_replace ( '%7E' , '~' , substr ( $H , 1 )); $H .= " &Signature= " . urlencode ( base64_encode ( hmac ( 'sha1' , " POST \n " . preg_replace ( '~^https?://~' , '' , $yd ) . " \n / \n $H " , $Wg , true ))); @ ini_set ( 'track_errors' , 1 ); $Tc =@ file_get_contents (( preg_match ( '~^https?://~' , $yd ) ? $yd : " http:// $yd " ), false , stream_context_create ( array ( 'http' => array ( 'method' => 'POST' , 'content' => $H , 'ignore_errors' => 1 ,)))); if ( ! $Tc ){ $g -> error = $php_errormsg ; return
false ;} libxml_use_internal_errors ( true ); $fj = simplexml_load_string ( $Tc ); if ( ! $fj ){ $o = libxml_get_last_error (); $g -> error = $o -> message ; return
false ;} if ( $fj -> Errors ){ $o = $fj -> Errors -> Error ; $g -> error = " $o->Message ( $o->Code ) " ; return
false ;} $g -> error = '' ; $Oh = $wa . " Result " ; return ( $fj -> $Oh ? $fj -> $Oh : true );} function
sdb_request_all ( $wa , $Oh , $Hf = array (), $Xh = 0 ){ $J = array (); $vh = ( $Xh ? microtime ( true ) : 0 ); $_ = ( preg_match ( '~LIMIT\s+(\d+)\s*$~i' , $Hf [ 'SelectExpression' ], $C ) ? $C [ 1 ] : 0 ); do { $fj = sdb_request ( $wa , $Hf ); if ( ! $fj ) break ; foreach ( $fj -> $Oh
as $pc ) $J [] = $pc ; if ( $_ && count ( $J ) >= $_ ){ $_GET [ " next " ] = $fj -> NextToken ; break ;} if ( $Xh && microtime ( true ) - $vh > $Xh ) return
false ; $Hf [ 'NextToken' ] = $fj -> NextToken ; if ( $_ ) $Hf [ 'SelectExpression' ] = preg_replace ( '~\d+\s*$~' , $_ - count ( $J ), $Hf [ 'SelectExpression' ]);} while ( $fj -> NextToken ); return $J ;} $y = " simpledb " ; $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " LIKE " , " LIKE %% " , " IN " , " IS NULL " , " NOT LIKE " , " IS NOT NULL " ); $jd = array (); $pd = array ( " count " ); $mc = array ( array ( " json " ));} $ec [ " mongo " ] = " MongoDB " ; if ( isset ( $_GET [ " mongo " ])){ $ag = array ( " mongo " , " mongodb " ); define ( " DRIVER " , " mongo " ); if ( class_exists ( 'MongoDB' )){ class
Min_DB { var $extension = " Mongo " , $error , $last_id , $_link , $_db ; function
connect ( $O , $V , $G ){ global $b ; $m = $b -> database (); $rf = array (); if ( $V != " " ){ $rf [ " username " ] = $V ; $rf [ " password " ] = $G ;} if ( $m != " " ) $rf [ " db " ] = $m ; try { $this -> _link =@ new
MongoClient ( " mongodb:// $O " , $rf ); return
true ;} catch ( Exception $Ac ){ $this -> error = $Ac -> getMessage (); return
false ;}} function
query ( $H ){ return
false ;} function
select_db ( $k ){ try { $this -> _db = $this -> _link -> selectDB ( $k ); return
true ;} catch ( Exception $Ac ){ $this -> error = $Ac -> getMessage (); return
false ;}} function
quote ( $Q ){ return $Q ;}} class
Min_Result { var $num_rows , $_rows = array (), $_offset = 0 , $_charset = array (); function
__construct ( $I ){ foreach ( $I
as $Wd ){ $K = array (); foreach ( $Wd
as $z => $X ){ if ( is_a ( $X , 'MongoBinData' )) $this -> _charset [ $z ] = 63 ; $K [ $z ] = ( is_a ( $X , 'MongoId' ) ? 'ObjectId("' . strval ( $X ) . '")' : ( is_a ( $X , 'MongoDate' ) ? gmdate ( " Y-m-d H:i:s " , $X -> sec ) . " GMT " : ( is_a ( $X , 'MongoBinData' ) ? $X -> bin : ( is_a ( $X , 'MongoRegex' ) ? strval ( $X ) : ( is_object ( $X ) ? get_class ( $X ) : $X )))));} $this -> _rows [] = $K ; foreach ( $K
as $z => $X ){ if ( ! isset ( $this -> _rows [ 0 ][ $z ])) $this -> _rows [ 0 ][ $z ] = null ;}} $this -> num_rows = count ( $this -> _rows );} function
fetch_assoc (){ $K = current ( $this -> _rows ); if ( ! $K ) return $K ; $J = array (); foreach ( $this -> _rows [ 0 ] as $z => $X ) $J [ $z ] = $K [ $z ]; next ( $this -> _rows ); return $J ;} function
fetch_row (){ $J = $this -> fetch_assoc (); if ( ! $J ) return $J ; return
array_values ( $J );} function
fetch_field (){ $ce = array_keys ( $this -> _rows [ 0 ]); $D = $ce [ $this -> _offset ++ ]; return ( object ) array ( 'name' => $D , 'charsetnr' => $this -> _charset [ $D ],);}} class
Min_Driver
extends
Min_SQL { public $dg = " _id " ; function
select ( $R , $M , $Z , $md , $tf = array (), $_ = 1 , $F = 0 , $fg = false ){ $M = ( $M == array ( " * " ) ? array () : array_fill_keys ( $M , true )); $mh = array (); foreach ( $tf
as $X ){ $X = preg_replace ( '~ DESC$~' , '' , $X , 1 , $Eb ); $mh [ $X ] = ( $Eb ? - 1 : 1 );} return
new
Min_Result ( $this -> _conn -> _db -> selectCollection ( $R ) -> find ( array (), $M ) -> sort ( $mh ) -> limit ( $_ != " " ? + $_ : 0 ) -> skip ( $F * $_ ));} function
insert ( $R , $P ){ try { $J = $this -> _conn -> _db -> selectCollection ( $R ) -> insert ( $P ); $this -> _conn -> errno = $J [ 'code' ]; $this -> _conn -> error = $J [ 'err' ]; $this -> _conn -> last_id = $P [ '_id' ]; return ! $J [ 'err' ];} catch ( Exception $Ac ){ $this -> _conn -> error = $Ac -> getMessage (); return
false ;}}} function
get_databases ( $ad ){ global $g ; $J = array (); $Qb = $g -> _link -> listDBs (); foreach ( $Qb [ 'databases' ] as $m ) $J [] = $m [ 'name' ]; return $J ;} function
count_tables ( $l ){ global $g ; $J = array (); foreach ( $l
as $m ) $J [ $m ] = count ( $g -> _link -> selectDB ( $m ) -> getCollectionNames ( true )); return $J ;} function
tables_list (){ global $g ; return
array_fill_keys ( $g -> _db -> getCollectionNames ( true ), 'table' );} function
drop_databases ( $l ){ global $g ; foreach ( $l
as $m ){ $Fg = $g -> _link -> selectDB ( $m ) -> drop (); if ( ! $Fg [ 'ok' ]) return
false ;} return
true ;} function
indexes ( $R , $h = null ){ global $g ; $J = array (); foreach ( $g -> _db -> selectCollection ( $R ) -> getIndexInfo () as $w ){ $Xb = array (); foreach ( $w [ " key " ] as $d => $U ) $Xb [] = ( $U ==- 1 ? '1' : null ); $J [ $w [ " name " ]] = array ( " type " => ( $w [ " name " ] == " _id_ " ? " PRIMARY " : ( $w [ " unique " ] ? " UNIQUE " : " INDEX " )), " columns " => array_keys ( $w [ " key " ]), " lengths " => array (), " descs " => $Xb ,);} return $J ;} function
fields ( $R ){ return
fields_from_edit ();} function
found_rows ( $S , $Z ){ global $g ; return $g -> _db -> selectCollection ( $_GET [ " select " ]) -> count ( $Z );} $of = array ( " = " );} elseif ( class_exists ( 'MongoDB\Driver\Manager' )){ class
Min_DB { var $extension = " MongoDB " , $error , $last_id ; var $_link ; var $_db , $_db_name ; function
connect ( $O , $V , $G ){ global $b ; $m = $b -> database (); $rf = array (); if ( $V != " " ){ $rf [ " username " ] = $V ; $rf [ " password " ] = $G ;} if ( $m != " " ) $rf [ " db " ] = $m ; try { $kb = 'MongoDB\Driver\Manager' ; $this -> _link = new $kb ( " mongodb:// $O " , $rf ); return
true ;} catch ( Exception $Ac ){ $this -> error = $Ac -> getMessage (); return
false ;}} function
query ( $H ){ return
false ;} function
select_db ( $k ){ try { $this -> _db_name = $k ; return
true ;} catch ( Exception $Ac ){ $this -> error = $Ac -> getMessage (); return
false ;}} function
quote ( $Q ){ return $Q ;}} class
Min_Result { var $num_rows , $_rows = array (), $_offset = 0 , $_charset = array (); function
__construct ( $I ){ foreach ( $I
as $Wd ){ $K = array (); foreach ( $Wd
as $z => $X ){ if ( is_a ( $X , 'MongoDB\BSON\Binary' )) $this -> _charset [ $z ] = 63 ; $K [ $z ] = ( is_a ( $X , 'MongoDB\BSON\ObjectID' ) ? 'MongoDB\BSON\ObjectID("' . strval ( $X ) . '")' : ( is_a ( $X , 'MongoDB\BSON\UTCDatetime' ) ? $X -> toDateTime () -> format ( 'Y-m-d H:i:s' ) : ( is_a ( $X , 'MongoDB\BSON\Binary' ) ? $X -> bin : ( is_a ( $X , 'MongoDB\BSON\Regex' ) ? strval ( $X ) : ( is_object ( $X ) ? json_encode ( $X , 256 ) : $X )))));} $this -> _rows [] = $K ; foreach ( $K
as $z => $X ){ if ( ! isset ( $this -> _rows [ 0 ][ $z ])) $this -> _rows [ 0 ][ $z ] = null ;}} $this -> num_rows = $I -> count ;} function
fetch_assoc (){ $K = current ( $this -> _rows ); if ( ! $K ) return $K ; $J = array (); foreach ( $this -> _rows [ 0 ] as $z => $X ) $J [ $z ] = $K [ $z ]; next ( $this -> _rows ); return $J ;} function
fetch_row (){ $J = $this -> fetch_assoc (); if ( ! $J ) return $J ; return
array_values ( $J );} function
fetch_field (){ $ce = array_keys ( $this -> _rows [ 0 ]); $D = $ce [ $this -> _offset ++ ]; return ( object ) array ( 'name' => $D , 'charsetnr' => $this -> _charset [ $D ],);}} class
Min_Driver
extends
Min_SQL { public $dg = " _id " ; function
select ( $R , $M , $Z , $md , $tf = array (), $_ = 1 , $F = 0 , $fg = false ){ global $g ; $M = ( $M == array ( " * " ) ? array () : array_fill_keys ( $M , 1 )); if ( count ( $M ) &&! isset ( $M [ '_id' ])) $M [ '_id' ] = 0 ; $Z = where_to_query ( $Z ); $mh = array (); foreach ( $tf
as $X ){ $X = preg_replace ( '~ DESC$~' , '' , $X , 1 , $Eb ); $mh [ $X ] = ( $Eb ? - 1 : 1 );} if ( isset ( $_GET [ 'limit' ]) && is_numeric ( $_GET [ 'limit' ]) && $_GET [ 'limit' ] > 0 ) $_ = $_GET [ 'limit' ]; $_ = min ( 200 , max ( 1 ,( int ) $_ )); $kh = $F * $_ ; $kb = 'MongoDB\Driver\Query' ; $H = new $kb ( $Z , array ( 'projection' => $M , 'limit' => $_ , 'skip' => $kh , 'sort' => $mh )); $Ig = $g -> _link -> executeQuery ( " $g->_db_name . $R " , $H ); return
new
Min_Result ( $Ig );} function
update ( $R , $P , $pg , $_ = 0 , $N = " \n " ){ global $g ; $m = $g -> _db_name ; $Z = sql_query_where_parser ( $pg ); $kb = 'MongoDB\Driver\BulkWrite' ; $Za = new $kb ( array ()); if ( isset ( $P [ '_id' ])) unset ( $P [ '_id' ]); $Cg = array (); foreach ( $P
as $z => $Y ){ if ( $Y == 'NULL' ){ $Cg [ $z ] = 1 ; unset ( $P [ $z ]);}} $Ci = array ( '$set' => $P ); if ( count ( $Cg )) $Ci [ '$unset' ] = $Cg ; $Za -> update ( $Z , $Ci , array ( 'upsert' => false )); $Ig = $g -> _link -> executeBulkWrite ( " $m . $R " , $Za ); $g -> affected_rows = $Ig -> getModifiedCount (); return
true ;} function
delete ( $R , $pg , $_ = 0 ){ global $g ; $m = $g -> _db_name ; $Z = sql_query_where_parser ( $pg ); $kb = 'MongoDB\Driver\BulkWrite' ; $Za = new $kb ( array ()); $Za -> delete ( $Z , array ( 'limit' => $_ )); $Ig = $g -> _link -> executeBulkWrite ( " $m . $R " , $Za ); $g -> affected_rows = $Ig -> getDeletedCount (); return
true ;} function
insert ( $R , $P ){ global $g ; $m = $g -> _db_name ; $kb = 'MongoDB\Driver\BulkWrite' ; $Za = new $kb ( array ()); if ( isset ( $P [ '_id' ]) && empty ( $P [ '_id' ])) unset ( $P [ '_id' ]); $Za -> insert ( $P ); $Ig = $g -> _link -> executeBulkWrite ( " $m . $R " , $Za ); $g -> affected_rows = $Ig -> getInsertedCount (); return
true ;}} function
get_databases ( $ad ){ global $g ; $J = array (); $kb = 'MongoDB\Driver\Command' ; $tb = new $kb ( array ( 'listDatabases' => 1 )); $Ig = $g -> _link -> executeCommand ( 'admin' , $tb ); foreach ( $Ig
as $Qb ){ foreach ( $Qb -> databases
as $m ) $J [] = $m -> name ;} return $J ;} function
count_tables ( $l ){ $J = array (); return $J ;} function
tables_list (){ global $g ; $kb = 'MongoDB\Driver\Command' ; $tb = new $kb ( array ( 'listCollections' => 1 )); $Ig = $g -> _link -> executeCommand ( $g -> _db_name , $tb ); $rb = array (); foreach ( $Ig
as $I ) $rb [ $I -> name ] = 'table' ; return $rb ;} function
drop_databases ( $l ){ return
false ;} function
indexes ( $R , $h = null ){ global $g ; $J = array (); $kb = 'MongoDB\Driver\Command' ; $tb = new $kb ( array ( 'listIndexes' => $R )); $Ig = $g -> _link -> executeCommand ( $g -> _db_name , $tb ); foreach ( $Ig
as $w ){ $Xb = array (); $e = array (); foreach ( get_object_vars ( $w -> key ) as $d => $U ){ $Xb [] = ( $U ==- 1 ? '1' : null ); $e [] = $d ;} $J [ $w -> name ] = array ( " type " => ( $w -> name == " _id_ " ? " PRIMARY " : ( isset ( $w -> unique ) ? " UNIQUE " : " INDEX " )), " columns " => $e , " lengths " => array (), " descs " => $Xb ,);} return $J ;} function
fields ( $R ){ $q = fields_from_edit (); if ( ! count ( $q )){ global $n ; $I = $n -> select ( $R , array ( " * " ), null , null , array (), 10 ); while ( $K = $I -> fetch_assoc ()){ foreach ( $K
as $z => $X ){ $K [ $z ] = null ; $q [ $z ] = array ( " field " => $z , " type " => " string " , " null " => ( $z != $n -> primary ), " auto_increment " => ( $z == $n -> primary ), " privileges " => array ( " insert " => 1 , " select " => 1 , " update " => 1 ,),);}}} return $q ;} function
found_rows ( $S , $Z ){ global $g ; $Z = where_to_query ( $Z ); $kb = 'MongoDB\Driver\Command' ; $tb = new $kb ( array ( 'count' => $S [ 'Name' ], 'query' => $Z )); $Ig = $g -> _link -> executeCommand ( $g -> _db_name , $tb ); $fi = $Ig -> toArray (); return $fi [ 0 ] -> n ;} function
sql_query_where_parser ( $pg ){ $pg = trim ( preg_replace ( '/WHERE[\s]?[(]?\(?/' , '' , $pg )); $pg = preg_replace ( '/\)\)\)$/' , ')' , $pg ); $cj = explode ( ' AND ' , $pg ); $dj = explode ( ') OR (' , $pg ); $Z = array (); foreach ( $cj
as $aj ) $Z [] = trim ( $aj ); if ( count ( $dj ) == 1 ) $dj = array (); elseif ( count ( $dj ) > 1 ) $Z = array (); return
where_to_query ( $Z , $dj );} function
where_to_query ( $Yi = array (), $Zi = array ()){ global $of ; $Lb = array (); foreach ( array ( 'and' => $Yi , 'or' => $Zi ) as $U => $Z ){ if ( is_array ( $Z )){ foreach ( $Z
as $Hc ){ list ( $nb , $mf , $X ) = explode ( " " , $Hc , 3 ); if ( $nb == " _id " ){ $X = str_replace ( 'MongoDB\BSON\ObjectID("' , " " , $X ); $X = str_replace ( '")' , " " , $X ); $kb = 'MongoDB\BSON\ObjectID' ; $X = new $kb ( $X );} if ( ! in_array ( $mf , $of )) continue ; if ( preg_match ( '~^\(f\)(.+)~' , $mf , $C )){ $X = ( float ) $X ; $mf = $C [ 1 ];} elseif ( preg_match ( '~^\(date\)(.+)~' , $mf , $C )){ $Nb = new
DateTime ( $X ); $kb = 'MongoDB\BSON\UTCDatetime' ; $X = new $kb ( $Nb -> getTimestamp () * 1000 ); $mf = $C [ 1 ];} switch ( $mf ){ case '=' : $mf = '$eq' ; break ; case '!=' : $mf = '$ne' ; break ; case '>' : $mf = '$gt' ; break ; case '<' : $mf = '$lt' ; break ; case '>=' : $mf = '$gte' ; break ; case '<=' : $mf = '$lte' ; break ; case 'regex' : $mf = '$regex' ; break ; default : continue ;} if ( $U == 'and' ) $Lb [ '$and' ][] = array ( $nb => array ( $mf => $X )); elseif ( $U == 'or' ) $Lb [ '$or' ][] = array ( $nb => array ( $mf => $X ));}}} return $Lb ;} $of = array ( " = " , " != " , " > " , " < " , " >= " , " <= " , " regex " , " (f)= " , " (f)!= " , " (f)> " , " (f)< " , " (f)>= " , " (f)<= " , " (date)= " , " (date)!= " , " (date)> " , " (date)< " , " (date)>= " , " (date)<= " ,);} function
table ( $v ){ return $v ;} function
idf_escape ( $v ){ return $v ;} function
table_status ( $D = " " , $Oc = false ){ $J = array (); foreach ( tables_list () as $R => $U ){ $J [ $R ] = array ( " Name " => $R ); if ( $D == $R ) return $J [ $R ];} return $J ;} function
last_id (){ global $g ; return $g -> last_id ;} function
error (){ global $g ; return
h ( $g -> error );} function
collations (){ return
array ();} function
logged_user (){ global $b ; $j = $b -> credentials (); return $j [ 1 ];} function
connect (){ global $b ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])) return $g ; return $g -> error ;} function
alter_indexes ( $R , $c ){ global $g ; foreach ( $c
as $X ){ list ( $U , $D , $P ) = $X ; if ( $P == " DROP " ) $J = $g -> _db -> command ( array ( " deleteIndexes " => $R , " index " => $D )); else { $e = array (); foreach ( $P
as $d ){ $d = preg_replace ( '~ DESC$~' , '' , $d , 1 , $Eb ); $e [ $d ] = ( $Eb ? - 1 : 1 );} $J = $g -> _db -> selectCollection ( $R ) -> ensureIndex ( $e , array ( " unique " => ( $U == " UNIQUE " ), " name " => $D ,));} if ( $J [ 'errmsg' ]){ $g -> error = $J [ 'errmsg' ]; return
false ;}} return
true ;} function
support ( $Pc ){ return
preg_match ( " ~database|indexes~ " , $Pc );} function
db_collation ( $m , $qb ){} function
information_schema (){} function
is_view ( $S ){} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
foreign_keys ( $R ){ return
array ();} function
fk_support ( $S ){} function
engines (){ return
array ();} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ global $g ; if ( $R == " " ){ $g -> _db -> createCollection ( $D ); return
true ;}} function
drop_tables ( $T ){ global $g ; foreach ( $T
as $R ){ $Fg = $g -> _db -> selectCollection ( $R ) -> drop (); if ( ! $Fg [ 'ok' ]) return
false ;} return
true ;} function
truncate_tables ( $T ){ global $g ; foreach ( $T
as $R ){ $Fg = $g -> _db -> selectCollection ( $R ) -> remove (); if ( ! $Fg [ 'ok' ]) return
false ;} return
true ;} $y = " mongo " ; $jd = array (); $pd = array (); $mc = array ( array ( " json " ));} $ec [ " elastic " ] = " Elasticsearch (beta) " ; if ( isset ( $_GET [ " elastic " ])){ $ag = array ( " json " ); define ( " DRIVER " , " elastic " ); if ( function_exists ( 'json_decode' )){ class
Min_DB { var $extension = " JSON " , $server_info , $errno , $error , $_url ; function
rootQuery ( $Rf , $_b = array (), $Me = 'GET' ){ @ ini_set ( 'track_errors' , 1 ); $Tc =@ file_get_contents ( " $this->_url / " . ltrim ( $Rf , '/' ), false , stream_context_create ( array ( 'http' => array ( 'method' => $Me , 'content' => $_b === null ? $_b : json_encode ( $_b ), 'header' => 'Content-Type: application/json' , 'ignore_errors' => 1 ,)))); if ( ! $Tc ){ $this -> error = $php_errormsg ; return $Tc ;} if ( ! preg_match ( '~^HTTP/[0-9.]+ 2~i' , $http_response_header [ 0 ])){ $this -> error = $Tc ; return
false ;} $J = json_decode ( $Tc , true ); if ( $J === null ){ $this -> errno = json_last_error (); if ( function_exists ( 'json_last_error_msg' )) $this -> error = json_last_error_msg (); else { $zb = get_defined_constants ( true ); foreach ( $zb [ 'json' ] as $D => $Y ){ if ( $Y == $this -> errno && preg_match ( '~^JSON_ERROR_~' , $D )){ $this -> error = $D ; break ;}}}} return $J ;} function
query ( $Rf , $_b = array (), $Me = 'GET' ){ return $this -> rootQuery (( $this -> _db != " " ? " $this->_db / " : " / " ) . ltrim ( $Rf , '/' ), $_b , $Me );} function
connect ( $O , $V , $G ){ preg_match ( '~^(https?://)?(.*)~' , $O , $C ); $this -> _url = ( $C [ 1 ] ? $C [ 1 ] : " http:// " ) . " $V : $G @ $C[2] " ; $J = $this -> query ( '' ); if ( $J ) $this -> server_info = $J [ 'version' ][ 'number' ]; return ( bool ) $J ;} function
select_db ( $k ){ $this -> _db = $k ; return
true ;} function
quote ( $Q ){ return $Q ;}} class
Min_Result { var $num_rows , $_rows ; function
__construct ( $L ){ $this -> num_rows = count ( $this -> _rows ); $this -> _rows = $L ; reset ( $this -> _rows );} function
fetch_assoc (){ $J = current ( $this -> _rows ); next ( $this -> _rows ); return $J ;} function
fetch_row (){ return
array_values ( $this -> fetch_assoc ());}}} class
Min_Driver
extends
Min_SQL { function
select ( $R , $M , $Z , $md , $tf = array (), $_ = 1 , $F = 0 , $fg = false ){ global $b ; $Lb = array (); $H = " $R /_search " ; if ( $M != array ( " * " )) $Lb [ " fields " ] = $M ; if ( $tf ){ $mh = array (); foreach ( $tf
as $nb ){ $nb = preg_replace ( '~ DESC$~' , '' , $nb , 1 , $Eb ); $mh [] = ( $Eb ? array ( $nb => " desc " ) : $nb );} $Lb [ " sort " ] = $mh ;} if ( $_ ){ $Lb [ " size " ] =+ $_ ; if ( $F ) $Lb [ " from " ] = ( $F * $_ );} foreach ( $Z
as $X ){ list ( $nb , $mf , $X ) = explode ( " " , $X , 3 ); if ( $nb == " _id " ) $Lb [ " query " ][ " ids " ][ " values " ][] = $X ; elseif ( $nb . $X != " " ){ $Sh = array ( " term " => array (( $nb != " " ? $nb : " _all " ) => $X )); if ( $mf == " = " ) $Lb [ " query " ][ " filtered " ][ " filter " ][ " and " ][] = $Sh ; else $Lb [ " query " ][ " filtered " ][ " query " ][ " bool " ][ " must " ][] = $Sh ;}} if ( $Lb [ " query " ] &&! $Lb [ " query " ][ " filtered " ][ " query " ] &&! $Lb [ " query " ][ " ids " ]) $Lb [ " query " ][ " filtered " ][ " query " ] = array ( " match_all " => array ()); $vh = microtime ( true ); $Vg = $this -> _conn -> query ( $H , $Lb ); if ( $fg ) echo $b -> selectQuery ( " $H : " . print_r ( $Lb , true ), $vh , ! $Vg ); if ( ! $Vg ) return
false ; $J = array (); foreach ( $Vg [ 'hits' ][ 'hits' ] as $xd ){ $K = array (); if ( $M == array ( " * " )) $K [ " _id " ] = $xd [ " _id " ]; $q = $xd [ '_source' ]; if ( $M != array ( " * " )){ $q = array (); foreach ( $M
as $z ) $q [ $z ] = $xd [ 'fields' ][ $z ];} foreach ( $q
as $z => $X ){ if ( $Lb [ " fields " ]) $X = $X [ 0 ]; $K [ $z ] = ( is_array ( $X ) ? json_encode ( $X ) : $X );} $J [] = $K ;} return
new
Min_Result ( $J );} function
update ( $U , $ug , $pg ){ $Pf = preg_split ( '~ *= *~' , $pg ); if ( count ( $Pf ) == 2 ){ $u = trim ( $Pf [ 1 ]); $H = " $U / $u " ; return $this -> _conn -> query ( $H , $ug , 'POST' );} return
false ;} function
insert ( $U , $ug ){ $u = " " ; $H = " $U / $u " ; $Fg = $this -> _conn -> query ( $H , $ug , 'POST' ); $this -> _conn -> last_id = $Fg [ '_id' ]; return $Fg [ 'created' ];} function
delete ( $U , $pg ){ $Ad = array (); if ( is_array ( $_GET [ " where " ]) && $_GET [ " where " ][ " _id " ]) $Ad [] = $_GET [ " where " ][ " _id " ]; if ( is_array ( $_POST [ 'check' ])){ foreach ( $_POST [ 'check' ] as $db ){ $Pf = preg_split ( '~ *= *~' , $db ); if ( count ( $Pf ) == 2 ) $Ad [] = trim ( $Pf [ 1 ]);}} $this -> _conn -> affected_rows = 0 ; foreach ( $Ad
as $u ){ $H = " { $U } / { $u } " ; $Fg = $this -> _conn -> query ( $H , '{}' , 'DELETE' ); if ( is_array ( $Fg ) && $Fg [ 'found' ] == true ) $this -> _conn -> affected_rows ++ ;} return $this -> _conn -> affected_rows ;}} function
connect (){ global $b ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])) return $g ; return $g -> error ;} function
support ( $Pc ){ return
preg_match ( " ~database|table|columns~ " , $Pc );} function
logged_user (){ global $b ; $j = $b -> credentials (); return $j [ 1 ];} function
get_databases (){ global $g ; $J = $g -> rootQuery ( '_aliases' ); if ( $J ){ $J = array_keys ( $J ); sort ( $J , SORT_STRING );} return $J ;} function
collations (){ return
array ();} function
db_collation ( $m , $qb ){} function
engines (){ return
array ();} function
count_tables ( $l ){ global $g ; $J = array (); $I = $g -> query ( '_stats' ); if ( $I && $I [ 'indices' ]){ $Hd = $I [ 'indices' ]; foreach ( $Hd
as $Gd => $wh ){ $Fd = $wh [ 'total' ][ 'indexing' ]; $J [ $Gd ] = $Fd [ 'index_total' ];}} return $J ;} function
tables_list (){ global $g ; $J = $g -> query ( '_mapping' ); if ( $J ) $J = array_fill_keys ( array_keys ( $J [ $g -> _db ][ " mappings " ]), 'table' ); return $J ;} function
table_status ( $D = " " , $Oc = false ){ global $g ; $Vg = $g -> query ( " _search " , array ( " size " => 0 , " aggregations " => array ( " count_by_type " => array ( " terms " => array ( " field " => " _type " )))), " POST " ); $J = array (); if ( $Vg ){ $T = $Vg [ " aggregations " ][ " count_by_type " ][ " buckets " ]; foreach ( $T
as $R ){ $J [ $R [ " key " ]] = array ( " Name " => $R [ " key " ], " Engine " => " table " , " Rows " => $R [ " doc_count " ],); if ( $D != " " && $D == $R [ " key " ]) return $J [ $D ];}} return $J ;} function
error (){ global $g ; return
h ( $g -> error );} function
information_schema (){} function
is_view ( $S ){} function
indexes ( $R , $h = null ){ return
array ( array ( " type " => " PRIMARY " , " columns " => array ( " _id " )),);} function
fields ( $R ){ global $g ; $I = $g -> query ( " $R /_mapping " ); $J = array (); if ( $I ){ $ve = $I [ $R ][ 'properties' ]; if ( ! $ve ) $ve = $I [ $g -> _db ][ 'mappings' ][ $R ][ 'properties' ]; if ( $ve ){ foreach ( $ve
as $D => $p ){ $J [ $D ] = array ( " field " => $D , " full_type " => $p [ " type " ], " type " => $p [ " type " ], " privileges " => array ( " insert " => 1 , " select " => 1 , " update " => 1 ),); if ( $p [ " properties " ]){ unset ( $J [ $D ][ " privileges " ][ " insert " ]); unset ( $J [ $D ][ " privileges " ][ " update " ]);}}}} return $J ;} function
foreign_keys ( $R ){ return
array ();} function
table ( $v ){ return $v ;} function
idf_escape ( $v ){ return $v ;} function
convert_field ( $p ){} function
unconvert_field ( $p , $J ){ return $J ;} function
fk_support ( $S ){} function
found_rows ( $S , $Z ){ return
null ;} function
create_database ( $m ){ global $g ; return $g -> rootQuery ( urlencode ( $m ), null , 'PUT' );} function
drop_databases ( $l ){ global $g ; return $g -> rootQuery ( urlencode ( implode ( ',' , $l )), array (), 'DELETE' );} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ global $g ; $lg = array (); foreach ( $q
as $Mc ){ $Rc = trim ( $Mc [ 1 ][ 0 ]); $Sc = trim ( $Mc [ 1 ][ 1 ] ? $Mc [ 1 ][ 1 ] : " text " ); $lg [ $Rc ] = array ( 'type' => $Sc );} if ( ! empty ( $lg )) $lg = array ( 'properties' => $lg ); return $g -> query ( " _mapping/ { $D } " , $lg , 'PUT' );} function
drop_tables ( $T ){ global $g ; $J = true ; foreach ( $T
as $R ) $J = $J && $g -> query ( urlencode ( $R ), array (), 'DELETE' ); return $J ;} function
last_id (){ global $g ; return $g -> last_id ;} $y = " elastic " ; $of = array ( " = " , " query " ); $jd = array (); $pd = array (); $mc = array ( array ( " json " )); $vi = array (); $_h = array (); foreach ( array ( lang ( 25 ) => array ( " long " => 3 , " integer " => 5 , " short " => 8 , " byte " => 10 , " double " => 20 , " float " => 66 , " half_float " => 12 , " scaled_float " => 21 ), lang ( 26 ) => array ( " date " => 10 ), lang ( 23 ) => array ( " string " => 65535 , " text " => 65535 ), lang ( 27 ) => array ( " binary " => 255 ),) as $z => $X ){ $vi += $X ; $_h [ $z ] = array_keys ( $X );}} $ec = array ( " server " => " MySQL " ) + $ec ; if ( ! defined ( " DRIVER " )){ $ag = array ( " MySQLi " , " MySQL " , " PDO_MySQL " ); define ( " DRIVER " , " server " ); if ( extension_loaded ( " mysqli " )){ class
2014-05-08 19:46:08 +02:00
Min_DB
extends
MySQLi { var $extension = " MySQLi " ; function
2017-06-25 00:56:50 +02:00
__construct (){ parent :: init ();} function
2018-04-01 23:34:54 +02:00
connect ( $O = " " , $V = " " , $G = " " , $k = null , $Wf = null , $lh = null ){ global $b ; mysqli_report ( MYSQLI_REPORT_OFF ); list ( $yd , $Wf ) = explode ( " : " , $O , 2 ); $uh = $b -> connectSsl (); if ( $uh ) $this -> ssl_set ( $uh [ 'key' ], $uh [ 'cert' ], $uh [ 'ca' ], '' , '' ); $J =@ $this -> real_connect (( $O != " " ? $yd : ini_get ( " mysqli.default_host " )),( $O . $V != " " ? $V : ini_get ( " mysqli.default_user " )),( $O . $V . $G != " " ? $G : ini_get ( " mysqli.default_pw " )), $k ,( is_numeric ( $Wf ) ? $Wf : ini_get ( " mysqli.default_port " )),( ! is_numeric ( $Wf ) ? $Wf : $lh ),( $uh ? 64 : 0 )); return $J ;} function
set_charset ( $cb ){ if ( parent :: set_charset ( $cb )) return
true ; parent :: set_charset ( 'utf8' ); return $this -> query ( " SET NAMES $cb " );} function
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! $I ) return
false ; $K = $I -> fetch_array (); return $K [ $p ];} function
quote ( $Q ){ return " ' " . $this -> escape_string ( $Q ) . " ' " ;}}} elseif ( extension_loaded ( " mysql " ) &&! ( ini_get ( " sql.safe_mode " ) && extension_loaded ( " pdo_mysql " ))){ class
2014-05-08 19:46:08 +02:00
Min_DB { var $extension = " MySQL " , $server_info , $affected_rows , $errno , $error , $_link , $_result ; function
2017-06-25 00:56:50 +02:00
connect ( $O , $V , $G ){ $this -> _link =@ mysql_connect (( $O != " " ? $O : ini_get ( " mysql.default_host " )),( " $O $V " != " " ? $V : ini_get ( " mysql.default_user " )),( " $O $V $G " != " " ? $G : ini_get ( " mysql.default_password " )), true , 131072 ); if ( $this -> _link ) $this -> server_info = mysql_get_server_info ( $this -> _link ); else $this -> error = mysql_error (); return ( bool ) $this -> _link ;} function
2018-04-01 23:34:54 +02:00
set_charset ( $cb ){ if ( function_exists ( 'mysql_set_charset' )){ if ( mysql_set_charset ( $cb , $this -> _link )) return
true ; mysql_set_charset ( 'utf8' , $this -> _link );} return $this -> query ( " SET NAMES $cb " );} function
quote ( $Q ){ return " ' " . mysql_real_escape_string ( $Q , $this -> _link ) . " ' " ;} function
select_db ( $k ){ return
mysql_select_db ( $k , $this -> _link );} function
query ( $H , $wi = false ){ $I =@ ( $wi ? mysql_unbuffered_query ( $H , $this -> _link ) : mysql_query ( $H , $this -> _link )); $this -> error = " " ; if ( ! $I ){ $this -> errno = mysql_errno ( $this -> _link ); $this -> error = mysql_error ( $this -> _link ); return
false ;} if ( $I === true ){ $this -> affected_rows = mysql_affected_rows ( $this -> _link ); $this -> info = mysql_info ( $this -> _link ); return
2014-05-08 19:46:08 +02:00
true ;} return
new
2018-04-01 23:34:54 +02:00
Min_Result ( $I );} function
multi_query ( $H ){ return $this -> _result = $this -> query ( $H );} function
2014-05-08 19:46:08 +02:00
store_result (){ return $this -> _result ;} function
next_result (){ return
false ;} function
2018-04-01 23:34:54 +02:00
result ( $H , $p = 0 ){ $I = $this -> query ( $H ); if ( ! $I ||! $I -> num_rows ) return
2014-05-08 19:46:08 +02:00
false ; return
2018-04-01 23:34:54 +02:00
mysql_result ( $I -> _result , 0 , $p );}} class
2014-05-08 19:46:08 +02:00
Min_Result { var $num_rows , $_result , $_offset = 0 ; function
2018-04-01 23:34:54 +02:00
__construct ( $I ){ $this -> _result = $I ; $this -> num_rows = mysql_num_rows ( $I );} function
2014-05-08 19:46:08 +02:00
fetch_assoc (){ return
mysql_fetch_assoc ( $this -> _result );} function
fetch_row (){ return
mysql_fetch_row ( $this -> _result );} function
2018-04-01 23:34:54 +02:00
fetch_field (){ $J = mysql_fetch_field ( $this -> _result , $this -> _offset ++ ); $J -> orgtable = $J -> table ; $J -> orgname = $J -> name ; $J -> charsetnr = ( $J -> blob ? 63 : 0 ); return $J ;} function
2014-05-08 19:46:08 +02:00
__destruct (){ mysql_free_result ( $this -> _result );}}} elseif ( extension_loaded ( " pdo_mysql " )){ class
Min_DB
extends
Min_PDO { var $extension = " PDO_MySQL " ; function
2018-04-01 23:34:54 +02:00
connect ( $O , $V , $G ){ global $b ; $rf = array (); $uh = $b -> connectSsl (); if ( $uh ) $rf = array ( PDO :: MYSQL_ATTR_SSL_KEY => $uh [ 'key' ], PDO :: MYSQL_ATTR_SSL_CERT => $uh [ 'cert' ], PDO :: MYSQL_ATTR_SSL_CA => $uh [ 'ca' ],); $this -> dsn ( " mysql:charset=utf8;host= " . str_replace ( " : " , " ;unix_socket= " , preg_replace ( '~:(\\d)~' , ';port=\\1' , $O )), $V , $G , $rf ); return
2014-05-08 19:46:08 +02:00
true ;} function
2018-04-01 23:34:54 +02:00
set_charset ( $cb ){ $this -> query ( " SET NAMES $cb " );} function
select_db ( $k ){ return $this -> query ( " USE " . idf_escape ( $k ));} function
query ( $H , $wi = false ){ $this -> setAttribute ( 1000 , ! $wi ); return
parent :: query ( $H , $wi );}}} class
2014-05-08 19:46:08 +02:00
Min_Driver
extends
Min_SQL { function
2018-04-01 23:34:54 +02:00
insert ( $R , $P ){ return ( $P ? parent :: insert ( $R , $P ) : queries ( " INSERT INTO " . table ( $R ) . " () \n VALUES () " ));} function
insertUpdate ( $R , $L , $dg ){ $e = array_keys ( reset ( $L )); $bg = " INSERT INTO " . table ( $R ) . " ( " . implode ( " , " , $e ) . " ) VALUES \n " ; $Ni = array (); foreach ( $e
as $z ) $Ni [ $z ] = " $z = VALUES( $z ) " ; $Ch = " \n ON DUPLICATE KEY UPDATE " . implode ( " , " , $Ni ); $Ni = array (); $pe = 0 ; foreach ( $L
as $P ){ $Y = " ( " . implode ( " , " , $P ) . " ) " ; if ( $Ni && ( strlen ( $bg ) + $pe + strlen ( $Y ) + strlen ( $Ch ) > 1e6 )){ if ( ! queries ( $bg . implode ( " , \n " , $Ni ) . $Ch )) return
false ; $Ni = array (); $pe = 0 ;} $Ni [] = $Y ; $pe += strlen ( $Y ) + 2 ;} return
queries ( $bg . implode ( " , \n " , $Ni ) . $Ch );} function
convertSearch ( $v , $X , $p ){ return ( preg_match ( '~char|text|enum|set~' , $p [ " type " ]) &&! preg_match ( " ~^utf8~ " , $p [ " collation " ]) ? " CONVERT( $v USING " . charset ( $this -> _conn ) . " ) " : $v );} function
warnings (){ $I = $this -> _conn -> query ( " SHOW WARNINGS " ); if ( $I && $I -> num_rows ){ ob_start (); select ( $I ); return
ob_get_clean ();}} function
tableHelp ( $D ){ $we = preg_match ( '~MariaDB~' , $this -> _conn -> server_info ); if ( information_schema ( DB )) return
strtolower (( $we ? " information-schema- $D -table/ " : str_replace ( " _ " , " - " , $D ) . " -table.html " )); if ( DB == " mysql " ) return ( $we ? " mysql $D -table/ " : " system-database.html " );}} function
idf_escape ( $v ){ return " ` " . str_replace ( " ` " , " `` " , $v ) . " ` " ;} function
table ( $v ){ return
idf_escape ( $v );} function
connect (){ global $b , $vi , $_h ; $g = new
Min_DB ; $j = $b -> credentials (); if ( $g -> connect ( $j [ 0 ], $j [ 1 ], $j [ 2 ])){ $g -> set_charset ( charset ( $g )); $g -> query ( " SET sql_quote_show_create = 1, autocommit = 1 " ); if ( min_version ( '5.7.8' , 10.2 , $g )){ $_h [ lang ( 23 )][] = " json " ; $vi [ " json " ] = 4294967295 ;} return $g ;} $J = $g -> error ; if ( function_exists ( 'iconv' ) &&! is_utf8 ( $J ) && strlen ( $Rg = iconv ( " windows-1250 " , " utf-8 " , $J )) > strlen ( $J )) $J = $Rg ; return $J ;} function
get_databases ( $ad ){ $J = get_session ( " dbs " ); if ( $J === null ){ $H = ( min_version ( 5 ) ? " SELECT SCHEMA_NAME FROM information_schema.SCHEMATA " : " SHOW DATABASES " ); $J = ( $ad ? slow_query ( $H ) : get_vals ( $H )); restart_session (); set_session ( " dbs " , $J ); stop_session ();} return $J ;} function
limit ( $H , $Z , $_ , $E = 0 , $N = " " ){ return " $H $Z " . ( $_ !== null ? $N . " LIMIT $_ " . ( $E ? " OFFSET $E " : " " ) : " " );} function
limit1 ( $R , $H , $Z , $N = " \n " ){ return
limit ( $H , $Z , 1 , 0 , $N );} function
db_collation ( $m , $qb ){ global $g ; $J = null ; $i = $g -> result ( " SHOW CREATE DATABASE " . idf_escape ( $m ), 1 ); if ( preg_match ( '~ COLLATE ([^ ]+)~' , $i , $C )) $J = $C [ 1 ]; elseif ( preg_match ( '~ CHARACTER SET ([^ ]+)~' , $i , $C )) $J = $qb [ $C [ 1 ]][ - 1 ]; return $J ;} function
engines (){ $J = array (); foreach ( get_rows ( " SHOW ENGINES " ) as $K ){ if ( preg_match ( " ~YES|DEFAULT~ " , $K [ " Support " ])) $J [] = $K [ " Engine " ];} return $J ;} function
2017-06-25 00:56:50 +02:00
logged_user (){ global $g ; return $g -> result ( " SELECT USER() " );} function
2018-04-01 23:34:54 +02:00
tables_list (){ return
get_key_vals ( min_version ( 5 ) ? " SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME " : " SHOW TABLES " );} function
count_tables ( $l ){ $J = array (); foreach ( $l
as $m ) $J [ $m ] = count ( get_vals ( " SHOW TABLES IN " . idf_escape ( $m ))); return $J ;} function
table_status ( $D = " " , $Oc = false ){ $J = array (); foreach ( get_rows ( $Oc && min_version ( 5 ) ? " SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ( $D != " " ? " AND TABLE_NAME = " . q ( $D ) : " ORDER BY Name " ) : " SHOW TABLE STATUS " . ( $D != " " ? " LIKE " . q ( addcslashes ( $D , " %_ \\ " )) : " " )) as $K ){ if ( $K [ " Engine " ] == " InnoDB " ) $K [ " Comment " ] = preg_replace ( '~(?:(.+); )?InnoDB free: .*~' , '\\1' , $K [ " Comment " ]); if ( ! isset ( $K [ " Engine " ])) $K [ " Comment " ] = " " ; if ( $D != " " ) return $K ; $J [ $K [ " Name " ]] = $K ;} return $J ;} function
is_view ( $S ){ return $S [ " Engine " ] === null ;} function
fk_support ( $S ){ return
preg_match ( '~InnoDB|IBMDB2I~i' , $S [ " Engine " ]) || ( preg_match ( '~NDB~i' , $S [ " Engine " ]) && min_version ( 5.6 ));} function
fields ( $R ){ $J = array (); foreach ( get_rows ( " SHOW FULL COLUMNS FROM " . table ( $R )) as $K ){ preg_match ( '~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~' , $K [ " Type " ], $C ); $J [ $K [ " Field " ]] = array ( " field " => $K [ " Field " ], " full_type " => $K [ " Type " ], " type " => $C [ 1 ], " length " => $C [ 2 ], " unsigned " => ltrim ( $C [ 3 ] . $C [ 4 ]), " default " => ( $K [ " Default " ] != " " || preg_match ( " ~char|set~ " , $C [ 1 ]) ? $K [ " Default " ] : null ), " null " => ( $K [ " Null " ] == " YES " ), " auto_increment " => ( $K [ " Extra " ] == " auto_increment " ), " on_update " => ( preg_match ( '~^on update (.+)~i' , $K [ " Extra " ], $C ) ? $C [ 1 ] : " " ), " collation " => $K [ " Collation " ], " privileges " => array_flip ( preg_split ( '~, *~' , $K [ " Privileges " ])), " comment " => $K [ " Comment " ], " primary " => ( $K [ " Key " ] == " PRI " ),);} return $J ;} function
indexes ( $R , $h = null ){ $J = array (); foreach ( get_rows ( " SHOW INDEX FROM " . table ( $R ), $h ) as $K ){ $D = $K [ " Key_name " ]; $J [ $D ][ " type " ] = ( $D == " PRIMARY " ? " PRIMARY " : ( $K [ " Index_type " ] == " FULLTEXT " ? " FULLTEXT " : ( $K [ " Non_unique " ] ? ( $K [ " Index_type " ] == " SPATIAL " ? " SPATIAL " : " INDEX " ) : " UNIQUE " ))); $J [ $D ][ " columns " ][] = $K [ " Column_name " ]; $J [ $D ][ " lengths " ][] = ( $K [ " Index_type " ] == " SPATIAL " ? null : $K [ " Sub_part " ]); $J [ $D ][ " descs " ][] = null ;} return $J ;} function
foreign_keys ( $R ){ global $g , $jf ; static $Tf = '`(?:[^`]|``)+`' ; $J = array (); $Fb = $g -> result ( " SHOW CREATE TABLE " . table ( $R ), 1 ); if ( $Fb ){ preg_match_all ( " ~CONSTRAINT ( $Tf ) FOREIGN KEY ? \\ (((?: $Tf ,? ?)+) \\ ) REFERENCES ( $Tf )(?: \\ .( $Tf ))? \\ (((?: $Tf ,? ?)+) \\ )(?: ON DELETE ( $jf ))?(?: ON UPDATE ( $jf ))?~ " , $Fb , $ze , PREG_SET_ORDER ); foreach ( $ze
as $C ){ preg_match_all ( " ~ $Tf ~ " , $C [ 2 ], $nh ); preg_match_all ( " ~ $Tf ~ " , $C [ 5 ], $Ph ); $J [ idf_unescape ( $C [ 1 ])] = array ( " db " => idf_unescape ( $C [ 4 ] != " " ? $C [ 3 ] : $C [ 4 ]), " table " => idf_unescape ( $C [ 4 ] != " " ? $C [ 4 ] : $C [ 3 ]), " source " => array_map ( 'idf_unescape' , $nh [ 0 ]), " target " => array_map ( 'idf_unescape' , $Ph [ 0 ]), " on_delete " => ( $C [ 6 ] ? $C [ 6 ] : " RESTRICT " ), " on_update " => ( $C [ 7 ] ? $C [ 7 ] : " RESTRICT " ),);}} return $J ;} function
view ( $D ){ global $g ; return
array ( " select " => preg_replace ( '~^(?:[^`]|`[^`]*`)*\\s+AS\\s+~isU' , '' , $g -> result ( " SHOW CREATE VIEW " . table ( $D ), 1 )));} function
collations (){ $J = array (); foreach ( get_rows ( " SHOW COLLATION " ) as $K ){ if ( $K [ " Default " ]) $J [ $K [ " Charset " ]][ - 1 ] = $K [ " Collation " ]; else $J [ $K [ " Charset " ]][] = $K [ " Collation " ];} ksort ( $J ); foreach ( $J
as $z => $X ) asort ( $J [ $z ]); return $J ;} function
information_schema ( $m ){ return ( min_version ( 5 ) && $m == " information_schema " ) || ( min_version ( 5.5 ) && $m == " performance_schema " );} function
2017-06-25 00:56:50 +02:00
error (){ global $g ; return
h ( preg_replace ( '~^You have an error.*syntax to use~U' , " Syntax error " , $g -> error ));} function
2018-04-01 23:34:54 +02:00
create_database ( $m , $pb ){ return
queries ( " CREATE DATABASE " . idf_escape ( $m ) . ( $pb ? " COLLATE " . q ( $pb ) : " " ));} function
drop_databases ( $l ){ $J = apply_queries ( " DROP DATABASE " , $l , 'idf_escape' ); restart_session (); set_session ( " dbs " , null ); return $J ;} function
rename_database ( $D , $pb ){ $J = false ; if ( create_database ( $D , $pb )){ $Dg = array (); foreach ( tables_list () as $R => $U ) $Dg [] = table ( $R ) . " TO " . idf_escape ( $D ) . " . " . table ( $R ); $J = ( ! $Dg || queries ( " RENAME TABLE " . implode ( " , " , $Dg ))); if ( $J ) queries ( " DROP DATABASE " . idf_escape ( DB )); restart_session (); set_session ( " dbs " , null );} return $J ;} function
auto_increment (){ $Na = " PRIMARY KEY " ; if ( $_GET [ " create " ] != " " && $_POST [ " auto_increment_col " ]){ foreach ( indexes ( $_GET [ " create " ]) as $w ){ if ( in_array ( $_POST [ " fields " ][ $_POST [ " auto_increment_col " ]][ " orig " ], $w [ " columns " ], true )){ $Na = " " ; break ;} if ( $w [ " type " ] == " PRIMARY " ) $Na = " UNIQUE " ;}} return " AUTO_INCREMENT $Na " ;} function
alter_table ( $R , $D , $q , $bd , $vb , $uc , $pb , $Ma , $Nf ){ $c = array (); foreach ( $q
as $p ) $c [] = ( $p [ 1 ] ? ( $R != " " ? ( $p [ 0 ] != " " ? " CHANGE " . idf_escape ( $p [ 0 ]) : " ADD " ) : " " ) . " " . implode ( $p [ 1 ]) . ( $R != " " ? $p [ 2 ] : " " ) : " DROP " . idf_escape ( $p [ 0 ])); $c = array_merge ( $c , $bd ); $xh = ( $vb !== null ? " COMMENT= " . q ( $vb ) : " " ) . ( $uc ? " ENGINE= " . q ( $uc ) : " " ) . ( $pb ? " COLLATE " . q ( $pb ) : " " ) . ( $Ma != " " ? " AUTO_INCREMENT= $Ma " : " " ); if ( $R == " " ) return
queries ( " CREATE TABLE " . table ( $D ) . " ( \n " . implode ( " , \n " , $c ) . " \n ) $xh $Nf " ); if ( $R != $D ) $c [] = " RENAME TO " . table ( $D ); if ( $xh ) $c [] = ltrim ( $xh ); return ( $c || $Nf ? queries ( " ALTER TABLE " . table ( $R ) . " \n " . implode ( " , \n " , $c ) . $Nf ) : true );} function
alter_indexes ( $R , $c ){ foreach ( $c
as $z => $X ) $c [ $z ] = ( $X [ 2 ] == " DROP " ? " \n DROP INDEX " . idf_escape ( $X [ 1 ]) : " \n ADD $X[0] " . ( $X [ 0 ] == " PRIMARY " ? " KEY " : " " ) . ( $X [ 1 ] != " " ? idf_escape ( $X [ 1 ]) . " " : " " ) . " ( " . implode ( " , " , $X [ 2 ]) . " ) " ); return
queries ( " ALTER TABLE " . table ( $R ) . implode ( " , " , $c ));} function
truncate_tables ( $T ){ return
apply_queries ( " TRUNCATE TABLE " , $T );} function
drop_views ( $Si ){ return
queries ( " DROP VIEW " . implode ( " , " , array_map ( 'table' , $Si )));} function
drop_tables ( $T ){ return
queries ( " DROP TABLE " . implode ( " , " , array_map ( 'table' , $T )));} function
move_tables ( $T , $Si , $Ph ){ $Dg = array (); foreach ( array_merge ( $T , $Si ) as $R ) $Dg [] = table ( $R ) . " TO " . idf_escape ( $Ph ) . " . " . table ( $R ); return
queries ( " RENAME TABLE " . implode ( " , " , $Dg ));} function
copy_tables ( $T , $Si , $Ph ){ queries ( " SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' " ); foreach ( $T
as $R ){ $D = ( $Ph == DB ? table ( " copy_ $R " ) : idf_escape ( $Ph ) . " . " . table ( $R )); if ( ! queries ( " \n DROP TABLE IF EXISTS $D " ) ||! queries ( " CREATE TABLE $D LIKE " . table ( $R )) ||! queries ( " INSERT INTO $D SELECT * FROM " . table ( $R ))) return
false ;} foreach ( $Si
as $R ){ $D = ( $Ph == DB ? table ( " copy_ $R " ) : idf_escape ( $Ph ) . " . " . table ( $R )); $Ri = view ( $R ); if ( ! queries ( " DROP VIEW IF EXISTS $D " ) ||! queries ( " CREATE VIEW $D AS $Ri[select] " )) return
2014-05-08 19:46:08 +02:00
false ;} return
true ;} function
2018-04-01 23:34:54 +02:00
trigger ( $D ){ if ( $D == " " ) return
array (); $L = get_rows ( " SHOW TRIGGERS WHERE `Trigger` = " . q ( $D )); return
reset ( $L );} function
triggers ( $R ){ $J = array (); foreach ( get_rows ( " SHOW TRIGGERS LIKE " . q ( addcslashes ( $R , " %_ \\ " ))) as $K ) $J [ $K [ " Trigger " ]] = array ( $K [ " Timing " ], $K [ " Event " ]); return $J ;} function
2014-05-08 19:46:08 +02:00
trigger_options (){ return
array ( " Timing " => array ( " BEFORE " , " AFTER " ), " Event " => array ( " INSERT " , " UPDATE " , " DELETE " ), " Type " => array ( " FOR EACH ROW " ),);} function
2018-04-01 23:34:54 +02:00
routine ( $D , $U ){ global $g , $wc , $Md , $vi ; $Da = array ( " bool " , " boolean " , " integer " , " double precision " , " real " , " dec " , " numeric " , " fixed " , " national char " , " national varchar " ); $oh = " (?: \\ s|/ \\ *[ \ s \ S]*? \\ */|(?:#|-- )[^ \n ]* \n ?|-- \r ? \n ) " ; $ui = " (( " . implode ( " | " , array_merge ( array_keys ( $vi ), $Da )) . " ) \\ b(?: \\ s* \\ (((?:[^' \" )]| $wc )++) \\ ))? \\ s*(zerofill \\ s*)?(unsigned(?: \\ s+zerofill)?)?)(?: \\ s*(?:CHARSET|CHARACTER \\ s+SET) \\ s*[' \" ]?([^' \" \\ s,]+)[' \" ]?)? " ; $Tf = " $oh *( " . ( $U == " FUNCTION " ? " " : $Md ) . " )? \\ s*(?:`((?:[^`]|``)*)` \\ s*| \\ b( \\ S+) \\ s+) $ui " ; $i = $g -> result ( " SHOW CREATE $U " . idf_escape ( $D ), 2 ); preg_match ( " ~ \\ (((?: $Tf\\s *,?)*) \\ ) \\ s* " . ( $U == " FUNCTION " ? " RETURNS \\ s+ $ui\\s + " : " " ) . " (.*)~is " , $i , $C ); $q = array (); preg_match_all ( " ~ $Tf\\s *,?~is " , $C [ 1 ], $ze , PREG_SET_ORDER ); foreach ( $ze
as $Gf ){ $D = str_replace ( " `` " , " ` " , $Gf [ 2 ]) . $Gf [ 3 ]; $q [] = array ( " field " => $D , " type " => strtolower ( $Gf [ 5 ]), " length " => preg_replace_callback ( " ~ $wc ~s " , 'normalize_enum' , $Gf [ 6 ]), " unsigned " => strtolower ( preg_replace ( '~\\s+~' , ' ' , trim ( " $Gf[8] $Gf[7] " ))), " null " => 1 , " full_type " => $Gf [ 4 ], " inout " => strtoupper ( $Gf [ 1 ]), " collation " => strtolower ( $Gf [ 9 ]),);} if ( $U != " FUNCTION " ) return
array ( " fields " => $q , " definition " => $C [ 11 ]); return
array ( " fields " => $q , " returns " => array ( " type " => $C [ 12 ], " length " => $C [ 13 ], " unsigned " => $C [ 15 ], " collation " => $C [ 16 ]), " definition " => $C [ 17 ], " language " => " SQL " ,);} function
2014-05-08 19:46:08 +02:00
routines (){ return
2018-04-01 23:34:54 +02:00
get_rows ( " SELECT ROUTINE_NAME AS SPECIFIC_NAME, ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q ( DB ));} function
2014-05-08 19:46:08 +02:00
routine_languages (){ return
array ();} function
2018-04-01 23:34:54 +02:00
routine_id ( $D , $K ){ return
idf_escape ( $D );} function
2017-06-25 00:56:50 +02:00
last_id (){ global $g ; return $g -> result ( " SELECT LAST_INSERT_ID() " );} function
2018-04-01 23:34:54 +02:00
explain ( $g , $H ){ return $g -> query ( " EXPLAIN " . ( min_version ( 5.1 ) ? " PARTITIONS " : " " ) . $H );} function
found_rows ( $S , $Z ){ return ( $Z || $S [ " Engine " ] != " InnoDB " ? null : $S [ " Rows " ]);} function
2014-05-08 19:46:08 +02:00
types (){ return
array ();} function
schemas (){ return
array ();} function
get_schema (){ return " " ;} function
2018-04-01 23:34:54 +02:00
set_schema ( $Tg ){ return
2014-05-08 19:46:08 +02:00
true ;} function
2018-04-01 23:34:54 +02:00
create_sql ( $R , $Ma , $Ah ){ global $g ; $J = $g -> result ( " SHOW CREATE TABLE " . table ( $R ), 1 ); if ( ! $Ma ) $J = preg_replace ( '~ AUTO_INCREMENT=\\d+~' , '' , $J ); return $J ;} function
truncate_sql ( $R ){ return " TRUNCATE " . table ( $R );} function
use_sql ( $k ){ return " USE " . idf_escape ( $k );} function
trigger_sql ( $R ){ $J = " " ; foreach ( get_rows ( " SHOW TRIGGERS LIKE " . q ( addcslashes ( $R , " %_ \\ " )), null , " -- " ) as $K ) $J .= " \n CREATE TRIGGER " . idf_escape ( $K [ " Trigger " ]) . " $K[Timing] $K[Event] ON " . table ( $K [ " Table " ]) . " FOR EACH ROW \n $K[Statement] ;; \n " ; return $J ;} function
2014-05-08 19:46:08 +02:00
show_variables (){ return
get_key_vals ( " SHOW VARIABLES " );} function
process_list (){ return
get_rows ( " SHOW FULL PROCESSLIST " );} function
show_status (){ return
get_key_vals ( " SHOW STATUS " );} function
2018-04-01 23:34:54 +02:00
convert_field ( $p ){ if ( preg_match ( " ~binary~ " , $p [ " type " ])) return " HEX( " . idf_escape ( $p [ " field " ]) . " ) " ; if ( $p [ " type " ] == " bit " ) return " BIN( " . idf_escape ( $p [ " field " ]) . " + 0) " ; if ( preg_match ( " ~geometry|point|linestring|polygon~ " , $p [ " type " ])) return ( min_version ( 8 ) ? " ST_ " : " " ) . " AsWKT( " . idf_escape ( $p [ " field " ]) . " ) " ;} function
unconvert_field ( $p , $J ){ if ( preg_match ( " ~binary~ " , $p [ " type " ])) $J = " UNHEX( $J ) " ; if ( $p [ " type " ] == " bit " ) $J = " CONV( $J , 2, 10) + 0 " ; if ( preg_match ( " ~geometry|point|linestring|polygon~ " , $p [ " type " ])) $J = ( min_version ( 8 ) ? " ST_ " : " " ) . " GeomFromText( $J ) " ; return $J ;} function
support ( $Pc ){ return ! preg_match ( " ~scheme|sequence|type|view_trigger|materializedview " . ( min_version ( 5.1 ) ? " " : " |event|partitioning " . ( min_version ( 5 ) ? " " : " |routine|trigger|view " )) . " ~ " , $Pc );} function
2017-06-25 00:56:50 +02:00
kill_process ( $X ){ return
queries ( " KILL " . number ( $X ));} function
connection_id (){ return " SELECT CONNECTION_ID() " ;} function
2018-04-01 23:34:54 +02:00
max_connections (){ global $g ; return $g -> result ( " SELECT @@max_connections " );} $y = " sql " ; $vi = array (); $_h = array (); foreach ( array ( lang ( 25 ) => array ( " tinyint " => 3 , " smallint " => 5 , " mediumint " => 8 , " int " => 10 , " bigint " => 20 , " decimal " => 66 , " float " => 12 , " double " => 21 ), lang ( 26 ) => array ( " date " => 10 , " datetime " => 19 , " timestamp " => 19 , " time " => 10 , " year " => 4 ), lang ( 23 ) => array ( " char " => 255 , " varchar " => 65535 , " tinytext " => 255 , " text " => 65535 , " mediumtext " => 16777215 , " longtext " => 4294967295 ), lang ( 30 ) => array ( " enum " => 65535 , " set " => 64 ), lang ( 27 ) => array ( " bit " => 20 , " binary " => 255 , " varbinary " => 65535 , " tinyblob " => 255 , " blob " => 65535 , " mediumblob " => 16777215 , " longblob " => 4294967295 ), lang ( 29 ) => array ( " geometry " => 0 , " point " => 0 , " linestring " => 0 , " polygon " => 0 , " multipoint " => 0 , " multilinestring " => 0 , " multipolygon " => 0 , " geometrycollection " => 0 ),) as $z => $X ){ $vi += $X ; $_h [ $z ] = array_keys ( $X );} $Bi = array ( " unsigned " , " zerofill " , " unsigned zerofill " ); $of = array ( " = " , " < " , " > " , " <= " , " >= " , " != " , " LIKE " , " LIKE %% " , " REGEXP " , " IN " , " FIND_IN_SET " , " IS NULL " , " NOT LIKE " , " NOT REGEXP " , " NOT IN " , " IS NOT NULL " , " SQL " ); $jd = array ( " char_length " , " date " , " from_unixtime " , " lower " , " round " , " floor " , " ceil " , " sec_to_time " , " time_to_sec " , " upper " ); $pd = array ( " avg " , " count " , " count distinct " , " group_concat " , " max " , " min " , " sum " ); $mc = array ( array ( " char " => " md5/sha1/password/encrypt/uuid " , " binary " => " md5/sha1 " , " date|time " => " now " ,), array ( number_type () => " +/- " , " date " => " + interval/- interval " , " time " => " addtime/subtime " , " char|text " => " concat " ,));} define ( " SERVER " , $_GET [ DRIVER ]); define ( " DB " , $_GET [ " db " ]); define ( " ME " , preg_replace ( '~^[^?]*/([^?]*).*~' , '\\1' , $_SERVER [ " REQUEST_URI " ]) . '?' . ( sid () ? SID . '&' : '' ) . ( SERVER !== null ? DRIVER . " = " . urlencode ( SERVER ) . '&' : '' ) . ( isset ( $_GET [ " username " ]) ? " username= " . urlencode ( $_GET [ " username " ]) . '&' : '' ) . ( DB != " " ? 'db=' . urlencode ( DB ) . '&' . ( isset ( $_GET [ " ns " ]) ? " ns= " . urlencode ( $_GET [ " ns " ]) . " & " : " " ) : '' )); $ia = " 4.6.2 " ; class
2014-05-08 19:46:08 +02:00
Adminer { var $operators ; function
2018-04-01 23:34:54 +02:00
name (){ return " <a href='https://www.adminer.org/' " . target_blank () . " id='h1'>Adminer</a> " ;} function
2014-05-08 19:46:08 +02:00
credentials (){ return
array ( SERVER , $_GET [ " username " ], get_password ());} function
2018-04-01 23:34:54 +02:00
connectSsl (){} function
2017-06-25 00:56:50 +02:00
permanentLogin ( $i = false ){ return
password_file ( $i );} function
2014-05-08 19:46:08 +02:00
bruteForceKey (){ return $_SERVER [ " REMOTE_ADDR " ];} function
2018-04-01 23:34:54 +02:00
serverName ( $O ){ return
h ( $O );} function
2014-05-08 19:46:08 +02:00
database (){ return
DB ;} function
2018-04-01 23:34:54 +02:00
databases ( $ad = true ){ return
get_databases ( $ad );} function
2014-05-08 19:46:08 +02:00
schemas (){ return
schemas ();} function
queryTimeout (){ return
5 ;} function
2018-04-01 23:34:54 +02:00
headers (){} function
csp (){ return
csp ();} function
2014-05-08 19:46:08 +02:00
head (){ return
true ;} function
2018-04-01 23:34:54 +02:00
css (){ $J = array (); $Uc = " adminer.css " ; if ( file_exists ( $Uc )) $J [] = $Uc ; return $J ;} function
loginForm (){ global $ec ; echo ' < table cellspacing = " 0 " >
< tr >< th > ',lang(31),' < td > ',html_select("auth[driver]",$ec,DRIVER)."\n",' < tr >< th > ',lang(32),' < td >< input name = " auth[server] " value = " ',h(SERVER),' " title = " hostname[:port] " placeholder = " localhost " autocapitalize = " off " >
< tr >< th > ',lang(33),' < td >< input name = " auth[username] " id = " username " value = " ',h( $_GET["username"] ),' " autocapitalize = " off " >
< tr >< th > ',lang(34),' < td >< input type = " password " name = " auth[password] " >
< tr >< th > ',lang(35),' < td >< input name = " auth[db] " value = " ',h( $_GET["db"] ),' " autocapitalize = " off " >
2014-05-08 19:46:08 +02:00
</ table >
2018-04-01 23:34:54 +02:00
',script("focus(qs(' #username'));"),"<p><input type='submit' value='".lang(36)."'>\n",checkbox("auth[permanent]",1,$_COOKIE["adminer_permanent"],lang(37))."\n";}function
login ( $te , $G ){ global $y ; if ( $y == " sqlite " ) return
lang ( 38 , target_blank (), '<code>login()</code>' ); return
true ;} function
tableName ( $Gh ){ return
h ( $Gh [ " Name " ]);} function
fieldName ( $p , $tf = 0 ){ return '<span title="' . h ( $p [ " full_type " ]) . '">' . h ( $p [ " field " ]) . '</span>' ;} function
selectLinks ( $Gh , $P = " " ){ global $y , $n ; echo '<p class="links">' ; $se = array ( " select " => lang ( 39 )); if ( support ( " table " ) || support ( " indexes " )) $se [ " table " ] = lang ( 40 ); if ( support ( " table " )){ if ( is_view ( $Gh )) $se [ " view " ] = lang ( 41 ); else $se [ " create " ] = lang ( 42 );} if ( $P !== null ) $se [ " edit " ] = lang ( 43 ); $D = $Gh [ " Name " ]; foreach ( $se
as $z => $X ) echo " <a href=' " . h ( ME ) . " $z = " . urlencode ( $D ) . ( $z == " edit " ? $P : " " ) . " ' " . bold ( isset ( $_GET [ $z ])) . " > $X </a> " ; echo
doc_link ( array ( $y => $n -> tableHelp ( $D )), " ? " ), " \n " ;} function
foreignKeys ( $R ){ return
foreign_keys ( $R );} function
backwardKeys ( $R , $Fh ){ return
array ();} function
backwardKeysPrint ( $Pa , $K ){} function
selectQuery ( $H , $vh , $Nc = false ){ global $y , $n ; $J = " </p> \n " ; if ( ! $Nc && ( $Vi = $n -> warnings ())){ $u = " warnings " ; $J = " , <a href='# $u '> " . lang ( 44 ) . " </a> " . script ( " qsl('a').onclick = partial(toggle, ' $u '); " , " " ) . " $J <div id=' $u ' class='hidden'> \n $Vi </div> \n " ;} return " <p><code class='jush- $y '> " . h ( str_replace ( " \n " , " " , $H )) . " </code> <span class='time'>( " . format_time ( $vh ) . " )</span> " . ( support ( " sql " ) ? " <a href=' " . h ( ME ) . " sql= " . urlencode ( $H ) . " '> " . lang ( 10 ) . " </a> " : " " ) . $J ;} function
sqlCommandQuery ( $H ){ return
shorten_utf8 ( trim ( $H ), 1000 );} function
rowDescription ( $R ){ return " " ;} function
rowDescriptions ( $L , $cd ){ return $L ;} function
selectLink ( $X , $p ){} function
selectVal ( $X , $A , $p , $Af ){ $J = ( $X === null ? " <i>NULL</i> " : ( preg_match ( " ~char|binary|boolean~ " , $p [ " type " ]) &&! preg_match ( " ~var~ " , $p [ " type " ]) ? " <code> $X </code> " : $X )); if ( preg_match ( '~blob|bytea|raw|file~' , $p [ " type " ]) &&! is_utf8 ( $X )) $J = " <i> " . lang ( 45 , strlen ( $Af )) . " </i> " ; if ( preg_match ( '~json~' , $p [ " type " ])) $J = " <code class='jush-js'> $J </code> " ; return ( $A ? " <a href=' " . h ( $A ) . " ' " . ( is_url ( $A ) ? target_blank () : " " ) . " > $J </a> " : $J );} function
editVal ( $X , $p ){ return $X ;} function
tableStructurePrint ( $q ){ echo " <table cellspacing='0' class='nowrap'> \n " , " <thead><tr><th> " . lang ( 46 ) . " <td> " . lang ( 47 ) . ( support ( " comment " ) ? " <td> " . lang ( 48 ) : " " ) . " </thead> \n " ; foreach ( $q
as $p ){ echo " <tr " . odd () . " ><th> " . h ( $p [ " field " ]), " <td><span title=' " . h ( $p [ " collation " ]) . " '> " . h ( $p [ " full_type " ]) . " </span> " ,( $p [ " null " ] ? " <i>NULL</i> " : " " ),( $p [ " auto_increment " ] ? " <i> " . lang ( 49 ) . " </i> " : " " ),( isset ( $p [ " default " ]) ? " <span title=' " . lang ( 50 ) . " '>[<b> " . h ( $p [ " default " ]) . " </b>]</span> " : " " ),( support ( " comment " ) ? " <td> " . nbsp ( $p [ " comment " ]) : " " ), " \n " ;} echo " </table> \n " ;} function
2017-06-25 00:56:50 +02:00
tableIndexesPrint ( $x ){ echo " <table cellspacing='0'> \n " ; foreach ( $x
2018-04-01 23:34:54 +02:00
as $D => $w ){ ksort ( $w [ " columns " ]); $fg = array (); foreach ( $w [ " columns " ] as $z => $X ) $fg [] = " <i> " . h ( $X ) . " </i> " . ( $w [ " lengths " ][ $z ] ? " ( " . $w [ " lengths " ][ $z ] . " ) " : " " ) . ( $w [ " descs " ][ $z ] ? " DESC " : " " ); echo " <tr title=' " . h ( $D ) . " '><th> $w[type] <td> " . implode ( " , " , $fg ) . " \n " ;} echo " </table> \n " ;} function
selectColumnsPrint ( $M , $e ){ global $jd , $pd ; print_fieldset ( " select " , lang ( 51 ), $M ); $t = 0 ; $M [ " " ] = array (); foreach ( $M
as $z => $X ){ $X = $_GET [ " columns " ][ $z ]; $d = select_input ( " name='columns[ $t ][col]' " , $e , $X [ " col " ],( $z !== " " ? " selectFieldChange " : " selectAddRow " )); echo " <div> " . ( $jd || $pd ? " <select name='columns[ $t ][fun]'> " . optionlist ( array ( - 1 => " " ) + array_filter ( array ( lang ( 52 ) => $jd , lang ( 53 ) => $pd )), $X [ " fun " ]) . " </select> " . on_help ( " getTarget(event).value && getTarget(event).value.replace(/ | \$ /, '(') + ')' " , 1 ) . script ( " qsl('select').onchange = function () { helpClose(); " . ( $z !== " " ? " " : " qsl('select, input', this.parentNode).onchange(); " ) . " }; " , " " ) . " ( $d ) " : $d ) . " </div> \n " ; $t ++ ;} echo " </div></fieldset> \n " ;} function
selectSearchPrint ( $Z , $e , $x ){ print_fieldset ( " search " , lang ( 54 ), $Z ); foreach ( $x
as $t => $w ){ if ( $w [ " type " ] == " FULLTEXT " ){ echo " <div>(<i> " . implode ( " </i>, <i> " , array_map ( 'h' , $w [ " columns " ])) . " </i>) AGAINST " , " <input type='search' name='fulltext[ $t ]' value=' " . h ( $_GET [ " fulltext " ][ $t ]) . " '> " , script ( " qsl('input').oninput = selectFieldChange; " , " " ), checkbox ( " boolean[ $t ] " , 1 , isset ( $_GET [ " boolean " ][ $t ]), " BOOL " ), " </div> \n " ;}} $bb = " this.parentNode.firstChild.onchange(); " ; foreach ( array_merge (( array ) $_GET [ " where " ], array ( array ())) as $t => $X ){ if ( ! $X || ( " $X[col] $X[val] " != " " && in_array ( $X [ " op " ], $this -> operators ))){ echo " <div> " . select_input ( " name='where[ $t ][col]' " , $e , $X [ " col " ],( $X ? " selectFieldChange " : " selectAddRow " ), " ( " . lang ( 55 ) . " ) " ), html_select ( " where[ $t ][op] " , $this -> operators , $X [ " op " ], $bb ), " <input type='search' name='where[ $t ][val]' value=' " . h ( $X [ " val " ]) . " '> " , script ( " mixin(qsl('input'), { oninput: function () { $bb }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch}); " , " " ), " </div> \n " ;}} echo " </div></fieldset> \n " ;} function
selectOrderPrint ( $tf , $e , $x ){ print_fieldset ( " sort " , lang ( 56 ), $tf ); $t = 0 ; foreach (( array ) $_GET [ " order " ] as $z => $X ){ if ( $X != " " ){ echo " <div> " . select_input ( " name='order[ $t ]' " , $e , $X , " selectFieldChange " ), checkbox ( " desc[ $t ] " , 1 , isset ( $_GET [ " desc " ][ $z ]), lang ( 57 )) . " </div> \n " ; $t ++ ;}} echo " <div> " . select_input ( " name='order[ $t ]' " , $e , " " , " selectAddRow " ), checkbox ( " desc[ $t ] " , 1 , false , lang ( 57 )) . " </div> \n " , " </div></fieldset> \n " ;} function
selectLimitPrint ( $_ ){ echo " <fieldset><legend> " . lang ( 58 ) . " </legend><div> " ; echo " <input type='number' name='limit' class='size' value=' " . h ( $_ ) . " '> " , script ( " qsl('input').oninput = selectFieldChange; " , " " ), " </div></fieldset> \n " ;} function
selectLengthPrint ( $Vh ){ if ( $Vh !== null ){ echo " <fieldset><legend> " . lang ( 59 ) . " </legend><div> " , " <input type='number' name='text_length' class='size' value=' " . h ( $Vh ) . " '> " , " </div></fieldset> \n " ;}} function
selectActionPrint ( $x ){ echo " <fieldset><legend> " . lang ( 60 ) . " </legend><div> " , " <input type='submit' value=' " . lang ( 51 ) . " '> " , " <span id='noindex' title=' " . lang ( 61 ) . " '></span> " , " <script " . nonce () . " > \n " , " var indexColumns = " ; $e = array (); foreach ( $x
as $w ){ $Kb = reset ( $w [ " columns " ]); if ( $w [ " type " ] != " FULLTEXT " && $Kb ) $e [ $Kb ] = 1 ;} $e [ " " ] = 1 ; foreach ( $e
as $z => $X ) json_row ( $z ); echo " ; \n " , " selectFieldChange.call(qs('#form')['select']); \n " , " </script> \n " , " </div></fieldset> \n " ;} function
2014-05-08 19:46:08 +02:00
selectCommandPrint (){ return ! information_schema ( DB );} function
selectImportPrint (){ return ! information_schema ( DB );} function
2018-04-01 23:34:54 +02:00
selectEmailPrint ( $rc , $e ){} function
selectColumnsProcess ( $e , $x ){ global $jd , $pd ; $M = array (); $md = array (); foreach (( array ) $_GET [ " columns " ] as $z => $X ){ if ( $X [ " fun " ] == " count " || ( $X [ " col " ] != " " && ( ! $X [ " fun " ] || in_array ( $X [ " fun " ], $jd ) || in_array ( $X [ " fun " ], $pd )))){ $M [ $z ] = apply_sql_function ( $X [ " fun " ],( $X [ " col " ] != " " ? idf_escape ( $X [ " col " ]) : " * " )); if ( ! in_array ( $X [ " fun " ], $pd )) $md [] = $M [ $z ];}} return
array ( $M , $md );} function
selectSearchProcess ( $q , $x ){ global $g , $n ; $J = array (); foreach ( $x
as $t => $w ){ if ( $w [ " type " ] == " FULLTEXT " && $_GET [ " fulltext " ][ $t ] != " " ) $J [] = " MATCH ( " . implode ( " , " , array_map ( 'idf_escape' , $w [ " columns " ])) . " ) AGAINST ( " . q ( $_GET [ " fulltext " ][ $t ]) . ( isset ( $_GET [ " boolean " ][ $t ]) ? " IN BOOLEAN MODE " : " " ) . " ) " ;} foreach (( array ) $_GET [ " where " ] as $z => $X ){ if ( " $X[col] $X[val] " != " " && in_array ( $X [ " op " ], $this -> operators )){ $bg = " " ; $xb = " $X[op] " ; if ( preg_match ( '~IN$~' , $X [ " op " ])){ $Cd = process_length ( $X [ " val " ]); $xb .= " " . ( $Cd != " " ? $Cd : " (NULL) " );} elseif ( $X [ " op " ] == " SQL " ) $xb = " $X[val] " ; elseif ( $X [ " op " ] == " LIKE %% " ) $xb = " LIKE " . $this -> processInput ( $q [ $X [ " col " ]], " % $X[val] % " ); elseif ( $X [ " op " ] == " ILIKE %% " ) $xb = " ILIKE " . $this -> processInput ( $q [ $X [ " col " ]], " % $X[val] % " ); elseif ( $X [ " op " ] == " FIND_IN_SET " ){ $bg = " $X[op] ( " . q ( $X [ " val " ]) . " , " ; $xb = " ) " ;} elseif ( ! preg_match ( '~NULL$~' , $X [ " op " ])) $xb .= " " . $this -> processInput ( $q [ $X [ " col " ]], $X [ " val " ]); if ( $X [ " col " ] != " " ) $J [] = $bg . $n -> convertSearch ( idf_escape ( $X [ " col " ]), $X , $q [ $X [ " col " ]]) . $xb ; else { $sb = array (); foreach ( $q
as $D => $p ){ if (( is_numeric ( $X [ " val " ]) ||! preg_match ( '~' . number_type () . '|bit~' , $p [ " type " ])) && ( ! preg_match ( " ~[ \x80 - \xFF ]~ " , $X [ " val " ]) || preg_match ( '~char|text|enum|set~' , $p [ " type " ]))) $sb [] = $bg . $n -> convertSearch ( idf_escape ( $D ), $X , $p ) . $xb ;} $J [] = ( $sb ? " ( " . implode ( " OR " , $sb ) . " ) " : " 1 = 0 " );}}} return $J ;} function
selectOrderProcess ( $q , $x ){ $J = array (); foreach (( array ) $_GET [ " order " ] as $z => $X ){ if ( $X != " " ) $J [] = ( preg_match ( '~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\\)|COUNT\\(\\*\\))$~' , $X ) ? $X : idf_escape ( $X )) . ( isset ( $_GET [ " desc " ][ $z ]) ? " DESC " : " " );} return $J ;} function
2014-05-08 19:46:08 +02:00
selectLimitProcess (){ return ( isset ( $_GET [ " limit " ]) ? $_GET [ " limit " ] : " 50 " );} function
selectLengthProcess (){ return ( isset ( $_GET [ " text_length " ]) ? $_GET [ " text_length " ] : " 100 " );} function
2018-04-01 23:34:54 +02:00
selectEmailProcess ( $Z , $cd ){ return
2014-05-08 19:46:08 +02:00
false ;} function
2018-04-01 23:34:54 +02:00
selectQueryBuild ( $M , $Z , $md , $tf , $_ , $F ){ return " " ;} function
messageQuery ( $H , $Wh , $Nc = false ){ global $y , $n ; restart_session (); $vd =& get_session ( " queries " ); if ( ! $vd [ $_GET [ " db " ]]) $vd [ $_GET [ " db " ]] = array (); if ( strlen ( $H ) > 1e6 ) $H = preg_replace ( '~[\x80-\xFF]+$~' , '' , substr ( $H , 0 , 1e6 )) . " \n ... " ; $vd [ $_GET [ " db " ]][] = array ( $H , time (), $Wh ); $sh = " sql- " . count ( $vd [ $_GET [ " db " ]]); $J = " <a href='# $sh ' class='toggle'> " . lang ( 62 ) . " </a> \n " ; if ( ! $Nc && ( $Vi = $n -> warnings ())){ $u = " warnings- " . count ( $vd [ $_GET [ " db " ]]); $J = " <a href='# $u ' class='toggle'> " . lang ( 44 ) . " </a>, $J <div id=' $u ' class='hidden'> \n $Vi </div> \n " ;} return " <span class='time'> " .@ date ( " H:i:s " ) . " </span> " . " $J <div id=' $sh ' class='hidden'><pre><code class='jush- $y '> " . shorten_utf8 ( $H , 1000 ) . " </code></pre> " . ( $Wh ? " <span class='time'>( $Wh )</span> " : '' ) . ( support ( " sql " ) ? '<p><a href="' . h ( str_replace ( " db= " . urlencode ( DB ), " db= " . urlencode ( $_GET [ " db " ]), ME ) . 'sql=&history=' . ( count ( $vd [ $_GET [ " db " ]]) - 1 )) . '">' . lang ( 10 ) . '</a>' : '' ) . '</div>' ;} function
editFunctions ( $p ){ global $mc ; $J = ( $p [ " null " ] ? " NULL/ " : " " ); foreach ( $mc
as $z => $jd ){ if ( ! $z || ( ! isset ( $_GET [ " call " ]) && ( isset ( $_GET [ " select " ]) || where ( $_GET )))){ foreach ( $jd
as $Tf => $X ){ if ( ! $Tf || preg_match ( " ~ $Tf ~ " , $p [ " type " ])) $J .= " / $X " ;} if ( $z &&! preg_match ( '~set|blob|bytea|raw|file~' , $p [ " type " ])) $J .= " /SQL " ;}} if ( $p [ " auto_increment " ] &&! isset ( $_GET [ " select " ]) &&! where ( $_GET )) $J = lang ( 49 ); return
explode ( " / " , $J );} function
editInput ( $R , $p , $Ka , $Y ){ if ( $p [ " type " ] == " enum " ) return ( isset ( $_GET [ " select " ]) ? " <label><input type='radio' $Ka value='-1' checked><i> " . lang ( 8 ) . " </i></label> " : " " ) . ( $p [ " null " ] ? " <label><input type='radio' $Ka value='' " . ( $Y !== null || isset ( $_GET [ " select " ]) ? " " : " checked " ) . " ><i>NULL</i></label> " : " " ) . enum_input ( " radio " , $Ka , $p , $Y , 0 ); return " " ;} function
editHint ( $R , $p , $Y ){ return " " ;} function
processInput ( $p , $Y , $s = " " ){ if ( $s == " SQL " ) return $Y ; $D = $p [ " field " ]; $J = q ( $Y ); if ( preg_match ( '~^(now|getdate|uuid)$~' , $s )) $J = " $s () " ; elseif ( preg_match ( '~^current_(date|timestamp)$~' , $s )) $J = $s ; elseif ( preg_match ( '~^([+-]|\\|\\|)$~' , $s )) $J = idf_escape ( $D ) . " $s $J " ; elseif ( preg_match ( '~^[+-] interval$~' , $s )) $J = idf_escape ( $D ) . " $s " . ( preg_match ( " ~^( \\ d+|'[0-9.: -]') [A-Z_]+ \$ ~i " , $Y ) ? $Y : $J ); elseif ( preg_match ( '~^(addtime|subtime|concat)$~' , $s )) $J = " $s ( " . idf_escape ( $D ) . " , $J ) " ; elseif ( preg_match ( '~^(md5|sha1|password|encrypt)$~' , $s )) $J = " $s ( $J ) " ; return
unconvert_field ( $p , $J );} function
dumpOutput (){ $J = array ( 'text' => lang ( 63 ), 'file' => lang ( 64 )); if ( function_exists ( 'gzencode' )) $J [ 'gz' ] = 'gzip' ; return $J ;} function
2014-05-08 19:46:08 +02:00
dumpFormat (){ return
array ( 'sql' => 'SQL' , 'csv' => 'CSV,' , 'csv;' => 'CSV;' , 'tsv' => 'TSV' );} function
2018-04-01 23:34:54 +02:00
dumpDatabase ( $m ){} function
dumpTable ( $R , $Ah , $Vd = 0 ){ if ( $_POST [ " format " ] != " sql " ){ echo " \xef \xbb \xbf " ; if ( $Ah ) dump_csv ( array_keys ( fields ( $R )));} else { if ( $Vd == 2 ){ $q = array (); foreach ( fields ( $R ) as $D => $p ) $q [] = idf_escape ( $D ) . " $p[full_type] " ; $i = " CREATE TABLE " . table ( $R ) . " ( " . implode ( " , " , $q ) . " ) " ;} else $i = create_sql ( $R , $_POST [ " auto_increment " ], $Ah ); set_utf8mb4 ( $i ); if ( $Ah && $i ){ if ( $Ah == " DROP+CREATE " || $Vd == 1 ) echo " DROP " . ( $Vd == 2 ? " VIEW " : " TABLE " ) . " IF EXISTS " . table ( $R ) . " ; \n " ; if ( $Vd == 1 ) $i = remove_definer ( $i ); echo " $i ; \n \n " ;}}} function
dumpData ( $R , $Ah , $H ){ global $g , $y ; $Ae = ( $y == " sqlite " ? 0 : 1048576 ); if ( $Ah ){ if ( $_POST [ " format " ] == " sql " ){ if ( $Ah == " TRUNCATE+INSERT " ) echo
truncate_sql ( $R ) . " ; \n " ; $q = fields ( $R );} $I = $g -> query ( $H , 1 ); if ( $I ){ $Od = " " ; $Ya = " " ; $ce = array (); $Ch = " " ; $Qc = ( $R != '' ? 'fetch_assoc' : 'fetch_row' ); while ( $K = $I -> $Qc ()){ if ( ! $ce ){ $Ni = array (); foreach ( $K
as $X ){ $p = $I -> fetch_field (); $ce [] = $p -> name ; $z = idf_escape ( $p -> name ); $Ni [] = " $z = VALUES( $z ) " ;} $Ch = ( $Ah == " INSERT+UPDATE " ? " \n ON DUPLICATE KEY UPDATE " . implode ( " , " , $Ni ) : " " ) . " ; \n " ;} if ( $_POST [ " format " ] != " sql " ){ if ( $Ah == " table " ){ dump_csv ( $ce ); $Ah = " INSERT " ;} dump_csv ( $K );} else { if ( ! $Od ) $Od = " INSERT INTO " . table ( $R ) . " ( " . implode ( " , " , array_map ( 'idf_escape' , $ce )) . " ) VALUES " ; foreach ( $K
as $z => $X ){ $p = $q [ $z ]; $K [ $z ] = ( $X !== null ? unconvert_field ( $p , preg_match ( number_type (), $p [ " type " ]) && $X != '' ? $X : q ( $X )) : " NULL " );} $Rg = ( $Ae ? " \n " : " " ) . " ( " . implode ( " , \t " , $K ) . " ) " ; if ( ! $Ya ) $Ya = $Od . $Rg ; elseif ( strlen ( $Ya ) + 4 + strlen ( $Rg ) + strlen ( $Ch ) < $Ae ) $Ya .= " , $Rg " ; else { echo $Ya . $Ch ; $Ya = $Od . $Rg ;}}} if ( $Ya ) echo $Ya . $Ch ;} elseif ( $_POST [ " format " ] == " sql " ) echo " -- " . str_replace ( " \n " , " " , $g -> error ) . " \n " ;}} function
dumpFilename ( $_d ){ return
friendly_url ( $_d != " " ? $_d : ( SERVER != " " ? SERVER : " localhost " ));} function
dumpHeaders ( $_d , $Pe = false ){ $Df = $_POST [ " output " ]; $Ic = ( preg_match ( '~sql~' , $_POST [ " format " ]) ? " sql " : ( $Pe ? " tar " : " csv " )); header ( " Content-Type: " . ( $Df == " gz " ? " application/x-gzip " : ( $Ic == " tar " ? " application/x-tar " : ( $Ic == " sql " || $Df != " file " ? " text/plain " : " text/csv " ) . " ; charset=utf-8 " ))); if ( $Df == " gz " ) ob_start ( 'ob_gzencode' , 1e6 ); return $Ic ;} function
importServerPath (){ return " adminer.sql " ;} function
homepage (){ echo '<p class="links">' . ( $_GET [ " ns " ] == " " && support ( " database " ) ? '<a href="' . h ( ME ) . 'database=">' . lang ( 65 ) . " </a> \n " : " " ),( support ( " scheme " ) ? " <a href=' " . h ( ME ) . " scheme='> " . ( $_GET [ " ns " ] != " " ? lang ( 66 ) : lang ( 67 )) . " </a> \n " : " " ),( $_GET [ " ns " ] !== " " ? '<a href="' . h ( ME ) . 'schema=">' . lang ( 68 ) . " </a> \n " : " " ),( support ( " privileges " ) ? " <a href=' " . h ( ME ) . " privileges='> " . lang ( 69 ) . " </a> \n " : " " ); return
true ;} function
navigation ( $Oe ){ global $ia , $y , $ec , $g ; echo ' < h1 >
',$this->name(),' < span class = " version " > ',$ia,' </ span >
< a href = " https://www.adminer.org/#download " ',target_blank(),' id = " version " > ',(version_compare($ia,$_COOKIE["adminer_version"])<0?h($_COOKIE["adminer_version"]):""),' </ a >
2014-05-08 19:46:08 +02:00
</ h1 >
2018-04-01 23:34:54 +02:00
' ; if ( $Oe == " auth " ){ $Wc = true ; foreach (( array ) $_SESSION [ " pwds " ] as $Pi => $fh ){ foreach ( $fh
as $O => $Ki ){ foreach ( $Ki
as $V => $G ){ if ( $G !== null ){ if ( $Wc ){ echo " <p id='logins'> " . script ( " mixin(qs('#logins'), { onmouseover: menuOver, onmouseout: menuOut}); " ); $Wc = false ;} $Qb = $_SESSION [ " db " ][ $Pi ][ $O ][ $V ]; foreach (( $Qb ? array_keys ( $Qb ) : array ( " " )) as $m ) echo " <a href=' " . h ( auth_url ( $Pi , $O , $V , $m )) . " '>( $ec[$Pi] ) " . h ( $V . ( $O != " " ? " @ " . $this -> serverName ( $O ) : " " ) . ( $m != " " ? " - $m " : " " )) . " </a><br> \n " ;}}}}} else { if ( $_GET [ " ns " ] !== " " &&! $Oe && DB != " " ){ $g -> select_db ( DB ); $T = table_status ( '' , true );} echo
script_src ( preg_replace ( " ~ \\ ?.*~ " , " " , ME ) . " ?file=jush.js&version=4.6.2 " ); if ( support ( " sql " )){ echo '<script' , nonce (), ' >
' ; if ( $T ){ $se = array (); foreach ( $T
as $R => $U ) $se [] = preg_quote ( $R , '/' ); echo " var jushLinks = { $y : [ ' " . js_escape ( ME ) . ( support ( " table " ) ? " table= " : " select= " ) . " \$ &', / \\ b( " . implode ( " | " , $se ) . " ) \\ b/g ] }; \n " ; foreach ( array ( " bac " , " bra " , " sqlite_quo " , " mssql_bra " ) as $X ) echo " jushLinks. $X = jushLinks. $y ; \n " ;} $eh = $g -> server_info ; echo 'bodyLoad(\'' ,( is_object ( $g ) ? preg_replace ( '~^(\\d\\.?\\d).*~s' , '\\1' , $eh ) : " " ), '\'' ,( preg_match ( '~MariaDB~' , $eh ) ? " , true " : " " ), ' );
2014-05-08 19:46:08 +02:00
</ script >
2018-04-01 23:34:54 +02:00
';}$this->databasesPrint($Oe);if(DB==""||!$Oe){echo"<p class=' links '>".(support("sql")?"<a href=' " .h(ME). " sql = '".bold(isset($_GET["sql"])&&!isset($_GET["import"])).">".lang(62)."</a>\n<a href=' " .h(ME). " import = '".bold(isset($_GET["import"])).">".lang(70)."</a>\n":"")."";if(support("dump"))echo"<a href=' " .h(ME). " dump = " .urlencode(isset( $_GET["table"] )? $_GET["table"] : $_GET["select"] ). " ' id=' dump '".bold(isset($_GET["dump"])).">".lang(71)."</a>\n";}if($_GET["ns"]!==""&&!$Oe&&DB!=""){echo' < a href = " '.h(ME).'create= " '.bold($_GET["create"]==="").">".lang(72)."</a>\n";if(!$T)echo"<p class=' message ' > " .lang(9). " \n " ;else $this->tablesPrint ( $T );}}}function
databasesPrint ( $Oe ){ global $b , $g ; $l = $this -> databases (); echo ' < form action = " " >
2014-05-08 19:46:08 +02:00
< p id = " dbs " >
2018-04-01 23:34:54 +02:00
';hidden_fields_get();$Ob=script("mixin(qsl(' select '), {onmousedown: dbMouseDown, onchange: dbChange});");echo"<span title=' " .lang(73). " '>".lang(74)."</span>: ".($l?"<select name=' db '>".optionlist(array(""=>"")+$l,DB)."</select>$Ob":"<input name=' db ' value=' " .h(DB). " ' autocapitalize=' off '>\n"),"<input type=' submit ' value=' " .lang(20). " '".($l?" class=' hidden '":"").">\n";if($Oe!="db"&&DB!=""&&$g->select_db(DB)){if(support("scheme")){echo"<br>".lang(75).": <select name=' ns '>".optionlist(array(""=>"")+$b->schemas(),$_GET["ns"])."</select>$Ob";if($_GET["ns"]!="")set_schema($_GET["ns"]);}}echo(isset($_GET["sql"])?' < input type = " hidden " name = " sql " value = " " > ':(isset($_GET["schema"])?' < input type = " hidden " name = " schema " value = " " > ':(isset($_GET["dump"])?' < input type = " hidden " name = " dump " value = " " > ':(isset($_GET["privileges"])?' < input type = " hidden " name = " privileges " value = " " > ' : " " )))), " </p></form> \n " ;} function
tablesPrint ( $T ){ echo " <ul id='tables'> " . script ( " mixin(qs('#tables'), { onmouseover: menuOver, onmouseout: menuOut}); " ); foreach ( $T
as $R => $xh ){ $D = $this -> tableName ( $xh ); if ( $D != " " ){ echo '<li><a href="' . h ( ME ) . 'select=' . urlencode ( $R ) . '"' . bold ( $_GET [ " select " ] == $R || $_GET [ " edit " ] == $R , " select " ) . " > " . lang ( 76 ) . " </a> " ,( support ( " table " ) || support ( " indexes " ) ? '<a href="' . h ( ME ) . 'table=' . urlencode ( $R ) . '"' . bold ( in_array ( $R , array ( $_GET [ " table " ], $_GET [ " create " ], $_GET [ " indexes " ], $_GET [ " foreign " ], $_GET [ " trigger " ])),( is_view ( $xh ) ? " view " : " structure " )) . " title=' " . lang ( 40 ) . " '> $D </a> " : " <span> $D </span> " ) . " \n " ;}} echo " </ul> \n " ;}} $b = ( function_exists ( 'adminer_object' ) ? adminer_object () : new
Adminer ); if ( $b -> operators === null ) $b -> operators = $of ; function
page_header ( $Zh , $o = " " , $Xa = array (), $ai = " " ){ global $ca , $ia , $b , $ec , $y ; page_headers (); if ( is_ajax () && $o ){ page_messages ( $o ); exit ;} $bi = $Zh . ( $ai != " " ? " : $ai " : " " ); $ci = strip_tags ( $bi . ( SERVER != " " && SERVER != " localhost " ? h ( " - " . SERVER ) : " " ) . " - " . $b -> name ()); echo ' <! DOCTYPE html >
< html lang = " ', $ca ,' " dir = " ',lang(77),' " >
2014-05-08 19:46:08 +02:00
< meta http - equiv = " Content-Type " content = " text/html; charset=utf-8 " >
< meta name = " robots " content = " noindex " >
2018-04-01 23:34:54 +02:00
< title > ',$ci,' </ title >
< link rel = " stylesheet " type = " text/css " href = " ',h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = default . css & version = 4.6 . 2 " ),' " >
',script_src(preg_replace("~\\?.*~","",ME)."?file=functions.js&version=4.6.2");if($b->head()){echo' < link rel = " shortcut icon " type = " image/x-icon " href = " ',h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = favicon . ico & version = 4.6 . 2 " ),' " >
< link rel = " apple-touch-icon " href = " ',h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = favicon . ico & version = 4.6 . 2 " ),' " >
';foreach($b->css()as$Ib){echo' < link rel = " stylesheet " type = " text/css " href = " ',h( $Ib ),' " >
2014-05-08 19:46:08 +02:00
';}}echo'
2018-04-01 23:34:54 +02:00
< body class = " ',lang(77),' nojs " >
';$Uc=get_temp_dir()."/adminer.version";if(!$_COOKIE["adminer_version"]&&function_exists(' openssl_verify ' ) && file_exists ( $Uc ) && filemtime ( $Uc ) + 86400 > time ()){ $Qi = unserialize ( file_get_contents ( $Uc )); $mg = " -----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7 /+ Z70djoK
RlHIZFZPO0uYRezq90 + 7 Amk + FDNd7KkL5eDve + vHRJBLAszF / 7 XKXe11xwliIsFs
DFWQlsABVZB3oisKCBEuI71J4kPH8dKGEWR9jDHFw3cWmoH3PmqImX6FISWbG3B8
h7FIx3jEaw5ckVPVTeo5JRm / 1 DZzJxjyDenXvBQ / 6 o9DgZKeNDgxwKzH + sw9 / YCO
jHnq1cFpOIISzARlrHMa / 43 YfeNRAm / tsBXjSxembBPo7aQZLAWHmaj5 + K19H10B
nCpz9Y ++ cipkVEiKRGih4ZEvjoFysEOdRLj6WiD / uUNky4xGeA6LaJqh5XpkFkcQ
fQIDAQAB
----- END PUBLIC KEY -----
" ;if(openssl_verify( $Qi["version"] ,base64_decode( $Qi["signature"] ), $mg )==1) $_COOKIE["adminer_version"] = $Qi["version"] ;}echo'<script',nonce(),'>
mixin ( document . body , { onkeydown : bodyKeydown , onclick : bodyClick ',(isset($_COOKIE["adminer_version"])?"":", onload: partial(verifyVersion, ' $ia ', ' " .js_escape(ME). " ', ' " .get_token(). " ' ) " );?>});
2015-07-03 19:50:03 +02:00
document . body . className = document . body . className . replace ( / nojs / , ' js' );
var offlineMessage = ' < ? php echo
2018-04-01 23:34:54 +02:00
js_escape ( lang ( 78 )), ' \ ' ;
var thousandsSeparator = \ '' , js_escape ( lang ( 5 )), ' \ ' ;
2014-05-08 19:46:08 +02:00
</ script >
2018-04-01 23:34:54 +02:00
< div id = " help " class = " jush-', $y ,' jsonly hidden " ></ div >
',script("mixin(qs(' #help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});"),'
2014-05-08 19:46:08 +02:00
< div id = " content " >
2018-04-01 23:34:54 +02:00
';if($Xa!==null){$A=substr(preg_replace(' ~ \b ( username | db | ns ) = [ ^& ] *&~ ',' ',ME),0,-1);echo' < p id = " breadcrumb " >< a href = " '.h( $A ? $A : " . " ).' " > '.$ec[DRIVER].' </ a > & raquo ; ';$A=substr(preg_replace(' ~ \b ( db | ns ) = [ ^& ] *&~ ',' ',ME),0,-1);$O=$b->serverName(SERVER);$O=($O!=""?$O:lang(32));if($Xa===false)echo"$O\n";else{echo"<a href=' " .( $A ?h( $A ): " . " ). " ' accesskey=' 1 ' title=' Alt + Shift + 1 '>$O</a> » ";if($_GET["ns"]!=""||(DB!=""&&is_array($Xa)))echo' < a href = " '.h( $A . " & db = " .urlencode(DB).(support( " scheme " )? " & ns = " : " " )).' " > '.h(DB).' </ a > & raquo ; ';if(is_array($Xa)){if($_GET["ns"]!="")echo' < a href = " '.h(substr(ME,0,-1)).' " > '.h($_GET["ns"]).' </ a > & raquo ; ' ; foreach ( $Xa
as $z => $X ){ $Wb = ( is_array ( $X ) ? $X [ 1 ] : h ( $X )); if ( $Wb != " " ) echo " <a href=' " . h ( ME . " $z = " ) . urlencode ( is_array ( $X ) ? $X [ 0 ] : $X ) . " '> $Wb </a> » " ;}} echo " $Zh\n " ;}} echo " <h2> $bi </h2> \n " , " <div id='ajaxstatus' class='jsonly hidden'></div> \n " ; restart_session (); page_messages ( $o ); $l =& get_session ( " dbs " ); if ( DB != " " && $l &&! in_array ( DB , $l , true )) $l = null ; stop_session (); define ( " PAGE_HEADER " , 1 );} function
page_headers (){ global $b ; header ( " Content-Type: text/html; charset=utf-8 " ); header ( " Cache-Control: no-cache " ); header ( " X-Frame-Options: deny " ); header ( " X-XSS-Protection: 0 " ); header ( " X-Content-Type-Options: nosniff " ); header ( " Referrer-Policy: origin-when-cross-origin " ); foreach ( $b -> csp () as $Hb ){ $ud = array (); foreach ( $Hb
as $z => $X ) $ud [] = " $z $X " ; header ( " Content-Security-Policy: " . implode ( " ; " , $ud ));} $b -> headers ();} function
csp (){ return
array ( array ( " script-src " => " 'self' 'unsafe-inline' 'nonce- " . get_nonce () . " ' 'strict-dynamic' " , " connect-src " => " 'self' " , " frame-src " => " https://www.adminer.org " , " object-src " => " 'none' " , " base-uri " => " 'none' " , " form-action " => " 'self' " ,),);} function
get_nonce (){ static $Ye ; if ( ! $Ye ) $Ye = base64_encode ( rand_string ()); return $Ye ;} function
page_messages ( $o ){ $Di = preg_replace ( '~^[^?]*~' , '' , $_SERVER [ " REQUEST_URI " ]); $Ke = $_SESSION [ " messages " ][ $Di ]; if ( $Ke ){ echo " <div class='message'> " . implode ( " </div> \n <div class='message'> " , $Ke ) . " </div> " . script ( " messagesPrint(); " ); unset ( $_SESSION [ " messages " ][ $Di ]);} if ( $o ) echo " <div class='error'> $o </div> \n " ;} function
page_footer ( $Oe = " " ){ global $b , $gi ; echo ' </ div >
2014-05-08 19:46:08 +02:00
2018-04-01 23:34:54 +02:00
';switch_lang();if($Oe!="auth"){echo' < form action = " " method = " post " >
2014-05-08 19:46:08 +02:00
< p class = " logout " >
2018-04-01 23:34:54 +02:00
< input type = " submit " name = " logout " value = " ',lang(79),' " id = " logout " >
< input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ p >
</ form >
';}echo' < div id = " menu " >
2018-04-01 23:34:54 +02:00
';$b->navigation($Oe);echo' </ div >
' , script ( " setupSubmitHighlight(document); " );} function
int32 ( $Re ){ while ( $Re >= 2147483648 ) $Re -= 4294967296 ; while ( $Re <=- 2147483649 ) $Re += 4294967296 ; return ( int ) $Re ;} function
long2str ( $W , $Ui ){ $Rg = '' ; foreach ( $W
as $X ) $Rg .= pack ( 'V' , $X ); if ( $Ui ) return
substr ( $Rg , 0 , end ( $W )); return $Rg ;} function
str2long ( $Rg , $Ui ){ $W = array_values ( unpack ( 'V*' , str_pad ( $Rg , 4 * ceil ( strlen ( $Rg ) / 4 ), " \0 " ))); if ( $Ui ) $W [] = strlen ( $Rg ); return $W ;} function
xxtea_mx ( $hj , $gj , $Dh , $Yd ){ return
int32 ((( $hj >> 5 & 0x7FFFFFF ) ^ $gj << 2 ) + (( $gj >> 3 & 0x1FFFFFFF ) ^ $hj << 4 )) ^ int32 (( $Dh ^ $gj ) + ( $Yd ^ $hj ));} function
encrypt_string ( $zh , $z ){ if ( $zh == " " ) return " " ; $z = array_values ( unpack ( " V* " , pack ( " H* " , md5 ( $z )))); $W = str2long ( $zh , true ); $Re = count ( $W ) - 1 ; $hj = $W [ $Re ]; $gj = $W [ 0 ]; $ng = floor ( 6 + 52 / ( $Re + 1 )); $Dh = 0 ; while ( $ng --> 0 ){ $Dh = int32 ( $Dh + 0x9E3779B9 ); $lc = $Dh >> 2 & 3 ; for ( $Ef = 0 ; $Ef < $Re ; $Ef ++ ){ $gj = $W [ $Ef + 1 ]; $Qe = xxtea_mx ( $hj , $gj , $Dh , $z [ $Ef & 3 ^ $lc ]); $hj = int32 ( $W [ $Ef ] + $Qe ); $W [ $Ef ] = $hj ;} $gj = $W [ 0 ]; $Qe = xxtea_mx ( $hj , $gj , $Dh , $z [ $Ef & 3 ^ $lc ]); $hj = int32 ( $W [ $Re ] + $Qe ); $W [ $Re ] = $hj ;} return
2014-05-08 19:46:08 +02:00
long2str ( $W , false );} function
2018-04-01 23:34:54 +02:00
decrypt_string ( $zh , $z ){ if ( $zh == " " ) return " " ; if ( ! $z ) return
false ; $z = array_values ( unpack ( " V* " , pack ( " H* " , md5 ( $z )))); $W = str2long ( $zh , false ); $Re = count ( $W ) - 1 ; $hj = $W [ $Re ]; $gj = $W [ 0 ]; $ng = floor ( 6 + 52 / ( $Re + 1 )); $Dh = int32 ( $ng * 0x9E3779B9 ); while ( $Dh ){ $lc = $Dh >> 2 & 3 ; for ( $Ef = $Re ; $Ef > 0 ; $Ef -- ){ $hj = $W [ $Ef - 1 ]; $Qe = xxtea_mx ( $hj , $gj , $Dh , $z [ $Ef & 3 ^ $lc ]); $gj = int32 ( $W [ $Ef ] - $Qe ); $W [ $Ef ] = $gj ;} $hj = $W [ $Re ]; $Qe = xxtea_mx ( $hj , $gj , $Dh , $z [ $Ef & 3 ^ $lc ]); $gj = int32 ( $W [ 0 ] - $Qe ); $W [ 0 ] = $gj ; $Dh = int32 ( $Dh - 0x9E3779B9 );} return
long2str ( $W , true );} $g = '' ; $td = $_SESSION [ " token " ]; if ( ! $td ) $_SESSION [ " token " ] = rand ( 1 , 1e6 ); $gi = get_token (); $Uf = array (); if ( $_COOKIE [ " adminer_permanent " ]){ foreach ( explode ( " " , $_COOKIE [ " adminer_permanent " ]) as $X ){ list ( $z ) = explode ( " : " , $X ); $Uf [ $z ] = $X ;}} function
add_invalid_login (){ global $b ; $hd = file_open_lock ( get_temp_dir () . " /adminer.invalid " ); if ( ! $hd ) return ; $Rd = unserialize ( stream_get_contents ( $hd )); $Wh = time (); if ( $Rd ){ foreach ( $Rd
as $Sd => $X ){ if ( $X [ 0 ] < $Wh ) unset ( $Rd [ $Sd ]);}} $Qd =& $Rd [ $b -> bruteForceKey ()]; if ( ! $Qd ) $Qd = array ( $Wh + 30 * 60 , 0 ); $Qd [ 1 ] ++ ; file_write_unlock ( $hd , serialize ( $Rd ));} function
check_invalid_login (){ global $b ; $Rd = unserialize ( @ file_get_contents ( get_temp_dir () . " /adminer.invalid " )); $Qd = $Rd [ $b -> bruteForceKey ()]; $Xe = ( $Qd [ 1 ] > 29 ? $Qd [ 0 ] - time () : 0 ); if ( $Xe > 0 ) auth_error ( lang ( 80 , ceil ( $Xe / 60 )));} $La = $_POST [ " auth " ]; if ( $La ){ session_regenerate_id (); $Pi = $La [ " driver " ]; $O = $La [ " server " ]; $V = $La [ " username " ]; $G = ( string ) $La [ " password " ]; $m = $La [ " db " ]; set_password ( $Pi , $O , $V , $G ); $_SESSION [ " db " ][ $Pi ][ $O ][ $V ][ $m ] = true ; if ( $La [ " permanent " ]){ $z = base64_encode ( $Pi ) . " - " . base64_encode ( $O ) . " - " . base64_encode ( $V ) . " - " . base64_encode ( $m ); $gg = $b -> permanentLogin ( true ); $Uf [ $z ] = " $z : " . base64_encode ( $gg ? encrypt_string ( $G , $gg ) : " " ); cookie ( " adminer_permanent " , implode ( " " , $Uf ));} if ( count ( $_POST ) == 1 || DRIVER != $Pi || SERVER != $O || $_GET [ " username " ] !== $V || DB != $m ) redirect ( auth_url ( $Pi , $O , $V , $m ));} elseif ( $_POST [ " logout " ]){ if ( $td &&! verify_token ()){ page_header ( lang ( 79 ), lang ( 81 )); page_footer ( " db " ); exit ;} else { foreach ( array ( " pwds " , " db " , " dbs " , " queries " ) as $z ) set_session ( $z , null ); unset_permanent (); redirect ( substr ( preg_replace ( '~\b(username|db|ns)=[^&]*&~' , '' , ME ), 0 , - 1 ), lang ( 82 ) . ' ' . lang ( 83 , 'https://sourceforge.net/donate/index.php?group_id=264133' ));}} elseif ( $Uf &&! $_SESSION [ " pwds " ]){ session_regenerate_id (); $gg = $b -> permanentLogin (); foreach ( $Uf
as $z => $X ){ list (, $jb ) = explode ( " : " , $X ); list ( $Pi , $O , $V , $m ) = array_map ( 'base64_decode' , explode ( " - " , $z )); set_password ( $Pi , $O , $V , decrypt_string ( base64_decode ( $jb ), $gg )); $_SESSION [ " db " ][ $Pi ][ $O ][ $V ][ $m ] = true ;}} function
unset_permanent (){ global $Uf ; foreach ( $Uf
as $z => $X ){ list ( $Pi , $O , $V , $m ) = array_map ( 'base64_decode' , explode ( " - " , $z )); if ( $Pi == DRIVER && $O == SERVER && $V == $_GET [ " username " ] && $m == DB ) unset ( $Uf [ $z ]);} cookie ( " adminer_permanent " , implode ( " " , $Uf ));} function
auth_error ( $o ){ global $b , $td ; $gh = session_name (); if ( isset ( $_GET [ " username " ])){ header ( " HTTP/1.1 403 Forbidden " ); if (( $_COOKIE [ $gh ] || $_GET [ $gh ]) &&! $td ) $o = lang ( 84 ); else { add_invalid_login (); $G = get_password (); if ( $G !== null ){ if ( $G === false ) $o .= '<br>' . lang ( 85 , target_blank (), '<code>permanentLogin()</code>' ); set_password ( DRIVER , SERVER , $_GET [ " username " ], null );} unset_permanent ();}} if ( ! $_COOKIE [ $gh ] && $_GET [ $gh ] && ini_bool ( " session.use_only_cookies " )) $o = lang ( 86 ); $Hf = session_get_cookie_params (); cookie ( " adminer_key " ,( $_COOKIE [ " adminer_key " ] ? $_COOKIE [ " adminer_key " ] : rand_string ()), $Hf [ " lifetime " ]); page_header ( lang ( 36 ), $o , null ); echo " <form action='' method='post'> \n " , " <div> " ; if ( hidden_fields ( $_POST , array ( " auth " ))) echo " <p class='message'> " . lang ( 87 ) . " \n " ; echo " </div> \n " ; $b -> loginForm (); echo " </form> \n " ; page_footer ( " auth " ); exit ;} if ( isset ( $_GET [ " username " ])){ if ( ! class_exists ( " Min_DB " )){ unset ( $_SESSION [ " pwds " ][ DRIVER ]); unset_permanent (); page_header ( lang ( 88 ), lang ( 89 , implode ( " , " , $ag )), false ); page_footer ( " auth " ); exit ;} list ( $yd , $Wf ) = explode ( " : " , SERVER , 2 ); if ( is_numeric ( $Wf ) && $Wf < 1024 ) auth_error ( lang ( 90 )); check_invalid_login (); $g = connect (); $n = new
Min_Driver ( $g );} $te = null ; if ( ! is_object ( $g ) || ( $te = $b -> login ( $_GET [ " username " ], get_password ())) !== true ) auth_error (( is_string ( $g ) ? h ( $g ) : ( is_string ( $te ) ? $te : lang ( 91 )))); if ( $La && $_POST [ " token " ]) $_POST [ " token " ] = $gi ; $o = '' ; if ( $_POST ){ if ( ! verify_token ()){ $Ld = " max_input_vars " ; $Ee = ini_get ( $Ld ); if ( extension_loaded ( " suhosin " )){ foreach ( array ( " suhosin.request.max_vars " , " suhosin.post.max_vars " ) as $z ){ $X = ini_get ( $z ); if ( $X && ( ! $Ee || $X < $Ee )){ $Ld = $z ; $Ee = $X ;}}} $o = ( ! $_POST [ " token " ] && $Ee ? lang ( 92 , " ' $Ld ' " ) : lang ( 81 ) . ' ' . lang ( 93 ));}} elseif ( $_SERVER [ " REQUEST_METHOD " ] == " POST " ){ $o = lang ( 94 , " 'post_max_size' " ); if ( isset ( $_GET [ " sql " ])) $o .= ' ' . lang ( 95 );} if ( ! ini_bool ( " session.use_cookies " ) ||@ ini_set ( " session.use_cookies " , false ) !== false ) session_write_close (); function
select ( $I , $h = null , $wf = array (), $_ = 0 ){ global $y ; $se = array (); $x = array (); $e = array (); $Ua = array (); $vi = array (); $J = array (); odd ( '' ); for ( $t = 0 ;( ! $_ || $t < $_ ) && ( $K = $I -> fetch_row ()); $t ++ ){ if ( ! $t ){ echo " <table cellspacing='0' class='nowrap'> \n " , " <thead><tr> " ; for ( $Xd = 0 ; $Xd < count ( $K ); $Xd ++ ){ $p = $I -> fetch_field (); $D = $p -> name ; $vf = $p -> orgtable ; $uf = $p -> orgname ; $J [ $p -> table ] = $vf ; if ( $wf && $y == " sql " ) $se [ $Xd ] = ( $D == " table " ? " table= " : ( $D == " possible_keys " ? " indexes= " : null )); elseif ( $vf != " " ){ if ( ! isset ( $x [ $vf ])){ $x [ $vf ] = array (); foreach ( indexes ( $vf , $h ) as $w ){ if ( $w [ " type " ] == " PRIMARY " ){ $x [ $vf ] = array_flip ( $w [ " columns " ]); break ;}} $e [ $vf ] = $x [ $vf ];} if ( isset ( $e [ $vf ][ $uf ])){ unset ( $e [ $vf ][ $uf ]); $x [ $vf ][ $uf ] = $Xd ; $se [ $Xd ] = $vf ;}} if ( $p -> charsetnr == 63 ) $Ua [ $Xd ] = true ; $vi [ $Xd ] = $p -> type ; echo " <th " . ( $vf != " " || $p -> name != $uf ? " title=' " . h (( $vf != " " ? " $vf . " : " " ) . $uf ) . " ' " : " " ) . " > " . h ( $D ) . ( $wf ? doc_link ( array ( 'sql' => " explain-output.html#explain_ " . strtolower ( $D ), 'mariadb' => " explain/#the-columns-in-explain-select " ,)) : " " );} echo " </thead> \n " ;} echo " <tr " . odd () . " > " ; foreach ( $K
as $z => $X ){ if ( $X === null ) $X = " <i>NULL</i> " ; elseif ( $Ua [ $z ] &&! is_utf8 ( $X )) $X = " <i> " . lang ( 45 , strlen ( $X )) . " </i> " ; elseif ( ! strlen ( $X )) $X = " " ; else { $X = h ( $X ); if ( $vi [ $z ] == 254 ) $X = " <code> $X </code> " ;} if ( isset ( $se [ $z ]) &&! $e [ $se [ $z ]]){ if ( $wf && $y == " sql " ){ $R = $K [ array_search ( " table= " , $se )]; $A = $se [ $z ] . urlencode ( $wf [ $R ] != " " ? $wf [ $R ] : $R );} else { $A = " edit= " . urlencode ( $se [ $z ]); foreach ( $x [ $se [ $z ]] as $nb => $Xd ) $A .= " &where " . urlencode ( " [ " . bracket_escape ( $nb ) . " ] " ) . " = " . urlencode ( $K [ $Xd ]);} $X = " <a href=' " . h ( ME . $A ) . " '> $X </a> " ;} echo " <td> $X " ;}} echo ( $t ? " </table> " : " <p class='message'> " . lang ( 12 )) . " \n " ; return $J ;} function
referencable_primary ( $ah ){ $J = array (); foreach ( table_status ( '' , true ) as $Hh => $R ){ if ( $Hh != $ah && fk_support ( $R )){ foreach ( fields ( $Hh ) as $p ){ if ( $p [ " primary " ]){ if ( $J [ $Hh ]){ unset ( $J [ $Hh ]); break ;} $J [ $Hh ] = $p ;}}}} return $J ;} function
textarea ( $D , $Y , $L = 10 , $sb = 80 ){ global $y ; echo " <textarea name=' $D ' rows=' $L ' cols=' $sb ' class='sqlarea jush- $y ' spellcheck='false' wrap='off'> " ; if ( is_array ( $Y )){ foreach ( $Y
2014-05-08 19:46:08 +02:00
as $X ) echo
h ( $X [ 0 ]) . " \n \n \n " ;} else
echo
h ( $Y ); echo " </textarea> " ;} function
2018-04-01 23:34:54 +02:00
edit_type ( $z , $p , $qb , $dd = array (), $Lc = array ()){ global $_h , $vi , $Bi , $jf ; $U = $p [ " type " ]; echo '<td><select name="' , h ( $z ), '[type]" class="type" aria-labelledby="label-type">' ; if ( $U &&! isset ( $vi [ $U ]) &&! isset ( $dd [ $U ]) &&! in_array ( $U , $Lc )) $Lc [] = $U ; if ( $dd ) $_h [ lang ( 96 )] = $dd ; echo
optionlist ( array_merge ( $Lc , $_h ), $U ), ' </ select >
',on_help("getTarget(event).value",1),script("mixin(qsl(' select '), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});",""),' < td >< input name = " ',h( $z ),'[length] " value = " ',h( $p["length"] ),' " size = " 3 " ',(!$p["length"]&&preg_match(' ~ var ( char | binary ) $ ~ ',$U)?" class=' required '":""),' aria - labelledby = " label-length " > ',script("mixin(qsl(' input '), {onfocus: editingLengthFocus, oninput: editingLengthChange});",""),' < td class = " options " > ';echo"<select name=' " .h( $z ). " [ collation ] '".(preg_match(' ~ ( char | text | enum | set ) $ ~ ',$U)?"":" class=' hidden '").' >< option value = " " > ( '.lang(97).' ) '.optionlist($qb,$p["collation"]).' </ select > ',($Bi?"<select name=' " .h( $z ). " [ unsigned ] '".(!$U||preg_match(number_type(),$U)?"":" class=' hidden '").' >< option > '.optionlist($Bi,$p["unsigned"]).' </ select > ':' '),(isset($p[' on_update '])?"<select name=' " .h( $z ). " [ on_update ] '".(preg_match(' ~ timestamp | datetime ~ ',$U)?"":" class=' hidden '").' > '.optionlist(array(""=>"(".lang(98).")","CURRENT_TIMESTAMP"),$p["on_update"]).' </ select > ':' '),($dd?"<select name=' " .h( $z ). " [ on_delete ] '".(preg_match("~`~",$U)?"":" class=' hidden '")."><option value=' ' > ( " .lang(99). " ) " .optionlist(explode( " | " , $jf ), $p["on_delete"] ). " </ select > " : " " );}function
process_length ( $pe ){ global $wc ; return ( preg_match ( " ~^ \\ s* \\ (? \\ s* $wc (?: \\ s*, \\ s* $wc )*+ \\ s* \\ )? \\ s* \$ ~ " , $pe ) && preg_match_all ( " ~ $wc ~ " , $pe , $ze ) ? " ( " . implode ( " , " , $ze [ 0 ]) . " ) " : preg_replace ( '~^[0-9].*~' , '(\0)' , preg_replace ( '~[^-0-9,+()[\]]~' , '' , $pe )));} function
process_type ( $p , $ob = " COLLATE " ){ global $Bi ; return " $p[type] " . process_length ( $p [ " length " ]) . ( preg_match ( number_type (), $p [ " type " ]) && in_array ( $p [ " unsigned " ], $Bi ) ? " $p[unsigned] " : " " ) . ( preg_match ( '~char|text|enum|set~' , $p [ " type " ]) && $p [ " collation " ] ? " $ob " . q ( $p [ " collation " ]) : " " );} function
process_field ( $p , $ti ){ return
array ( idf_escape ( trim ( $p [ " field " ])), process_type ( $ti ),( $p [ " null " ] ? " NULL " : " NOT NULL " ), default_value ( $p ),( preg_match ( '~timestamp|datetime~' , $p [ " type " ]) && $p [ " on_update " ] ? " ON UPDATE $p[on_update] " : " " ),( support ( " comment " ) && $p [ " comment " ] != " " ? " COMMENT " . q ( $p [ " comment " ]) : " " ),( $p [ " auto_increment " ] ? auto_increment () : null ),);} function
default_value ( $p ){ $Sb = $p [ " default " ]; return ( $Sb === null ? " " : " DEFAULT " . ( preg_match ( '~char|binary|text|enum|set~' , $p [ " type " ]) || preg_match ( '~^(?![a-z])~i' , $Sb ) ? q ( $Sb ) : $Sb ));} function
2017-06-25 00:56:50 +02:00
type_class ( $U ){ foreach ( array ( 'char' => 'text' , 'date' => 'time|year' , 'binary' => 'blob' , 'enum' => 'set' ,) as $z => $X ){ if ( preg_match ( " ~ $z | $X ~ " , $U )) return " class=' $z ' " ;}} function
2018-04-01 23:34:54 +02:00
edit_fields ( $q , $qb , $U = " TABLE " , $dd = array (), $wb = false ){ global $Md ; $q = array_values ( $q ); echo ' < thead >< tr >
';if($U=="PROCEDURE"){echo' < td >& nbsp ; ';}echo' < th id = " label-name " > ',($U=="TABLE"?lang(100):lang(101)),' < td id = " label-type " > ',lang(47),' < textarea id = " enum-edit " rows = " 4 " cols = " 12 " wrap = " off " style = " display: none; " ></ textarea > ',script("qs(' #enum-edit').onblur = editingLengthBlur;"),'<td id="label-length">',lang(102),'<td>',lang(103);if($U=="TABLE"){echo'<td id="label-null">NULL
< td >< input type = " radio " name = " auto_increment_col " value = " " >< acronym id = " label-ai " title = " ',lang(49),' " > AI </ acronym > ',doc_link(array(' sql '=>"example-auto-increment.html",' mariadb '=>"auto_increment/",' sqlite '=>"autoinc.html",' pgsql '=>"datatype.html#DATATYPE-SERIAL",' mssql '=>"ms186775.aspx",)),' < td id = " label-default " > ',lang(50),(support("comment")?"<td id=' label - comment '".($wb?"":" class=' hidden '").">".lang(48):"");}echo' < td > ',"<input type=' image ' class=' icon ' name=' add [ " .(support( " move_col " )?0:count( $q )). " ] ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = plus . gif & version = 4.6 . 2 " ). " ' alt=' + ' title=' " .lang(104). " '>".script("row_count = ".count($q).";"),' </ thead >
< tbody >
',script("mixin(qsl(' tbody ' ), { onclick : editingClick , onkeydown : editingKeydown , oninput : editingInput }); " );foreach( $q
as $t => $p ){ $t ++ ; $xf = $p [( $_POST ? " orig " : " field " )]; $ac = ( isset ( $_POST [ " add " ][ $t - 1 ]) || ( isset ( $p [ " field " ]) &&! $_POST [ " drop_col " ][ $t ])) && ( support ( " drop_col " ) || $xf == " " ); echo '<tr' ,( $ac ? " " : " style='display: none;' " ), ' >
',($U=="PROCEDURE"?"<td>".html_select("fields[$t][inout]",explode("|",$Md),$p["inout"]):""),' < th > ';if($ac){echo' < input name = " fields[', $t ,'][field] " value = " ',h( $p["field"] ),' " maxlength = " 64 " autocapitalize = " off " aria - labelledby = " label-name " > ',script("qsl(' input ').oninput = function () { editingNameChange.call(this);".($p["field"]!=""||count($q)>1?"":" editingAddRow.call(this);")." };","");}echo' < input type = " hidden " name = " fields[', $t ,'][orig] " value = " ',h( $xf ),' " >
';edit_type("fields[$t]",$p,$qb,$dd);if($U=="TABLE"){echo' < td > ',checkbox("fields[$t][null]",1,$p["null"],"","","block","label-null"),' < td >< label class = " block " >< input type = " radio " name = " auto_increment_col " value = " ', $t ,' " ';if($p["auto_increment"]){echo' checked ';}echo' aria - labelledby = " label-ai " ></ label >< td > ',checkbox("fields[$t][has_default]",1,$p["has_default"],"","","","label-default"),' < input name = " fields[', $t ,'][default] " value = " ',h( $p["default"] ),' " aria - labelledby = " label-default " > ',(support("comment")?"<td".($wb?"":" class=' hidden '")."><input name=' fields [ $t ][ comment ] ' value=' " .h( $p["comment"] ). " ' maxlength=' " .(min_version(5.5)?1024:255). " ' aria-labelledby=' label - comment '>":"");}echo"<td>",(support("move_col")?"<input type=' image ' class=' icon ' name=' add [ $t ] ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = plus . gif & version = 4.6 . 2 " ). " ' alt=' + ' title=' " .lang(104). " '> "."<input type=' image ' class=' icon ' name=' up [ $t ] ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = up . gif & version = 4.6 . 2 " ). " ' alt=' ↑ ' title=' " .lang(105). " '> "."<input type=' image ' class=' icon ' name=' down [ $t ] ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = down . gif & version = 4.6 . 2 " ). " ' alt=' ↓ ' title=' " .lang(106). " '> ":""),($xf==""||support("drop_col")?"<input type=' image ' class=' icon ' name=' drop_col [ $t ] ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = cross . gif & version = 4.6 . 2 " ). " ' alt=' x ' title=' " .lang(107). " ' > " : " " );}}function
process_fields ( & $q ){ $E = 0 ; if ( $_POST [ " up " ]){ $je = 0 ; foreach ( $q
as $z => $p ){ if ( key ( $_POST [ " up " ]) == $z ){ unset ( $q [ $z ]); array_splice ( $q , $je , 0 , array ( $p )); break ;} if ( isset ( $p [ " field " ])) $je = $E ; $E ++ ;}} elseif ( $_POST [ " down " ]){ $fd = false ; foreach ( $q
as $z => $p ){ if ( isset ( $p [ " field " ]) && $fd ){ unset ( $q [ key ( $_POST [ " down " ])]); array_splice ( $q , $E , 0 , array ( $fd )); break ;} if ( key ( $_POST [ " down " ]) == $z ) $fd = $p ; $E ++ ;}} elseif ( $_POST [ " add " ]){ $q = array_values ( $q ); array_splice ( $q , key ( $_POST [ " add " ]), 0 , array ( array ()));} elseif ( ! $_POST [ " drop_col " ]) return
2014-05-08 19:46:08 +02:00
false ; return
true ;} function
2017-06-25 00:56:50 +02:00
normalize_enum ( $C ){ return " ' " . str_replace ( " ' " , " '' " , addcslashes ( stripcslashes ( str_replace ( $C [ 0 ][ 0 ] . $C [ 0 ][ 0 ], $C [ 0 ][ 0 ], substr ( $C [ 0 ], 1 , - 1 ))), '\\' )) . " ' " ;} function
2018-04-01 23:34:54 +02:00
grant ( $kd , $ig , $e , $if ){ if ( ! $ig ) return
true ; if ( $ig == array ( " ALL PRIVILEGES " , " GRANT OPTION " )) return ( $kd == " GRANT " ? queries ( " $kd ALL PRIVILEGES $if WITH GRANT OPTION " ) : queries ( " $kd ALL PRIVILEGES $if " ) && queries ( " $kd GRANT OPTION $if " )); return
queries ( " $kd " . preg_replace ( '~(GRANT OPTION)\\([^)]*\\)~' , '\\1' , implode ( " $e , " , $ig ) . $e ) . $if );} function
drop_create ( $fc , $i , $gc , $Th , $ic , $B , $Je , $He , $Ie , $ff , $Ue ){ if ( $_POST [ " drop " ]) query_redirect ( $fc , $B , $Je ); elseif ( $ff == " " ) query_redirect ( $i , $B , $Ie ); elseif ( $ff != $Ue ){ $Gb = queries ( $i ); queries_redirect ( $B , $He , $Gb && queries ( $fc )); if ( $Gb ) queries ( $gc );} else
queries_redirect ( $B , $He , queries ( $Th ) && queries ( $ic ) && queries ( $fc ) && queries ( $i ));} function
create_trigger ( $if , $K ){ global $y ; $Yh = " $K[Timing] $K[Event] " . ( $K [ " Event " ] == " UPDATE OF " ? " " . idf_escape ( $K [ " Of " ]) : " " ); return " CREATE TRIGGER " . idf_escape ( $K [ " Trigger " ]) . ( $y == " mssql " ? $if . $Yh : $Yh . $if ) . rtrim ( " $K[Type] \n $K[Statement] " , " ; " ) . " ; " ;} function
create_routine ( $Ng , $K ){ global $Md , $y ; $P = array (); $q = ( array ) $K [ " fields " ]; ksort ( $q ); foreach ( $q
as $p ){ if ( $p [ " field " ] != " " ) $P [] = ( preg_match ( " ~^( $Md ) \$ ~ " , $p [ " inout " ]) ? " $p[inout] " : " " ) . idf_escape ( $p [ " field " ]) . process_type ( $p , " CHARACTER SET " );} $Tb = rtrim ( " \n $K[definition] " , " ; " ); return " CREATE $Ng " . idf_escape ( trim ( $K [ " name " ])) . " ( " . implode ( " , " , $P ) . " ) " . ( isset ( $_GET [ " function " ]) ? " RETURNS " . process_type ( $K [ " returns " ], " CHARACTER SET " ) : " " ) . ( $K [ " language " ] ? " LANGUAGE $K[language] " : " " ) . ( $y == " pgsql " ? " AS " . q ( $Tb ) : " $Tb ; " );} function
remove_definer ( $H ){ return
preg_replace ( '~^([A-Z =]+) DEFINER=`' . preg_replace ( '~@(.*)~' , '`@`(%|\\1)' , logged_user ()) . '`~' , '\\1' , $H );} function
format_foreign_key ( $r ){ global $jf ; return " FOREIGN KEY ( " . implode ( " , " , array_map ( 'idf_escape' , $r [ " source " ])) . " ) REFERENCES " . table ( $r [ " table " ]) . " ( " . implode ( " , " , array_map ( 'idf_escape' , $r [ " target " ])) . " ) " . ( preg_match ( " ~^( $jf ) \$ ~ " , $r [ " on_delete " ]) ? " ON DELETE $r[on_delete] " : " " ) . ( preg_match ( " ~^( $jf ) \$ ~ " , $r [ " on_update " ]) ? " ON UPDATE $r[on_update] " : " " );} function
tar_file ( $Uc , $di ){ $J = pack ( " a100a8a8a8a12a12 " , $Uc , 644 , 0 , 0 , decoct ( $di -> size ), decoct ( time ())); $hb = 8 * 32 ; for ( $t = 0 ; $t < strlen ( $J ); $t ++ ) $hb += ord ( $J [ $t ]); $J .= sprintf ( " %06o " , $hb ) . " \0 " ; echo $J , str_repeat ( " \0 " , 512 - strlen ( $J )); $di -> send (); echo
str_repeat ( " \0 " , 511 - ( $di -> size + 511 ) % 512 );} function
ini_bytes ( $Ld ){ $X = ini_get ( $Ld ); switch ( strtolower ( substr ( $X , - 1 ))){ case 'g' : $X *= 1024 ; case 'm' : $X *= 1024 ; case 'k' : $X *= 1024 ;} return $X ;} function
doc_link ( $Sf , $Uh = " <sup>?</sup> " ){ global $y , $g ; $eh = $g -> server_info ; $Qi = preg_replace ( '~^(\\d\\.?\\d).*~s' , '\\1' , $eh ); $Gi = array ( 'sql' => " https://dev.mysql.com/doc/refman/ $Qi /en/ " , 'sqlite' => " https://www.sqlite.org/ " , 'pgsql' => " https://www.postgresql.org/docs/ $Qi /static/ " , 'mssql' => " https://msdn.microsoft.com/library/ " , 'oracle' => " https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/ " ,); if ( preg_match ( '~MariaDB~' , $eh )){ $Gi [ 'sql' ] = " https://mariadb.com/kb/en/library/ " ; $Sf [ 'sql' ] = ( isset ( $Sf [ 'mariadb' ]) ? $Sf [ 'mariadb' ] : str_replace ( " .html " , " / " , $Sf [ 'sql' ]));} return ( $Sf [ $y ] ? " <a href=' $Gi[$y] $Sf[$y] ' " . target_blank () . " > $Uh </a> " : " " );} function
ob_gzencode ( $Q ){ return
gzencode ( $Q );} function
db_size ( $m ){ global $g ; if ( ! $g -> select_db ( $m )) return " ? " ; $J = 0 ; foreach ( table_status () as $S ) $J += $S [ " Data_length " ] + $S [ " Index_length " ]; return
format_number ( $J );} function
2017-06-25 00:56:50 +02:00
set_utf8mb4 ( $i ){ global $g ; static $P = false ; if ( ! $P && preg_match ( '~\butf8mb4~i' , $i )){ $P = true ; echo " SET NAMES " . charset ( $g ) . " ; \n \n " ;}} function
2018-04-01 23:34:54 +02:00
connect_error (){ global $b , $g , $gi , $o , $ec ; if ( DB != " " ){ header ( " HTTP/1.1 404 Not Found " ); page_header ( lang ( 35 ) . " : " . h ( DB ), lang ( 108 ), true );} else { if ( $_POST [ " db " ] &&! $o ) queries_redirect ( substr ( ME , 0 , - 1 ), lang ( 109 ), drop_databases ( $_POST [ " db " ])); page_header ( lang ( 110 ), $o , false ); echo " <p class='links'> \n " ; foreach ( array ( 'database' => lang ( 111 ), 'privileges' => lang ( 69 ), 'processlist' => lang ( 112 ), 'variables' => lang ( 113 ), 'status' => lang ( 114 ),) as $z => $X ){ if ( support ( $z )) echo " <a href=' " . h ( ME ) . " $z ='> $X </a> \n " ;} echo " <p> " . lang ( 115 , $ec [ DRIVER ], " <b> " . h ( $g -> server_info ) . " </b> " , " <b> $g->extension </b> " ) . " \n " , " <p> " . lang ( 116 , " <b> " . h ( logged_user ()) . " </b> " ) . " \n " ; $l = $b -> databases (); if ( $l ){ $Ug = support ( " scheme " ); $qb = collations (); echo " <form action='' method='post'> \n " , " <table cellspacing='0' class='checkable'> \n " , script ( " mixin(qsl('table'), { onclick: tableClick, ondblclick: partialArg(tableClick, true)}); " ), " <thead><tr> " . ( support ( " database " ) ? " <td> " : " " ) . " <th> " . lang ( 35 ) . " - <a href=' " . h ( ME ) . " refresh=1'> " . lang ( 117 ) . " </a> " . " <td> " . lang ( 118 ) . " <td> " . lang ( 119 ) . " <td> " . lang ( 120 ) . " - <a href=' " . h ( ME ) . " dbsize=1'> " . lang ( 121 ) . " </a> " . script ( " qsl('a').onclick = partial(ajaxSetHtml, ' " . js_escape ( ME ) . " script=connect'); " , " " ) . " </thead> \n " ; $l = ( $_GET [ " dbsize " ] ? count_tables ( $l ) : array_flip ( $l )); foreach ( $l
as $m => $T ){ $Mg = h ( ME ) . " db= " . urlencode ( $m ); $u = h ( " Db- " . $m ); echo " <tr " . odd () . " > " . ( support ( " database " ) ? " <td> " . checkbox ( " db[] " , $m , in_array ( $m ,( array ) $_POST [ " db " ]), " " , " " , " " , $u ) : " " ), " <th><a href=' $Mg ' id=' $u '> " . h ( $m ) . " </a> " ; $pb = nbsp ( db_collation ( $m , $qb )); echo " <td> " . ( support ( " database " ) ? " <a href=' $Mg " . ( $Ug ? " &ns= " : " " ) . " &database=' title=' " . lang ( 65 ) . " '> $pb </a> " : $pb ), " <td align='right'><a href=' $Mg &schema=' id='tables- " . h ( $m ) . " ' title=' " . lang ( 68 ) . " '> " . ( $_GET [ " dbsize " ] ? $T : " ? " ) . " </a> " , " <td align='right' id='size- " . h ( $m ) . " '> " . ( $_GET [ " dbsize " ] ? db_size ( $m ) : " ? " ), " \n " ;} echo " </table> \n " ,( support ( " database " ) ? " <div class='footer'><div> \n " . " <fieldset><legend> " . lang ( 122 ) . " <span id='selected'></span></legend><div> \n " . " <input type='hidden' name='all' value=''> " . script ( " qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); }; " ) . " <input type='submit' name='drop' value=' " . lang ( 123 ) . " '> " . confirm () . " \n " . " </div></fieldset> \n " . " </div></div> \n " : " " ), " <input type='hidden' name='token' value=' $gi '> \n " , " </form> \n " , script ( " tableCheck(); " );}} page_footer ( " db " );} if ( isset ( $_GET [ " status " ])) $_GET [ " variables " ] = $_GET [ " status " ]; if ( isset ( $_GET [ " import " ])) $_GET [ " sql " ] = $_GET [ " import " ]; if ( ! ( DB != " " ? $g -> select_db ( DB ) : isset ( $_GET [ " sql " ]) || isset ( $_GET [ " dump " ]) || isset ( $_GET [ " database " ]) || isset ( $_GET [ " processlist " ]) || isset ( $_GET [ " privileges " ]) || isset ( $_GET [ " user " ]) || isset ( $_GET [ " variables " ]) || $_GET [ " script " ] == " connect " || $_GET [ " script " ] == " kill " )){ if ( DB != " " || $_GET [ " refresh " ]){ restart_session (); set_session ( " dbs " , null );} connect_error (); exit ;} if ( support ( " scheme " ) && DB != " " && $_GET [ " ns " ] !== " " ){ if ( ! isset ( $_GET [ " ns " ])) redirect ( preg_replace ( '~ns=[^&]*&~' , '' , ME ) . " ns= " . get_schema ()); if ( ! set_schema ( $_GET [ " ns " ])){ header ( " HTTP/1.1 404 Not Found " ); page_header ( lang ( 75 ) . " : " . h ( $_GET [ " ns " ]), lang ( 124 ), true ); page_footer ( " ns " ); exit ;}} $jf = " RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT " ; class
2014-05-08 19:46:08 +02:00
TmpFile { var $handler ; var $size ; function
2017-06-25 00:56:50 +02:00
__construct (){ $this -> handler = tmpfile ();} function
2018-04-01 23:34:54 +02:00
write ( $Ab ){ $this -> size += strlen ( $Ab ); fwrite ( $this -> handler , $Ab );} function
send (){ fseek ( $this -> handler , 0 ); fpassthru ( $this -> handler ); fclose ( $this -> handler );}} $wc = " '(?:''|[^' \\ \\ ]| \\ \\ .)*' " ; $Md = " IN|OUT|INOUT " ; if ( isset ( $_GET [ " select " ]) && ( $_POST [ " edit " ] || $_POST [ " clone " ]) &&! $_POST [ " save " ]) $_GET [ " edit " ] = $_GET [ " select " ]; if ( isset ( $_GET [ " callf " ])) $_GET [ " call " ] = $_GET [ " callf " ]; if ( isset ( $_GET [ " function " ])) $_GET [ " procedure " ] = $_GET [ " function " ]; if ( isset ( $_GET [ " download " ])){ $a = $_GET [ " download " ]; $q = fields ( $a ); header ( " Content-Type: application/octet-stream " ); header ( " Content-Disposition: attachment; filename= " . friendly_url ( " $a - " . implode ( " _ " , $_GET [ " where " ])) . " . " . friendly_url ( $_GET [ " field " ])); $M = array ( idf_escape ( $_GET [ " field " ])); $I = $n -> select ( $a , $M , array ( where ( $_GET , $q )), $M ); $K = ( $I ? $I -> fetch_row () : array ()); echo $n -> value ( $K [ 0 ], $q [ $_GET [ " field " ]]); exit ;} elseif ( isset ( $_GET [ " table " ])){ $a = $_GET [ " table " ]; $q = fields ( $a ); if ( ! $q ) $o = error (); $S = table_status1 ( $a , true ); $D = $b -> tableName ( $S ); page_header (( $q && is_view ( $S ) ? $S [ 'Engine' ] == 'materialized view' ? lang ( 125 ) : lang ( 126 ) : lang ( 127 )) . " : " . ( $D != " " ? $D : h ( $a )), $o ); $b -> selectLinks ( $S ); $vb = $S [ " Comment " ]; if ( $vb != " " ) echo " <p class='nowrap'> " . lang ( 48 ) . " : " . h ( $vb ) . " \n " ; if ( $q ) $b -> tableStructurePrint ( $q ); if ( ! is_view ( $S )){ if ( support ( " indexes " )){ echo " <h3 id='indexes'> " . lang ( 128 ) . " </h3> \n " ; $x = indexes ( $a ); if ( $x ) $b -> tableIndexesPrint ( $x ); echo '<p class="links"><a href="' . h ( ME ) . 'indexes=' . urlencode ( $a ) . '">' . lang ( 129 ) . " </a> \n " ;} if ( fk_support ( $S )){ echo " <h3 id='foreign-keys'> " . lang ( 96 ) . " </h3> \n " ; $dd = foreign_keys ( $a ); if ( $dd ){ echo " <table cellspacing='0'> \n " , " <thead><tr><th> " . lang ( 130 ) . " <td> " . lang ( 131 ) . " <td> " . lang ( 99 ) . " <td> " . lang ( 98 ) . " <td> </thead> \n " ; foreach ( $dd
as $D => $r ){ echo " <tr title=' " . h ( $D ) . " '> " , " <th><i> " . implode ( " </i>, <i> " , array_map ( 'h' , $r [ " source " ])) . " </i> " , " <td><a href=' " . h ( $r [ " db " ] != " " ? preg_replace ( '~db=[^&]*~' , " db= " . urlencode ( $r [ " db " ]), ME ) : ( $r [ " ns " ] != " " ? preg_replace ( '~ns=[^&]*~' , " ns= " . urlencode ( $r [ " ns " ]), ME ) : ME )) . " table= " . urlencode ( $r [ " table " ]) . " '> " . ( $r [ " db " ] != " " ? " <b> " . h ( $r [ " db " ]) . " </b>. " : " " ) . ( $r [ " ns " ] != " " ? " <b> " . h ( $r [ " ns " ]) . " </b>. " : " " ) . h ( $r [ " table " ]) . " </a> " , " (<i> " . implode ( " </i>, <i> " , array_map ( 'h' , $r [ " target " ])) . " </i>) " , " <td> " . nbsp ( $r [ " on_delete " ]) . " \n " , " <td> " . nbsp ( $r [ " on_update " ]) . " \n " , '<td><a href="' . h ( ME . 'foreign=' . urlencode ( $a ) . '&name=' . urlencode ( $D )) . '">' . lang ( 132 ) . '</a>' ;} echo " </table> \n " ;} echo '<p class="links"><a href="' . h ( ME ) . 'foreign=' . urlencode ( $a ) . '">' . lang ( 133 ) . " </a> \n " ;}} if ( support ( is_view ( $S ) ? " view_trigger " : " trigger " )){ echo " <h3 id='triggers'> " . lang ( 134 ) . " </h3> \n " ; $si = triggers ( $a ); if ( $si ){ echo " <table cellspacing='0'> \n " ; foreach ( $si
as $z => $X ) echo " <tr valign='top'><td> " . h ( $X [ 0 ]) . " <td> " . h ( $X [ 1 ]) . " <th> " . h ( $z ) . " <td><a href=' " . h ( ME . 'trigger=' . urlencode ( $a ) . '&name=' . urlencode ( $z )) . " '> " . lang ( 132 ) . " </a> \n " ; echo " </table> \n " ;} echo '<p class="links"><a href="' . h ( ME ) . 'trigger=' . urlencode ( $a ) . '">' . lang ( 135 ) . " </a> \n " ;}} elseif ( isset ( $_GET [ " schema " ])){ page_header ( lang ( 68 ), " " , array (), h ( DB . ( $_GET [ " ns " ] ? " . $_GET[ns] " : " " ))); $Jh = array (); $Kh = array (); $ea = ( $_GET [ " schema " ] ? $_GET [ " schema " ] : $_COOKIE [ " adminer_schema- " . str_replace ( " . " , " _ " , DB )]); preg_match_all ( '~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~' , $ea , $ze , PREG_SET_ORDER ); foreach ( $ze
as $t => $C ){ $Jh [ $C [ 1 ]] = array ( $C [ 2 ], $C [ 3 ]); $Kh [] = " \n \t ' " . js_escape ( $C [ 1 ]) . " ': [ $C[2] , $C[3] ] " ;} $hi = 0 ; $Ra =- 1 ; $Tg = array (); $zg = array (); $ne = array (); foreach ( table_status ( '' , true ) as $R => $S ){ if ( is_view ( $S )) continue ; $Xf = 0 ; $Tg [ $R ][ " fields " ] = array (); foreach ( fields ( $R ) as $D => $p ){ $Xf += 1.25 ; $p [ " pos " ] = $Xf ; $Tg [ $R ][ " fields " ][ $D ] = $p ;} $Tg [ $R ][ " pos " ] = ( $Jh [ $R ] ? $Jh [ $R ] : array ( $hi , 0 )); foreach ( $b -> foreignKeys ( $R ) as $X ){ if ( ! $X [ " db " ]){ $le = $Ra ; if ( $Jh [ $R ][ 1 ] || $Jh [ $X [ " table " ]][ 1 ]) $le = min ( floatval ( $Jh [ $R ][ 1 ]), floatval ( $Jh [ $X [ " table " ]][ 1 ])) - 1 ; else $Ra -=. 1 ; while ( $ne [( string ) $le ]) $le -=. 0001 ; $Tg [ $R ][ " references " ][ $X [ " table " ]][( string ) $le ] = array ( $X [ " source " ], $X [ " target " ]); $zg [ $X [ " table " ]][ $R ][( string ) $le ] = $X [ " target " ]; $ne [( string ) $le ] = true ;}} $hi = max ( $hi , $Tg [ $R ][ " pos " ][ 0 ] + 2.5 + $Xf );} echo '<div id="schema" style="height: ' , $hi , ' em ; " >
< script ',nonce(),' >
qs ( \ ' #schema\').onselectstart = function () { return false; };
var tablePos = { ',implode(",",$Kh)."\n",' };
var em = qs ( \ '#schema\').offsetHeight / ' , $hi , ' ;
2014-05-08 19:46:08 +02:00
document . onmousemove = schemaMousemove ;
2018-04-01 23:34:54 +02:00
document . onmouseup = partialArg ( schemaMouseup , \ '' , js_escape ( DB ), ' \ ' );
2014-05-08 19:46:08 +02:00
</ script >
2018-04-01 23:34:54 +02:00
' ; foreach ( $Tg
as $D => $R ){ echo " <div class='table' style='top: " . $R [ " pos " ][ 0 ] . " em; left: " . $R [ " pos " ][ 1 ] . " em;'> " , '<a href="' . h ( ME ) . 'table=' . urlencode ( $D ) . '"><b>' . h ( $D ) . " </b></a> " , script ( " qsl('div').onmousedown = schemaMousedown; " ); foreach ( $R [ " fields " ] as $p ){ $X = '<span' . type_class ( $p [ " type " ]) . ' title="' . h ( $p [ " full_type " ] . ( $p [ " null " ] ? " NULL " : '' )) . '">' . h ( $p [ " field " ]) . '</span>' ; echo " <br> " . ( $p [ " primary " ] ? " <i> $X </i> " : $X );} foreach (( array ) $R [ " references " ] as $Qh => $_g ){ foreach ( $_g
as $le => $wg ){ $me = $le - $Jh [ $D ][ 1 ]; $t = 0 ; foreach ( $wg [ 0 ] as $nh ) echo " \n <div class='references' title=' " . h ( $Qh ) . " ' id='refs $le - " . ( $t ++ ) . " ' style='left: $me " . " em; top: " . $R [ " fields " ][ $nh ][ " pos " ] . " em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: " . ( - $me ) . " em;'></div></div> " ;}} foreach (( array ) $zg [ $D ] as $Qh => $_g ){ foreach ( $_g
as $le => $e ){ $me = $le - $Jh [ $D ][ 1 ]; $t = 0 ; foreach ( $e
as $Ph ) echo " \n <div class='references' title=' " . h ( $Qh ) . " ' id='refd $le - " . ( $t ++ ) . " ' style='left: $me " . " em; top: " . $R [ " fields " ][ $Ph ][ " pos " ] . " em; height: 1.25em; background: url( " . h ( preg_replace ( " ~ \\ ?.*~ " , " " , ME ) . " ?file=arrow.gif) no-repeat right center;&version=4.6.2 " ) . " '><div style='height: .5em; border-bottom: 1px solid Gray; width: " . ( - $me ) . " em;'></div></div> " ;}} echo " \n </div> \n " ;} foreach ( $Tg
as $D => $R ){ foreach (( array ) $R [ " references " ] as $Qh => $_g ){ foreach ( $_g
as $le => $wg ){ $Ne = $hi ; $Ce =- 10 ; foreach ( $wg [ 0 ] as $z => $nh ){ $Yf = $R [ " pos " ][ 0 ] + $R [ " fields " ][ $nh ][ " pos " ]; $Zf = $Tg [ $Qh ][ " pos " ][ 0 ] + $Tg [ $Qh ][ " fields " ][ $wg [ 1 ][ $z ]][ " pos " ]; $Ne = min ( $Ne , $Yf , $Zf ); $Ce = max ( $Ce , $Yf , $Zf );} echo " <div class='references' id='refl $le ' style='left: $le " . " em; top: $Ne " . " em; padding: .5em 0;'><div style='border-right: 1px solid Gray; margin-top: 1px; height: " . ( $Ce - $Ne ) . " em;'></div></div> \n " ;}}} echo ' </ div >
< p class = " links " >< a href = " ',h(ME. " schema = " .urlencode( $ea )),' " id = " schema-link " > ',lang(136),' </ a >
';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$o){$Db="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$z)$Db.="&$z=".urlencode($_POST[$z]);cookie("adminer_export",substr($Db,1));$T=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$Ic=dump_headers((count($T)==1?key($T):DB),(DB==""||count($T)>1));$Ud=preg_match(' ~ sql ~ ' , $_POST [ " format " ]); if ( $Ud ){ echo " -- Adminer $ia " . $ec [ DRIVER ] . " dump \n \n " ; if ( $y == " sql " ){ echo " SET NAMES utf8;
2014-05-08 19:46:08 +02:00
SET time_zone = '+00:00' ;
" .( $_POST["data_style"] ? " SET foreign_key_checks = 0 ;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' ;
" : " " ). "
2018-04-01 23:34:54 +02:00
" ; $g->query ( " SET time_zone = '+00:00' ; " );}} $Ah = $_POST["db_style"] ; $l =array(DB);if(DB== " " ) { $l = $_POST [ " databases " ]; if ( is_string ( $l )) $l = explode ( " \n " , rtrim ( str_replace ( " \r " , " " , $l ), " \n " )); } foreach((array) $l
as $m ){ $b -> dumpDatabase ( $m ); if ( $g -> select_db ( $m )){ if ( $Ud && preg_match ( '~CREATE~' , $Ah ) && ( $i = $g -> result ( " SHOW CREATE DATABASE " . idf_escape ( $m ), 1 ))){ set_utf8mb4 ( $i ); if ( $Ah == " DROP+CREATE " ) echo " DROP DATABASE IF EXISTS " . idf_escape ( $m ) . " ; \n " ; echo " $i ; \n " ;} if ( $Ud ){ if ( $Ah ) echo
use_sql ( $m ) . " ; \n \n " ; $Cf = " " ; if ( $_POST [ " routines " ]){ foreach ( array ( " FUNCTION " , " PROCEDURE " ) as $Ng ){ foreach ( get_rows ( " SHOW $Ng STATUS WHERE Db = " . q ( $m ), null , " -- " ) as $K ){ $i = remove_definer ( $g -> result ( " SHOW CREATE $Ng " . idf_escape ( $K [ " Name " ]), 2 )); set_utf8mb4 ( $i ); $Cf .= ( $Ah != 'DROP+CREATE' ? " DROP $Ng IF EXISTS " . idf_escape ( $K [ " Name " ]) . " ;; \n " : " " ) . " $i ;; \n \n " ;}}} if ( $_POST [ " events " ]){ foreach ( get_rows ( " SHOW EVENTS " , null , " -- " ) as $K ){ $i = remove_definer ( $g -> result ( " SHOW CREATE EVENT " . idf_escape ( $K [ " Name " ]), 3 )); set_utf8mb4 ( $i ); $Cf .= ( $Ah != 'DROP+CREATE' ? " DROP EVENT IF EXISTS " . idf_escape ( $K [ " Name " ]) . " ;; \n " : " " ) . " $i ;; \n \n " ;}} if ( $Cf ) echo " DELIMITER ;; \n \n $Cf " . " DELIMITER ; \n \n " ;} if ( $_POST [ " table_style " ] || $_POST [ " data_style " ]){ $Si = array (); foreach ( table_status ( '' , true ) as $D => $S ){ $R = ( DB == " " || in_array ( $D ,( array ) $_POST [ " tables " ])); $Lb = ( DB == " " || in_array ( $D ,( array ) $_POST [ " data " ])); if ( $R || $Lb ){ if ( $Ic == " tar " ){ $di = new
TmpFile ; ob_start ( array ( $di , 'write' ), 1e5 );} $b -> dumpTable ( $D ,( $R ? $_POST [ " table_style " ] : " " ),( is_view ( $S ) ? 2 : 0 )); if ( is_view ( $S )) $Si [] = $D ; elseif ( $Lb ){ $q = fields ( $D ); $b -> dumpData ( $D , $_POST [ " data_style " ], " SELECT * " . convert_fields ( $q , $q ) . " FROM " . table ( $D ));} if ( $Ud && $_POST [ " triggers " ] && $R && ( $si = trigger_sql ( $D ))) echo " \n DELIMITER ;; \n $si\nDELIMITER ; \n " ; if ( $Ic == " tar " ){ ob_end_flush (); tar_file (( DB != " " ? " " : " $m / " ) . " $D .csv " , $di );} elseif ( $Ud ) echo " \n " ;}} foreach ( $Si
as $Ri ) $b -> dumpTable ( $Ri , $_POST [ " table_style " ], 1 ); if ( $Ic == " tar " ) echo
pack ( " x512 " );}}} if ( $Ud ) echo " -- " . $g -> result ( " SELECT NOW() " ) . " \n " ; exit ;} page_header ( lang ( 71 ), $o ,( $_GET [ " export " ] != " " ? array ( " table " => $_GET [ " export " ]) : array ()), h ( DB )); echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
';$Pb=array(' ',' USE ',' DROP + CREATE ',' CREATE ');$Lh=array(' ',' DROP + CREATE ',' CREATE ');$Mb=array(' ',' TRUNCATE + INSERT ',' INSERT ');if($y=="sql")$Mb[]=' INSERT + UPDATE ';parse_str($_COOKIE["adminer_export"],$K);if(!$K)$K=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($K["events"])){$K["routines"]=$K["events"]=($_GET["dump"]=="");$K["triggers"]=$K["table_style"];}echo"<tr><th>".lang(137)."<td>".html_select("output",$b->dumpOutput(),$K["output"],0)."\n";echo"<tr><th>".lang(138)."<td>".html_select("format",$b->dumpFormat(),$K["format"],0)."\n";echo($y=="sqlite"?"":"<tr><th>".lang(35)."<td>".html_select(' db_style ',$Pb,$K["db_style"]).(support("routine")?checkbox("routines",1,$K["routines"],lang(139)):"").(support("event")?checkbox("events",1,$K["events"],lang(140)):"")),"<tr><th>".lang(119)."<td>".html_select(' table_style ',$Lh,$K["table_style"]).checkbox("auto_increment",1,$K["auto_increment"],lang(49)).(support("trigger")?checkbox("triggers",1,$K["triggers"],lang(134)):""),"<tr><th>".lang(141)."<td>".html_select(' data_style ',$Mb,$K["data_style"]),' </ table >
< p >< input type = " submit " value = " ',lang(71),' " >
< input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
',script("qsl(' table ').onclick = dumpClick;");$cg=array();if(DB!=""){$fb=($a!=""?"":" checked");echo"<thead><tr>","<th style=' text - align : left ; '><label class=' block '><input type=' checkbox ' id=' check - tables '$fb>".lang(119)."</label>".script("qs(' #check-tables').onclick = partial(formCheck, /^tables\\[/);",""),"<th style='text-align: right;'><label class='block'>".lang(141)."<input type='checkbox' id='check-data'$fb></label>".script("qs('#check-data').onclick = partial(formCheck, /^data\\[/);",""),"</thead>\n";$Si="";$Mh=tables_list();foreach($Mh
as $D => $U ){ $bg = preg_replace ( '~_.*~' , '' , $D ); $fb = ( $a == " " || $a == ( substr ( $a , - 1 ) == " % " ? " $bg % " : $D )); $fg = " <tr><td> " . checkbox ( " tables[] " , $D , $fb , $D , " " , " block " ); if ( $U !== null &&! preg_match ( '~table~i' , $U )) $Si .= " $fg\n " ; else
echo " $fg <td align='right'><label class='block'><span id='Rows- " . h ( $D ) . " '></span> " . checkbox ( " data[] " , $D , $fb ) . " </label> \n " ; $cg [ $bg ] ++ ;} echo $Si ; if ( $Mh ) echo
script ( " ajaxSetHtml(' " . js_escape ( ME ) . " script=db'); " );} else { echo " <thead><tr><th style='text-align: left;'> " , " <label class='block'><input type='checkbox' id='check-databases' " . ( $a == " " ? " checked " : " " ) . " > " . lang ( 35 ) . " </label> " , script ( " qs('#check-databases').onclick = partial(formCheck, /^databases \\ [/); " , " " ), " </thead> \n " ; $l = $b -> databases (); if ( $l ){ foreach ( $l
as $m ){ if ( ! information_schema ( $m )){ $bg = preg_replace ( '~_.*~' , '' , $m ); echo " <tr><td> " . checkbox ( " databases[] " , $m , $a == " " || $a == " $bg % " , $m , " " , " block " ) . " \n " ; $cg [ $bg ] ++ ;}}} else
2014-05-08 19:46:08 +02:00
echo " <tr><td><textarea name='databases' rows='10' cols='20'></textarea> " ;} echo ' </ table >
</ form >
2018-04-01 23:34:54 +02:00
' ; $Wc = true ; foreach ( $cg
as $z => $X ){ if ( $z != " " && $X > 1 ){ echo ( $Wc ? " <p> " : " " ) . " <a href=' " . h ( ME ) . " dump= " . urlencode ( " $z % " ) . " '> " . h ( $z ) . " </a> " ; $Wc = false ;}}} elseif ( isset ( $_GET [ " privileges " ])){ page_header ( lang ( 69 )); echo '<p class="links"><a href="' . h ( ME ) . 'user=">' . lang ( 142 ) . " </a> " ; $I = $g -> query ( " SELECT User, Host FROM mysql. " . ( DB == " " ? " user " : " db WHERE " . q ( DB ) . " LIKE Db " ) . " ORDER BY Host, User " ); $kd = $I ; if ( ! $I ) $I = $g -> query ( " SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host " ); echo " <form action=''><p> \n " ; hidden_fields_get (); echo " <input type='hidden' name='db' value=' " . h ( DB ) . " '> \n " ,( $kd ? " " : " <input type='hidden' name='grant' value=''> \n " ), " <table cellspacing='0'> \n " , " <thead><tr><th> " . lang ( 33 ) . " <th> " . lang ( 32 ) . " <th> </thead> \n " ; while ( $K = $I -> fetch_assoc ()) echo '<tr' . odd () . '><td>' . h ( $K [ " User " ]) . " <td> " . h ( $K [ " Host " ]) . '<td><a href="' . h ( ME . 'user=' . urlencode ( $K [ " User " ]) . '&host=' . urlencode ( $K [ " Host " ])) . '">' . lang ( 10 ) . " </a> \n " ; if ( ! $kd || DB != " " ) echo " <tr " . odd () . " ><td><input name='user' autocapitalize='off'><td><input name='host' value='localhost' autocapitalize='off'><td><input type='submit' value=' " . lang ( 10 ) . " '> \n " ; echo " </table> \n " , " </form> \n " ;} elseif ( isset ( $_GET [ " sql " ])){ if ( ! $o && $_POST [ " export " ]){ dump_headers ( " sql " ); $b -> dumpTable ( " " , " " ); $b -> dumpData ( " " , " table " , $_POST [ " query " ]); exit ;} restart_session (); $wd =& get_session ( " queries " ); $vd =& $wd [ DB ]; if ( ! $o && $_POST [ " clear " ]){ $vd = array (); redirect ( remove_from_uri ( " history " ));} page_header (( isset ( $_GET [ " import " ]) ? lang ( 70 ) : lang ( 62 )), $o ); if ( ! $o && $_POST ){ $hd = false ; if ( ! isset ( $_GET [ " import " ])) $H = $_POST [ " query " ]; elseif ( $_POST [ " webfile " ]){ $rh = $b -> importServerPath (); $hd =@ fopen (( file_exists ( $rh ) ? $rh : " compress.zlib:// $rh .gz " ), " rb " ); $H = ( $hd ? fread ( $hd , 1e6 ) : false );} else $H = get_file ( " sql_file " , true ); if ( is_string ( $H )){ if ( function_exists ( 'memory_get_usage' )) @ ini_set ( " memory_limit " , max ( ini_bytes ( " memory_limit " ), 2 * strlen ( $H ) + memory_get_usage () + 8e6 )); if ( $H != " " && strlen ( $H ) < 1e6 ){ $ng = $H . ( preg_match ( " ~;[ \t \r \n ]* \$ ~ " , $H ) ? " " : " ; " ); if ( ! $vd || reset ( end ( $vd )) != $ng ){ restart_session (); $vd [] = array ( $ng , time ()); set_session ( " queries " , $wd ); stop_session ();}} $oh = " (?: \\ s|/ \\ *[ \ s \ S]*? \\ */|(?:#|-- )[^ \n ]* \n ?|-- \r ? \n ) " ; $Vb = " ; " ; $E = 0 ; $tc = true ; $h = connect (); if ( is_object ( $h ) && DB != " " ) $h -> select_db ( DB ); $ub = 0 ; $yc = array (); $Jf = '[\'"' . ( $y == " sql " ? '`#' : ( $y == " sqlite " ? '`[' : ( $y == " mssql " ? '[' : '' ))) . ']|/\\*|-- |$' . ( $y == " pgsql " ? '|\\$[^$]*\\$' : '' ); $ii = microtime ( true ); parse_str ( $_COOKIE [ " adminer_export " ], $ya ); $kc = $b -> dumpFormat (); unset ( $kc [ " sql " ]); while ( $H != " " ){ if ( ! $E && preg_match ( " ~^ $oh *+DELIMITER \\ s+( \\ S+)~i " , $H , $C )){ $Vb = $C [ 1 ]; $H = substr ( $H , strlen ( $C [ 0 ]));} else { preg_match ( '(' . preg_quote ( $Vb ) . " \\ s*| $Jf ) " , $H , $C , PREG_OFFSET_CAPTURE , $E ); list ( $fd , $Xf ) = $C [ 0 ]; if ( ! $fd && $hd &&! feof ( $hd )) $H .= fread ( $hd , 1e5 ); else { if ( ! $fd && rtrim ( $H ) == " " ) break ; $E = $Xf + strlen ( $fd ); if ( $fd && rtrim ( $fd ) != $Vb ){ while ( preg_match ( '(' . ( $fd == '/*' ? '\\*/' : ( $fd == '[' ? ']' : ( preg_match ( '~^-- |^#~' , $fd ) ? " \n " : preg_quote ( $fd ) . " | \\ \\ . " ))) . '|$)s' , $H , $C , PREG_OFFSET_CAPTURE , $E )){ $Rg = $C [ 0 ][ 0 ]; if ( ! $Rg && $hd &&! feof ( $hd )) $H .= fread ( $hd , 1e5 ); else { $E = $C [ 0 ][ 1 ] + strlen ( $Rg ); if ( $Rg [ 0 ] != " \\ " ) break ;}}} else { $tc = false ; $ng = substr ( $H , 0 , $Xf ); $ub ++ ; $fg = " <pre id='sql- $ub '><code class='jush- $y '> " . $b -> sqlCommandQuery ( $ng ) . " </code></pre> \n " ; if ( $y == " sqlite " && preg_match ( " ~^ $oh *+ATTACH \\ b~i " , $ng , $C )){ echo $fg , " <p class='error'> " . lang ( 143 ) . " \n " ; $yc [] = " <a href='#sql- $ub '> $ub </a> " ; if ( $_POST [ " error_stops " ]) break ;} else { if ( ! $_POST [ " only_errors " ]){ echo $fg ; ob_flush (); flush ();} $vh = microtime ( true ); if ( $g -> multi_query ( $ng ) && is_object ( $h ) && preg_match ( " ~^ $oh *+USE \\ b~i " , $ng )) $h -> query ( $ng ); do { $I = $g -> store_result (); if ( $g -> error ){ echo ( $_POST [ " only_errors " ] ? $fg : " " ), " <p class='error'> " . lang ( 144 ) . ( $g -> errno ? " ( $g->errno ) " : " " ) . " : " . error () . " \n " ; $yc [] = " <a href='#sql- $ub '> $ub </a> " ; if ( $_POST [ " error_stops " ]) break
2 ;} else { $Wh = " <span class='time'>( " . format_time ( $vh ) . " )</span> " . ( strlen ( $ng ) < 1000 ? " <a href=' " . h ( ME ) . " sql= " . urlencode ( trim ( $ng )) . " '> " . lang ( 10 ) . " </a> " : " " ); $_a = $g -> affected_rows ; $Vi = ( $_POST [ " only_errors " ] ? " " : $n -> warnings ()); $Wi = " warnings- $ub " ; if ( $Vi ) $Wh .= " , <a href='# $Wi '> " . lang ( 44 ) . " </a> " . script ( " qsl('a').onclick = partial(toggle, ' $Wi '); " , " " ); $Fc = null ; $Gc = " explain- $ub " ; if ( is_object ( $I )){ $_ = $_POST [ " limit " ]; $wf = select ( $I , $h , array (), $_ ); if ( ! $_POST [ " only_errors " ]){ echo " <form action='' method='post'> \n " ; $Ze = $I -> num_rows ; echo " <p> " . ( $Ze ? ( $_ && $Ze > $_ ? lang ( 145 , $_ ) : " " ) . lang ( 146 , $Ze ) : " " ), $Wh ; if ( $h && preg_match ( " ~^( $oh | \\ ()*+SELECT \\ b~i " , $ng ) && ( $Fc = explain ( $h , $ng ))) echo " , <a href='# $Gc '>Explain</a> " . script ( " qsl('a').onclick = partial(toggle, ' $Gc '); " , " " ); $u = " export- $ub " ; echo " , <a href='# $u '> " . lang ( 71 ) . " </a> " . script ( " qsl('a').onclick = partial(toggle, ' $u '); " , " " ) . " <span id=' $u ' class='hidden'>: " . html_select ( " output " , $b -> dumpOutput (), $ya [ " output " ]) . " " . html_select ( " format " , $kc , $ya [ " format " ]) . " <input type='hidden' name='query' value=' " . h ( $ng ) . " '> " . " <input type='submit' name='export' value=' " . lang ( 71 ) . " '><input type='hidden' name='token' value=' $gi '></span> \n " . " </form> \n " ;}} else { if ( preg_match ( " ~^ $oh *+(CREATE|DROP|ALTER) $oh ++(DATABASE|SCHEMA) \\ b~i " , $ng )){ restart_session (); set_session ( " dbs " , null ); stop_session ();} if ( ! $_POST [ " only_errors " ]) echo " <p class='message' title=' " . h ( $g -> info ) . " '> " . lang ( 147 , $_a ) . " $Wh\n " ;} echo ( $Vi ? " <div id=' $Wi ' class='hidden'> \n $Vi </div> \n " : " " ); if ( $Fc ){ echo " <div id=' $Gc ' class='hidden'> \n " ; select ( $Fc , $h , $wf ); echo " </div> \n " ;}} $vh = microtime ( true );} while ( $g -> next_result ());} $H = substr ( $H , $E ); $E = 0 ;}}}} if ( $tc ) echo " <p class='message'> " . lang ( 148 ) . " \n " ; elseif ( $_POST [ " only_errors " ]){ echo " <p class='message'> " . lang ( 149 , $ub - count ( $yc )), " <span class='time'>( " . format_time ( $ii ) . " )</span> \n " ;} elseif ( $yc && $ub > 1 ) echo " <p class='error'> " . lang ( 144 ) . " : " . implode ( " " , $yc ) . " \n " ;} else
echo " <p class='error'> " . upload_error ( $H ) . " \n " ;} echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " enctype = " multipart/form-data " id = " form " >
2018-04-01 23:34:54 +02:00
';$Cc="<input type=' submit ' value=' " .lang(150). " ' title=' Ctrl + Enter '>";if(!isset($_GET["import"])){$ng=$_GET["sql"];if($_POST)$ng=$_POST["query"];elseif($_GET["history"]=="all")$ng=$vd;elseif($_GET["history"]!="")$ng=$vd[$_GET["history"]][0];echo"<p>";textarea("query",$ng,20);echo($_POST?"":script("qs(' textarea ').focus();")),"<p>$Cc\n",lang(151).": <input type=' number ' name=' limit ' class=' size ' value=' " .h( $_POST ? $_POST["limit"] : $_GET["limit"] ). " '>\n";}else{echo"<fieldset><legend>".lang(152)."</legend><div>",(ini_bool("file_uploads")?"SQL (< ".ini_get("upload_max_filesize")."B): <input type=' file ' name=' sql_file [] ' multiple>\n$Cc":lang(153)),"</div></fieldset>\n","<fieldset><legend>".lang(154)."</legend><div>",lang(155,"<code>".h($b->importServerPath()).(extension_loaded("zlib")?"[.gz]":"")."</code>"),' < input type = " submit " name = " webfile " value = " '.lang(156).' " > ' , " </div></fieldset> \n " , " <p> " ;} echo
checkbox ( " error_stops " , 1 ,( $_POST ? $_POST [ " error_stops " ] : isset ( $_GET [ " import " ])), lang ( 157 )) . " \n " , checkbox ( " only_errors " , 1 ,( $_POST ? $_POST [ " only_errors " ] : isset ( $_GET [ " import " ])), lang ( 158 )) . " \n " , " <input type='hidden' name='token' value=' $gi '> \n " ; if ( ! isset ( $_GET [ " import " ]) && $vd ){ print_fieldset ( " history " , lang ( 159 ), $_GET [ " history " ] != " " ); for ( $X = end ( $vd ); $X ; $X = prev ( $vd )){ $z = key ( $vd ); list ( $ng , $Wh , $oc ) = $X ; echo '<a href="' . h ( ME . " sql=&history= $z " ) . '">' . lang ( 10 ) . " </a> " . " <span class='time' title=' " .@ date ( 'Y-m-d' , $Wh ) . " '> " .@ date ( " H:i:s " , $Wh ) . " </span> " . " <code class='jush- $y '> " . shorten_utf8 ( ltrim ( str_replace ( " \n " , " " , str_replace ( " \r " , " " , preg_replace ( '~^(#|-- ).*~m' , '' , $ng )))), 80 , " </code> " ) . ( $oc ? " <span class='time'>( $oc )</span> " : " " ) . " <br> \n " ;} echo " <input type='submit' name='clear' value=' " . lang ( 160 ) . " '> \n " , " <a href=' " . h ( ME . " sql=&history=all " ) . " '> " . lang ( 161 ) . " </a> \n " , " </div></fieldset> \n " ;} echo ' </ form >
' ;} elseif ( isset ( $_GET [ " edit " ])){ $a = $_GET [ " edit " ]; $q = fields ( $a ); $Z = ( isset ( $_GET [ " select " ]) ? ( $_POST [ " check " ] && count ( $_POST [ " check " ]) == 1 ? where_check ( $_POST [ " check " ][ 0 ], $q ) : " " ) : where ( $_GET , $q )); $Ci = ( isset ( $_GET [ " select " ]) ? $_POST [ " edit " ] : $Z ); foreach ( $q
as $D => $p ){ if ( ! isset ( $p [ " privileges " ][ $Ci ? " update " : " insert " ]) || $b -> fieldName ( $p ) == " " ) unset ( $q [ $D ]);} if ( $_POST &&! $o &&! isset ( $_GET [ " select " ])){ $B = $_POST [ " referer " ]; if ( $_POST [ " insert " ]) $B = ( $Ci ? null : $_SERVER [ " REQUEST_URI " ]); elseif ( ! preg_match ( '~^.+&select=.+$~' , $B )) $B = ME . " select= " . urlencode ( $a ); $x = indexes ( $a ); $yi = unique_array ( $_GET [ " where " ], $x ); $qg = " \n WHERE $Z " ; if ( isset ( $_POST [ " delete " ])) queries_redirect ( $B , lang ( 162 ), $n -> delete ( $a , $qg , ! $yi )); else { $P = array (); foreach ( $q
as $D => $p ){ $X = process_input ( $p ); if ( $X !== false && $X !== null ) $P [ idf_escape ( $D )] = $X ;} if ( $Ci ){ if ( ! $P ) redirect ( $B ); queries_redirect ( $B , lang ( 163 ), $n -> update ( $a , $P , $qg , ! $yi )); if ( is_ajax ()){ page_headers (); page_messages ( $o ); exit ;}} else { $I = $n -> insert ( $a , $P ); $ke = ( $I ? last_id () : 0 ); queries_redirect ( $B , lang ( 164 ,( $ke ? " $ke " : " " )), $I );}}} $K = null ; if ( $_POST [ " save " ]) $K = ( array ) $_POST [ " fields " ]; elseif ( $Z ){ $M = array (); foreach ( $q
as $D => $p ){ if ( isset ( $p [ " privileges " ][ " select " ])){ $Ha = convert_field ( $p ); if ( $_POST [ " clone " ] && $p [ " auto_increment " ]) $Ha = " '' " ; if ( $y == " sql " && preg_match ( " ~enum|set~ " , $p [ " type " ])) $Ha = " 1* " . idf_escape ( $D ); $M [] = ( $Ha ? " $Ha AS " : " " ) . idf_escape ( $D );}} $K = array (); if ( ! support ( " table " )) $M = array ( " * " ); if ( $M ){ $I = $n -> select ( $a , $M , array ( $Z ), $M , array (),( isset ( $_GET [ " select " ]) ? 2 : 1 )); if ( ! $I ) $o = error (); else { $K = $I -> fetch_assoc (); if ( ! $K ) $K = false ;} if ( isset ( $_GET [ " select " ]) && ( ! $K || $I -> fetch_assoc ())) $K = null ;}} if ( ! support ( " table " ) &&! $q ){ if ( ! $Z ){ $I = $n -> select ( $a , array ( " * " ), $Z , array ( " * " )); $K = ( $I ? $I -> fetch_assoc () : false ); if ( ! $K ) $K = array ( $n -> primary => " " );} if ( $K ){ foreach ( $K
as $z => $X ){ if ( ! $Z ) $K [ $z ] = null ; $q [ $z ] = array ( " field " => $z , " null " => ( $z != $n -> primary ), " auto_increment " => ( $z == $n -> primary ));}}} edit_form ( $a , $q , $K , $Ci );} elseif ( isset ( $_GET [ " create " ])){ $a = $_GET [ " create " ]; $Lf = array (); foreach ( array ( 'HASH' , 'LINEAR HASH' , 'KEY' , 'LINEAR KEY' , 'RANGE' , 'LIST' ) as $z ) $Lf [ $z ] = $z ; $yg = referencable_primary ( $a ); $dd = array (); foreach ( $yg
as $Hh => $p ) $dd [ str_replace ( " ` " , " `` " , $Hh ) . " ` " . str_replace ( " ` " , " `` " , $p [ " field " ])] = $Hh ; $zf = array (); $S = array (); if ( $a != " " ){ $zf = fields ( $a ); $S = table_status ( $a ); if ( ! $S ) $o = lang ( 9 );} $K = $_POST ; $K [ " fields " ] = ( array ) $K [ " fields " ]; if ( $K [ " auto_increment_col " ]) $K [ " fields " ][ $K [ " auto_increment_col " ]][ " auto_increment " ] = true ; if ( $_POST &&! process_fields ( $K [ " fields " ]) &&! $o ){ if ( $_POST [ " drop " ]) queries_redirect ( substr ( ME , 0 , - 1 ), lang ( 165 ), drop_tables ( array ( $a ))); else { $q = array (); $Ea = array (); $Hi = false ; $bd = array (); $yf = reset ( $zf ); $Ba = " FIRST " ; foreach ( $K [ " fields " ] as $z => $p ){ $r = $dd [ $p [ " type " ]]; $ti = ( $r !== null ? $yg [ $r ] : $p ); if ( $p [ " field " ] != " " ){ if ( ! $p [ " has_default " ]) $p [ " default " ] = null ; if ( $z == $K [ " auto_increment_col " ]) $p [ " auto_increment " ] = true ; $kg = process_field ( $p , $ti ); $Ea [] = array ( $p [ " orig " ], $kg , $Ba ); if ( $kg != process_field ( $yf , $yf )){ $q [] = array ( $p [ " orig " ], $kg , $Ba ); if ( $p [ " orig " ] != " " || $Ba ) $Hi = true ;} if ( $r !== null ) $bd [ idf_escape ( $p [ " field " ])] = ( $a != " " && $y != " sqlite " ? " ADD " : " " ) . format_foreign_key ( array ( 'table' => $dd [ $p [ " type " ]], 'source' => array ( $p [ " field " ]), 'target' => array ( $ti [ " field " ]), 'on_delete' => $p [ " on_delete " ],)); $Ba = " AFTER " . idf_escape ( $p [ " field " ]);} elseif ( $p [ " orig " ] != " " ){ $Hi = true ; $q [] = array ( $p [ " orig " ]);} if ( $p [ " orig " ] != " " ){ $yf = next ( $zf ); if ( ! $yf ) $Ba = " " ;}} $Nf = " " ; if ( $Lf [ $K [ " partition_by " ]]){ $Of = array (); if ( $K [ " partition_by " ] == 'RANGE' || $K [ " partition_by " ] == 'LIST' ){ foreach ( array_filter ( $K [ " partition_names " ]) as $z => $X ){ $Y = $K [ " partition_values " ][ $z ]; $Of [] = " \n PARTITION " . idf_escape ( $X ) . " VALUES " . ( $K [ " partition_by " ] == 'RANGE' ? " LESS THAN " : " IN " ) . ( $Y != " " ? " ( $Y ) " : " MAXVALUE " );}} $Nf .= " \n PARTITION BY $K[partition_by] ( $K[partition] ) " . ( $Of ? " ( " . implode ( " , " , $Of ) . " \n ) " : ( $K [ " partitions " ] ? " PARTITIONS " . ( + $K [ " partitions " ]) : " " ));} elseif ( support ( " partitioning " ) && preg_match ( " ~partitioned~ " , $S [ " Create_options " ])) $Nf .= " \n REMOVE PARTITIONING " ; $Ge = lang ( 166 ); if ( $a == " " ){ cookie ( " adminer_engine " , $K [ " Engine " ]); $Ge = lang ( 167 );} $D = trim ( $K [ " name " ]); queries_redirect ( ME . ( support ( " table " ) ? " table= " : " select= " ) . urlencode ( $D ), $Ge , alter_table ( $a , $D ,( $y == " sqlite " && ( $Hi || $bd ) ? $Ea : $q ), $bd ,( $K [ " Comment " ] != $S [ " Comment " ] ? $K [ " Comment " ] : null ),( $K [ " Engine " ] && $K [ " Engine " ] != $S [ " Engine " ] ? $K [ " Engine " ] : " " ),( $K [ " Collation " ] && $K [ " Collation " ] != $S [ " Collation " ] ? $K [ " Collation " ] : " " ),( $K [ " Auto_increment " ] != " " ? number ( $K [ " Auto_increment " ]) : " " ), $Nf ));}} page_header (( $a != " " ? lang ( 42 ) : lang ( 72 )), $o , array ( " table " => $a ), h ( $a )); if ( ! $_POST ){ $K = array ( " Engine " => $_COOKIE [ " adminer_engine " ], " fields " => array ( array ( " field " => " " , " type " => ( isset ( $vi [ " int " ]) ? " int " : ( isset ( $vi [ " integer " ]) ? " integer " : " " )), " on_update " => " " )), " partition_names " => array ( " " ),); if ( $a != " " ){ $K = $S ; $K [ " name " ] = $a ; $K [ " fields " ] = array (); if ( ! $_GET [ " auto_increment " ]) $K [ " Auto_increment " ] = " " ; foreach ( $zf
as $p ){ $p [ " has_default " ] = isset ( $p [ " default " ]); $K [ " fields " ][] = $p ;} if ( support ( " partitioning " )){ $id = " FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q ( DB ) . " AND TABLE_NAME = " . q ( $a ); $I = $g -> query ( " SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $id ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1 " ); list ( $K [ " partition_by " ], $K [ " partitions " ], $K [ " partition " ]) = $I -> fetch_row (); $Of = get_key_vals ( " SELECT PARTITION_NAME, PARTITION_DESCRIPTION $id AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION " ); $Of [ " " ] = " " ; $K [ " partition_names " ] = array_keys ( $Of ); $K [ " partition_values " ] = array_values ( $Of );}}} $qb = collations (); $vc = engines (); foreach ( $vc
as $uc ){ if ( ! strcasecmp ( $uc , $K [ " Engine " ])){ $K [ " Engine " ] = $uc ; break ;}} echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " id = " form " >
< p >
2018-04-01 23:34:54 +02:00
' ; if ( support ( " columns " ) || $a == " " ){ echo
lang ( 168 ), ': <input name="name" maxlength="64" value="' , h ( $K [ " name " ]), ' " autocapitalize= " off " >
' ; if ( $a == " " &&! $_POST ) echo
script ( " focus(qs('#form')['name']); " ); echo ( $vc ? " <select name='Engine'> " . optionlist ( array ( " " => " ( " . lang ( 169 ) . " ) " ) + $vc , $K [ " Engine " ]) . " </select> " . on_help ( " getTarget(event).value " , 1 ) . script ( " qsl('select').onchange = helpClose; " ) : " " ), ' ' ,( $qb &&! preg_match ( " ~sqlite|mssql~ " , $y ) ? html_select ( " Collation " , array ( " " => " ( " . lang ( 97 ) . " ) " ) + $qb , $K [ " Collation " ]) : " " ), ' <input type="submit" value="' , lang ( 14 ), ' " >
2014-05-08 19:46:08 +02:00
';}echo'
';if(support("columns")){echo' < table cellspacing = " 0 " id = " edit-fields " class = " nowrap " >
2018-04-01 23:34:54 +02:00
';$wb=($_POST?$_POST["comments"]:$K["Comment"]!="");if(!$_POST&&!$wb){foreach($K["fields"]as$p){if($p["comment"]!=""){$wb=true;break;}}}edit_fields($K["fields"],$qb,"TABLE",$dd,$wb);echo' </ table >
2014-05-08 19:46:08 +02:00
< p >
2018-04-01 23:34:54 +02:00
',lang(49),' : < input type = " number " name = " Auto_increment " size = " 6 " value = " ',h( $K["Auto_increment"] ),' " >
',checkbox("defaults",1,!$_POST||$_POST["defaults"],lang(170),"columnShow(this.checked, 5)","jsonly"),($_POST?"":script("editingHideDefaults();")),(support("comment")?"<label><input type=' checkbox ' name=' comments ' value=' 1 ' class=' jsonly '".($wb?" checked":"").">".lang(48)."</label>".script("qsl(' input ').onclick = partial(editingCommentsClick, true);").' < input name = " Comment " value = " '.h( $K["Comment"] ).' " maxlength = " '.(min_version(5.5)?2048:60).' " '.($wb?' ':' class = " hidden " ').' > ':' '),' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
';}echo'
2018-04-01 23:34:54 +02:00
';if($a!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$a));}if(support("partitioning")){$Mf=preg_match(' ~ RANGE | LIST ~ ',$K["partition_by"]);print_fieldset("partition",lang(172),$K["partition_by"]);echo' < p >
',"<select name=' partition_by '>".optionlist(array(""=>"")+$Lf,$K["partition_by"])."</select>".on_help("getTarget(event).value.replace(/./, ' PARTITION BY \ $ & ')",1).script("qsl(' select ').onchange = partitionByChange;"),' ( < input name = " partition " value = " ',h( $K["partition"] ),' " > )
',lang(173),' : < input type = " number " name = " partitions " class = " size',( $Mf ||! $K["partition_by"] ? " hidden " : " " ),' " value = " ',h( $K["partitions"] ),' " >
< table cellspacing = " 0 " id = " partition-table " ',($Mf?"":" class=' hidden '"),' >
< thead >< tr >< th > ',lang(174),' < th > ',lang(175),' </ thead >
';foreach($K["partition_names"]as$z=>$X){echo' < tr > ',' < td >< input name = " partition_names[] " value = " '.h( $X ).' " autocapitalize = " off " > ',($z==count($K["partition_names"])-1?script("qsl(' input ').oninput = partitionNameChange;"):' '),' < td >< input name = " partition_values[] " value = " '.h( $K["partition_values"] [ $z ]).' " > ';}echo' </ table >
2014-05-08 19:46:08 +02:00
</ div ></ fieldset >
2018-04-01 23:34:54 +02:00
';}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
',script("qs(' #form')['defaults'].onclick();".(support("comment")?" editingCommentsClick.call(qs('#form')['comments']);":""));}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$Ed=array("PRIMARY","UNIQUE","INDEX");$S=table_status($a,true);if(preg_match('~MyISAM|M?aria'.(min_version(5.6,'10.0.5')?'|InnoDB':'').'~i',$S["Engine"]))$Ed[]="FULLTEXT";if(preg_match('~MyISAM|M?aria'.(min_version(5.7,'10.2.2')?'|InnoDB':'').'~i',$S["Engine"]))$Ed[]="SPATIAL";$x=indexes($a);$dg=array();if($y=="mongo"){$dg=$x["_id_"];unset($Ed[0]);unset($x["_id_"]);}$K=$_POST;if($_POST&&!$o&&!$_POST["add"]&&!$_POST["drop_col"]){$c=array();foreach($K["indexes"]as$w){$D=$w["name"];if(in_array($w["type"],$Ed)){$e=array();$qe=array();$Xb=array();$P=array();ksort($w["columns"]);foreach($w["columns"]as$z=>$d){if($d!=""){$pe=$w["lengths"][$z];$Wb=$w["descs"][$z];$P[]=idf_escape($d).($pe?"(".(+$pe).")":"").($Wb?" DESC":"");$e[]=$d;$qe[]=($pe?$pe:null);$Xb[]=$Wb;}}if($e){$Dc=$x[$D];if($Dc){ksort($Dc["columns"]);ksort($Dc["lengths"]);ksort($Dc["descs"]);if($w["type"]==$Dc["type"]&&array_values($Dc["columns"])===$e&&(!$Dc["lengths"]||array_values($Dc["lengths"])===$qe)&&array_values($Dc["descs"])===$Xb){unset($x[$D]);continue;}}$c[]=array($w["type"],$D,$P);}}}foreach($x
as $D => $Dc ) $c [] = array ( $Dc [ " type " ], $D , " DROP " ); if ( ! $c ) redirect ( ME . " table= " . urlencode ( $a )); queries_redirect ( ME . " table= " . urlencode ( $a ), lang ( 176 ), alter_indexes ( $a , $c ));} page_header ( lang ( 128 ), $o , array ( " table " => $a ), h ( $a )); $q = array_keys ( fields ( $a )); if ( $_POST [ " add " ]){ foreach ( $K [ " indexes " ] as $z => $w ){ if ( $w [ " columns " ][ count ( $w [ " columns " ])] != " " ) $K [ " indexes " ][ $z ][ " columns " ][] = " " ;} $w = end ( $K [ " indexes " ]); if ( $w [ " type " ] || array_filter ( $w [ " columns " ], 'strlen' )) $K [ " indexes " ][] = array ( " columns " => array ( 1 => " " ));} if ( ! $K ){ foreach ( $x
as $z => $w ){ $x [ $z ][ " name " ] = $z ; $x [ $z ][ " columns " ][] = " " ;} $x [] = array ( " columns " => array ( 1 => " " )); $K [ " indexes " ] = $x ;} echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
< table cellspacing = " 0 " class = " nowrap " >
< thead >< tr >
2018-04-01 23:34:54 +02:00
< th id = " label-type " > ',lang(177),' < th >< input type = " submit " class = " wayoff " > ',lang(178),' < th id = " label-name " > ' , lang ( 179 ); ?>
< th >< noscript >< input type = 'image' class = 'icon' name = 'add[0]' src = '" . h(preg_replace("~\\?.*~", "", ME) . "?file=plus.gif&version=4.6.2") . "' alt = '+' title = ' < ? php echo
lang ( 104 ), ' \ ' ></ noscript >& nbsp ;
2014-05-08 19:46:08 +02:00
</ thead >
2018-04-01 23:34:54 +02:00
' ; if ( $dg ){ echo " <tr><td>PRIMARY<td> " ; foreach ( $dg [ " columns " ] as $z => $d ){ echo
select_input ( " disabled " , $q , $d ), " <label><input disabled type='checkbox'> " . lang ( 57 ) . " </label> " ;} echo " <td><td> \n " ;} $Xd = 1 ; foreach ( $K [ " indexes " ] as $w ){ if ( ! $_POST [ " drop_col " ] || $Xd != key ( $_POST [ " drop_col " ])){ echo " <tr><td> " . html_select ( " indexes[ $Xd ][type] " , array ( - 1 => " " ) + $Ed , $w [ " type " ],( $Xd == count ( $K [ " indexes " ]) ? " indexesAddRow.call(this); " : 1 ), " label-type " ), " <td> " ; ksort ( $w [ " columns " ]); $t = 1 ; foreach ( $w [ " columns " ] as $z => $d ){ echo " <span> " . select_input ( " name='indexes[ $Xd ][columns][ $t ]' title=' " . lang ( 46 ) . " ' " ,( $q ? array_combine ( $q , $q ) : $q ), $d , " partial( " . ( $t == count ( $w [ " columns " ]) ? " indexesAddColumn " : " indexesChangeColumn " ) . " , ' " . js_escape ( $y == " sql " ? " " : $_GET [ " indexes " ] . " _ " ) . " ') " ),( $y == " sql " || $y == " mssql " ? " <input type='number' name='indexes[ $Xd ][lengths][ $t ]' class='size' value=' " . h ( $w [ " lengths " ][ $z ]) . " ' title=' " . lang ( 102 ) . " '> " : " " ),( $y != " sql " ? checkbox ( " indexes[ $Xd ][descs][ $t ] " , 1 , $w [ " descs " ][ $z ], lang ( 57 )) : " " ), " </span> " ; $t ++ ;} echo " <td><input name='indexes[ $Xd ][name]' value=' " . h ( $w [ " name " ]) . " ' autocapitalize='off' aria-labelledby='label-name'> \n " , " <td><input type='image' class='icon' name='drop_col[ $Xd ]' src=' " . h ( preg_replace ( " ~ \\ ?.*~ " , " " , ME ) . " ?file=cross.gif&version=4.6.2 " ) . " ' alt='x' title=' " . lang ( 107 ) . " '> " . script ( " qsl('input').onclick = partial(editingRemoveRow, 'indexes \$ 1[type]'); " );} $Xd ++ ;} echo ' </ table >
2014-05-08 19:46:08 +02:00
< p >
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
< input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["database"])){$K=$_POST;if($_POST&&!$o&&!isset($_POST["add_x"])){$D=trim($K["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),lang(180),drop_databases(array(DB)));}elseif(DB!==$D){if(DB!=""){$_GET["db"]=$D;queries_redirect(preg_replace(' ~ \bdb = [ ^& ] *&~ ',' ' , ME ) . " db= " . urlencode ( $D ), lang ( 181 ), rename_database ( $D , $K [ " collation " ]));} else { $l = explode ( " \n " , str_replace ( " \r " , " " , $D )); $Bh = true ; $je = " " ; foreach ( $l
as $m ){ if ( count ( $l ) == 1 || $m != " " ){ if ( ! create_database ( $m , $K [ " collation " ])) $Bh = false ; $je = $m ;}} restart_session (); set_session ( " dbs " , null ); queries_redirect ( ME . " db= " . urlencode ( $je ), lang ( 182 ), $Bh );}} else { if ( ! $K [ " collation " ]) redirect ( substr ( ME , 0 , - 1 )); query_redirect ( " ALTER DATABASE " . idf_escape ( $D ) . ( preg_match ( '~^[a-z0-9_]+$~i' , $K [ " collation " ]) ? " COLLATE $K[collation] " : " " ), substr ( ME , 0 , - 1 ), lang ( 183 ));}} page_header ( DB != " " ? lang ( 65 ) : lang ( 111 ), $o , array (), h ( DB )); $qb = collations (); $D = DB ; if ( $_POST ) $D = $K [ " name " ]; elseif ( DB != " " ) $K [ " collation " ] = db_collation ( DB , $qb ); elseif ( $y == " sql " ){ foreach ( get_vals ( " SHOW GRANTS " ) as $kd ){ if ( preg_match ( '~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~' , $kd , $C ) && $C [ 1 ]){ $D = stripcslashes ( idf_unescape ( " ` $C[2] ` " )); break ;}}} echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
< p >
2018-04-01 23:34:54 +02:00
',($_POST["add_x"]||strpos($D,"\n")?' < textarea id = " name " name = " name " rows = " 10 " cols = " 40 " > '.h($D).' </ textarea >< br > ':' < input name = " name " id = " name " value = " '.h( $D ).' " maxlength = " 64 " autocapitalize = " off " > ')."\n".($qb?html_select("collation",array(""=>"(".lang(97).")")+$qb,$K["collation"]).doc_link(array(' sql '=>"charset-charsets.html",' mariadb '=>"supported-character-sets-and-collations/",' mssql '=>"ms187963.aspx",)):""),script("focus(qs(' #name'));"),'<input type="submit" value="',lang(14),'">
';if(DB!="")echo"<input type=' submit ' name=' drop ' value=' " .lang(123). " '>".confirm(lang(171,DB))."\n";elseif(!$_POST["add_x"]&&$_GET["db"]=="")echo"<input type=' image ' class=' icon ' name=' add ' src=' " .h(preg_replace( " ~ \\ ? .*~ " , " " ,ME). " ? file = plus . gif & version = 4.6 . 2 " ). " ' alt=' + ' title=' " .lang(104). " '>\n";echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
</ form >
';}elseif(isset($_GET["scheme"])){$K=$_POST;if($_POST&&!$o){$A=preg_replace(' ~ ns = [ ^& ] *&~ ',' ' , ME ) . " ns= " ; if ( $_POST [ " drop " ]) query_redirect ( " DROP SCHEMA " . idf_escape ( $_GET [ " ns " ]), $A , lang ( 184 )); else { $D = trim ( $K [ " name " ]); $A .= urlencode ( $D ); if ( $_GET [ " ns " ] == " " ) query_redirect ( " CREATE SCHEMA " . idf_escape ( $D ), $A , lang ( 185 )); elseif ( $_GET [ " ns " ] != $D ) query_redirect ( " ALTER SCHEMA " . idf_escape ( $_GET [ " ns " ]) . " RENAME TO " . idf_escape ( $D ), $A , lang ( 186 )); else
redirect ( $A );}} page_header ( $_GET [ " ns " ] != " " ? lang ( 66 ) : lang ( 67 ), $o ); if ( ! $K ) $K [ " name " ] = $_GET [ " ns " ]; echo '
< form action = " " method = " post " >
< p >< input name = " name " id = " name " value = " ',h( $K["name"] ),' " autocapitalize = " off " >
',script("focus(qs(' #name'));"),'<input type="submit" value="',lang(14),'">
';if($_GET["ns"]!="")echo"<input type=' submit ' name=' drop ' value=' " .lang(123). " '>".confirm(lang(171,$_GET["ns"]))."\n";echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["call"])){$da=($_GET["name"]?$_GET["name"]:$_GET["call"]);page_header(lang(187).": ".h($da),$o);$Ng=routine($_GET["call"],(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$Cd=array();$Cf=array();foreach($Ng["fields"]as$t=>$p){if(substr($p["inout"],-3)=="OUT")$Cf[$t]="@".idf_escape($p["field"])." AS ".idf_escape($p["field"]);if(!$p["inout"]||substr($p["inout"],0,2)=="IN")$Cd[]=$t;}if(!$o&&$_POST){$ab=array();foreach($Ng["fields"]as$z=>$p){if(in_array($z,$Cd)){$X=process_input($p);if($X===false)$X="' '";if(isset($Cf[$z]))$g->query("SET @".idf_escape($p["field"])." = $X");}$ab[]=(isset($Cf[$z])?"@".idf_escape($p["field"]):$X);}$H=(isset($_GET["callf"])?"SELECT":"CALL")." ".table($da)."(".implode(", ",$ab).")";$vh=microtime(true);$I=$g->multi_query($H);$_a=$g->affected_rows;echo$b->selectQuery($H,$vh,!$I);if(!$I)echo"<p class=' error ' > " .error(). " \n " ;else { $h =connect();if(is_object( $h )) $h->select_db (DB);do { $I = $g->store_result ();if(is_object( $I ))select( $I , $h );else
echo " <p class='message'> " . lang ( 188 , $_a ) . " \n " ;} while ( $g -> next_result ()); if ( $Cf ) select ( $g -> query ( " SELECT " . implode ( " , " , $Cf )));}} echo '
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
2018-04-01 23:34:54 +02:00
';if($Cd){echo"<table cellspacing=' 0 ' > \n " ;foreach( $Cd
as $z ){ $p = $Ng [ " fields " ][ $z ]; $D = $p [ " field " ]; echo " <tr><th> " . $b -> fieldName ( $p ); $Y = $_POST [ " fields " ][ $D ]; if ( $Y != " " ){ if ( $p [ " type " ] == " enum " ) $Y =+ $Y ; if ( $p [ " type " ] == " set " ) $Y = array_sum ( $Y );} input ( $p , $Y ,( string ) $_POST [ " function " ][ $D ]); echo " \n " ;} echo " </table> \n " ;} echo ' < p >
< input type = " submit " value = " ',lang(187),' " >
< input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$D=$_GET["name"];$K=$_POST;if($_POST&&!$o&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$Ge=($_POST["drop"]?lang(189):($D!=""?lang(190):lang(191)));$B=ME."table=".urlencode($a);if(!$_POST["drop"]){$K["source"]=array_filter($K["source"],' strlen ');ksort($K["source"]);$Ph=array();foreach($K["source"]as$z=>$X)$Ph[$z]=$K["target"][$z];$K["target"]=$Ph;}if($y=="sqlite")queries_redirect($B,$Ge,recreate_table($a,$a,array(),array(),array(" $D"=>($_POST["drop"]?"":" ".format_foreign_key($K)))));else{$c="ALTER TABLE ".table($a);$fc="\nDROP ".($y=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($D);if($_POST["drop"])query_redirect($c.$fc,$B,$Ge);else{query_redirect($c.($D!=""?"$fc,":"")."\nADD".format_foreign_key($K),$B,$Ge);$o=lang(192)."<br>$o";}}}page_header(lang(193),$o,array("table"=>$a),h($a));if($_POST){ksort($K["source"]);if($_POST["add"])$K["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$K["target"]=array();}elseif($D!=""){$dd=foreign_keys($a);$K=$dd[$D];$K["source"][]="";}else{$K["table"]=$a;$K["source"]=array("");}$nh=array_keys(fields($a));$Ph=($a===$K["table"]?$nh:array_keys(fields($K["table"])));$xg=array_keys(array_filter(table_status(' ',true),' fk_support '));echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
< p >
2018-04-01 23:34:54 +02:00
' ; if ( $K [ " db " ] == " " && $K [ " ns " ] == " " ){ echo
lang ( 194 ), ' :
',html_select("table",$xg,$K["table"],"this.form[' change - js '].value = ' 1 '; this.form.submit();"),' < input type = " hidden " name = " change-js " value = " " >
< noscript >< p >< input type = " submit " name = " change " value = " ',lang(195),' " ></ noscript >
2014-05-08 19:46:08 +02:00
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
< thead >< tr >< th id = " label-source " > ',lang(130),' < th id = " label-target " > ',lang(131),' </ thead >
';$Xd=0;foreach($K["source"]as$z=>$X){echo"<tr>","<td>".html_select("source[".(+$z)."]",array(-1=>"")+$nh,$X,($Xd==count($K["source"])-1?"foreignAddRow.call(this);":1),"label-source"),"<td>".html_select("target[".(+$z)."]",$Ph,$K["target"][$z],1,"label-target");$Xd++;}echo' </ table >
2014-05-08 19:46:08 +02:00
< p >
2018-04-01 23:34:54 +02:00
',lang(99),' : ',html_select("on_delete",array(-1=>"")+explode("|",$jf),$K["on_delete"]),' ',lang(98),' : ',html_select("on_update",array(-1=>"")+explode("|",$jf),$K["on_update"]),doc_link(array(' sql '=>"innodb-foreign-key-constraints.html",' mariadb '=>"foreign-keys/",' pgsql '=>"sql-createtable.html#SQL-CREATETABLE-REFERENCES",' mssql '=>"ms174979.aspx",' oracle '=>"clauses002.htm#sthref2903",)),' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
< noscript >< p >< input type = " submit " name = " add " value = " ',lang(196),' " ></ noscript >
';}if($D!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$D));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["view"])){$a=$_GET["view"];$K=$_POST;$_f="VIEW";if($y=="pgsql"&&$a!=""){$xh=table_status($a);$_f=strtoupper($xh["Engine"]);}if($_POST&&!$o){$D=trim($K["name"]);$Ha=" AS\n$K[select]";$B=ME."table=".urlencode($D);$Ge=lang(197);$U=($_POST["materialized"]?"MATERIALIZED VIEW":"VIEW");if(!$_POST["drop"]&&$a==$D&&$y!="sqlite"&&$U=="VIEW"&&$_f=="VIEW")query_redirect(($y=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($D).$Ha,$B,$Ge);else{$Rh=$D."_adminer_".uniqid();drop_create("DROP $_f ".table($a),"CREATE $U ".table($D).$Ha,"DROP $U ".table($D),"CREATE $U ".table($Rh).$Ha,"DROP $U ".table($Rh),($_POST["drop"]?substr(ME,0,-1):$B),lang(198),$Ge,lang(199),$a,$D);}}if(!$_POST&&$a!=""){$K=view($a);$K["name"]=$a;$K["materialized"]=($_f!="VIEW");if(!$o)$o=error();}page_header(($a!=""?lang(41):lang(200)),$o,array("table"=>$a),h($a));echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
2018-04-01 23:34:54 +02:00
< p > ',lang(179),' : < input name = " name " value = " ',h( $K["name"] ),' " maxlength = " 64 " autocapitalize = " off " >
',(support("materializedview")?" ".checkbox("materialized",1,$K["materialized"],lang(125)):""),' < p > ';textarea("select",$K["select"]);echo' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
';if($a!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$a));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$Pd=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$yh=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$K=$_POST;if($_POST&&!$o){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),lang(201));elseif(in_array($K["INTERVAL_FIELD"],$Pd)&&isset($yh[$K["STATUS"]])){$Sg="\nON SCHEDULE ".($K["INTERVAL_VALUE"]?"EVERY ".q($K["INTERVAL_VALUE"])." $K[INTERVAL_FIELD]".($K["STARTS"]?" STARTS ".q($K["STARTS"]):"").($K["ENDS"]?" ENDS ".q($K["ENDS"]):""):"AT ".q($K["STARTS"]))." ON COMPLETION".($K["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?lang(202):lang(203)),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$Sg.($aa!=$K["EVENT_NAME"]?"\nRENAME TO ".idf_escape($K["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($K["EVENT_NAME"]).$Sg)."\n".$yh[$K["STATUS"]]." COMMENT ".q($K["EVENT_COMMENT"]).rtrim(" DO\n$K[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?lang(204).": ".h($aa):lang(205)),$o);if(!$K&&$aa!=""){$L=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$K=reset($L);}echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
< tr >< th > ',lang(179),' < td >< input name = " EVENT_NAME " value = " ',h( $K["EVENT_NAME"] ),' " maxlength = " 64 " autocapitalize = " off " >
< tr >< th title = " datetime " > ',lang(206),' < td >< input name = " STARTS " value = " ',h( " $K [ EXECUTE_AT ] $K [ STARTS ] " ),' " >
< tr >< th title = " datetime " > ',lang(207),' < td >< input name = " ENDS " value = " ',h( $K["ENDS"] ),' " >
< tr >< th > ',lang(208),' < td >< input type = " number " name = " INTERVAL_VALUE " value = " ',h( $K["INTERVAL_VALUE"] ),' " class = " size " > ',html_select("INTERVAL_FIELD",$Pd,$K["INTERVAL_FIELD"]),' < tr >< th > ',lang(114),' < td > ',html_select("STATUS",$yh,$K["STATUS"]),' < tr >< th > ',lang(48),' < td >< input name = " EVENT_COMMENT " value = " ',h( $K["EVENT_COMMENT"] ),' " maxlength = " 64 " >
< tr >< th >& nbsp ; < td > ',checkbox("ON_COMPLETION","PRESERVE",$K["ON_COMPLETION"]=="PRESERVE",lang(209)),' </ table >
< p > ';textarea("EVENT_DEFINITION",$K["EVENT_DEFINITION"]);echo' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
';if($aa!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$aa));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["procedure"])){$da=($_GET["name"]?$_GET["name"]:$_GET["procedure"]);$Ng=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$K=$_POST;$K["fields"]=(array)$K["fields"];if($_POST&&!process_fields($K["fields"])&&!$o){$xf=routine($_GET["procedure"],$Ng);$Rh="$K[name]_adminer_".uniqid();drop_create("DROP $Ng ".routine_id($da,$xf),create_routine($Ng,$K),"DROP $Ng ".routine_id($K["name"],$K),create_routine($Ng,array("name"=>$Rh)+$K),"DROP $Ng ".routine_id($Rh,$K),substr(ME,0,-1),lang(210),lang(211),lang(212),$da,$K["name"]);}page_header(($da!=""?(isset($_GET["function"])?lang(213):lang(214)).": ".h($da):(isset($_GET["function"])?lang(215):lang(216))),$o);if(!$_POST&&$da!=""){$K=routine($_GET["procedure"],$Ng);$K["name"]=$da;}$qb=get_vals("SHOW CHARACTER SET");sort($qb);$Og=routine_languages();echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " id = " form " >
2018-04-01 23:34:54 +02:00
< p > ',lang(179),' : < input name = " name " value = " ',h( $K["name"] ),' " maxlength = " 64 " autocapitalize = " off " >
',($Og?lang(19).": ".html_select("language",$Og,$K["language"])."\n":""),' < input type = " submit " value = " ',lang(14),' " >
2014-05-08 19:46:08 +02:00
< table cellspacing = " 0 " class = " nowrap " >
2018-04-01 23:34:54 +02:00
';edit_fields($K["fields"],$qb,$Ng);if(isset($_GET["function"])){echo"<tr><td>".lang(217);edit_type("returns",$K["returns"],$qb,array(),($y=="pgsql"?array("void","trigger"):array()));}echo' </ table >
< p > ';textarea("definition",$K["definition"]);echo' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
';if($da!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$da));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
' ;} elseif ( isset ( $_GET [ " sequence " ])){ $fa = $_GET [ " sequence " ]; $K = $_POST ; if ( $_POST &&! $o ){ $A = substr ( ME , 0 , - 1 ); $D = trim ( $K [ " name " ]); if ( $_POST [ " drop " ]) query_redirect ( " DROP SEQUENCE " . idf_escape ( $fa ), $A , lang ( 218 )); elseif ( $fa == " " ) query_redirect ( " CREATE SEQUENCE " . idf_escape ( $D ), $A , lang ( 219 )); elseif ( $fa != $D ) query_redirect ( " ALTER SEQUENCE " . idf_escape ( $fa ) . " RENAME TO " . idf_escape ( $D ), $A , lang ( 220 )); else
redirect ( $A );} page_header ( $fa != " " ? lang ( 221 ) . " : " . h ( $fa ) : lang ( 222 ), $o ); if ( ! $K ) $K [ " name " ] = $fa ; echo '
< form action = " " method = " post " >
< p >< input name = " name " value = " ',h( $K["name"] ),' " autocapitalize = " off " >
< input type = " submit " value = " ',lang(14),' " >
';if($fa!="")echo"<input type=' submit ' name=' drop ' value=' " .lang(123). " '>".confirm(lang(171,$fa))."\n";echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
</ form >
' ;} elseif ( isset ( $_GET [ " type " ])){ $ga = $_GET [ " type " ]; $K = $_POST ; if ( $_POST &&! $o ){ $A = substr ( ME , 0 , - 1 ); if ( $_POST [ " drop " ]) query_redirect ( " DROP TYPE " . idf_escape ( $ga ), $A , lang ( 223 )); else
query_redirect ( " CREATE TYPE " . idf_escape ( trim ( $K [ " name " ])) . " $K[as] " , $A , lang ( 224 ));} page_header ( $ga != " " ? lang ( 225 ) . " : " . h ( $ga ) : lang ( 226 ), $o ); if ( ! $K ) $K [ " as " ] = " AS " ; echo '
< form action = " " method = " post " >
< p >
';if($ga!="")echo"<input type=' submit ' name=' drop ' value=' " .lang(123). " '>".confirm(lang(171,$ga))."\n";else{echo"<input name=' name ' value=' " .h( $K['name'] ). " ' autocapitalize=' off '>\n";textarea("as",$K["as"]);echo"<p><input type=' submit ' value=' " .lang(14). " '>\n";}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
</ form >
';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$D=$_GET["name"];$ri=trigger_options();$K=(array)trigger($D)+array("Trigger"=>$a."_bi");if($_POST){if(!$o&&in_array($_POST["Timing"],$ri["Timing"])&&in_array($_POST["Event"],$ri["Event"])&&in_array($_POST["Type"],$ri["Type"])){$if=" ON ".table($a);$fc="DROP TRIGGER ".idf_escape($D).($y=="pgsql"?$if:"");$B=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($fc,$B,lang(227));else{if($D!="")queries($fc);queries_redirect($B,($D!=""?lang(228):lang(229)),queries(create_trigger($if,$_POST)));if($D!="")queries(create_trigger($if,$K+array("Type"=>reset($ri["Type"]))));}}$K=$_POST;}page_header(($D!=""?lang(230).": ".h($D):lang(231)),$o,array("table"=>$a));echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " id = " form " >
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
< tr >< th > ',lang(232),' < td > ',html_select("Timing",$ri["Timing"],$K["Timing"],"triggerChange(/^".preg_quote($a,"/")."_[ba][iud]$/, ' " .js_escape( $a ). " ', this.form);"),' < tr >< th > ',lang(233),' < td > ',html_select("Event",$ri["Event"],$K["Event"],"this.form[' Timing '].onchange();"),(in_array("UPDATE OF",$ri["Event"])?" <input name=' Of ' value=' " .h( $K["Of"] ). " ' class=' hidden '>":""),' < tr >< th > ',lang(47),' < td > ',html_select("Type",$ri["Type"],$K["Type"]),' </ table >
< p > ',lang(179),' : < input name = " Trigger " value = " ',h( $K["Trigger"] ),' " maxlength = " 64 " autocapitalize = " off " >
',script("qs(' #form')['Timing'].onchange();"),'<p>';textarea("Statement",$K["Statement"]);echo'<p>
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
';if($D!=""){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,$D));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$ig=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$K){foreach(explode(",",($K["Privilege"]=="Grant option"?"":$K["Context"]))as$Bb)$ig[$Bb][$K["Privilege"]]=$K["Comment"];}$ig["Server Admin"]+=$ig["File access on server"];$ig["Databases"]["Create routine"]=$ig["Procedures"]["Create routine"];unset($ig["Procedures"]["Create routine"]);$ig["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$ig["Columns"][$X]=$ig["Tables"][$X];unset($ig["Server Admin"]["Usage"]);foreach($ig["Tables"]as$z=>$X)unset($ig["Databases"][$z]);$Te=array();if($_POST){foreach($_POST["objects"]as$z=>$X)$Te[$X]=(array)$Te[$X]+(array)$_POST["grants"][$z];}$ld=array();$gf="";if(isset($_GET["host"])&&($I=$g->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($K=$I->fetch_row()){if(preg_match(' ~ GRANT ( .* ) ON ( .* ) TO ~ ',$K[0],$C)&&preg_match_all(' ~ * ([ ^ (,] * [ ^ ,(])( * \\ ([ ^ )] + \\ )) ? ~ ' , $C [ 1 ], $ze , PREG_SET_ORDER )){ foreach ( $ze
as $X ){ if ( $X [ 1 ] != " USAGE " ) $ld [ " $C[2] $X[2] " ][ $X [ 1 ]] = true ; if ( preg_match ( '~ WITH GRANT OPTION~' , $K [ 0 ])) $ld [ " $C[2] $X[2] " ][ " GRANT OPTION " ] = true ;}} if ( preg_match ( " ~ IDENTIFIED BY PASSWORD '([^']+)~ " , $K [ 0 ], $C )) $gf = $C [ 1 ];}} if ( $_POST &&! $o ){ $hf = ( isset ( $_GET [ " host " ]) ? q ( $ha ) . " @ " . q ( $_GET [ " host " ]) : " '' " ); if ( $_POST [ " drop " ]) query_redirect ( " DROP USER $hf " , ME . " privileges= " , lang ( 234 )); else { $Ve = q ( $_POST [ " user " ]) . " @ " . q ( $_POST [ " host " ]); $Qf = $_POST [ " pass " ]; if ( $Qf != '' &&! $_POST [ " hashed " ]){ $Qf = $g -> result ( " SELECT PASSWORD( " . q ( $Qf ) . " ) " ); $o =! $Qf ;} $Gb = false ; if ( ! $o ){ if ( $hf != $Ve ){ $Gb = queries (( min_version ( 5 ) ? " CREATE USER " : " GRANT USAGE ON *.* TO " ) . " $Ve IDENTIFIED BY PASSWORD " . q ( $Qf )); $o =! $Gb ;} elseif ( $Qf != $gf ) queries ( " SET PASSWORD FOR $Ve = " . q ( $Qf ));} if ( ! $o ){ $Kg = array (); foreach ( $Te
as $bf => $kd ){ if ( isset ( $_GET [ " grant " ])) $kd = array_filter ( $kd ); $kd = array_keys ( $kd ); if ( isset ( $_GET [ " grant " ])) $Kg = array_diff ( array_keys ( array_filter ( $Te [ $bf ], 'strlen' )), $kd ); elseif ( $hf == $Ve ){ $ef = array_keys (( array ) $ld [ $bf ]); $Kg = array_diff ( $ef , $kd ); $kd = array_diff ( $kd , $ef ); unset ( $ld [ $bf ]);} if ( preg_match ( '~^(.+)\\s*(\\(.*\\))?$~U' , $bf , $C ) && ( ! grant ( " REVOKE " , $Kg , $C [ 2 ], " ON $C[1] FROM $Ve " ) ||! grant ( " GRANT " , $kd , $C [ 2 ], " ON $C[1] TO $Ve " ))){ $o = true ; break ;}}} if ( ! $o && isset ( $_GET [ " host " ])){ if ( $hf != $Ve ) queries ( " DROP USER $hf " ); elseif ( ! isset ( $_GET [ " grant " ])){ foreach ( $ld
as $bf => $Kg ){ if ( preg_match ( '~^(.+)(\\(.*\\))?$~U' , $bf , $C )) grant ( " REVOKE " , array_keys ( $Kg ), $C [ 2 ], " ON $C[1] FROM $Ve " );}}} queries_redirect ( ME . " privileges= " ,( isset ( $_GET [ " host " ]) ? lang ( 235 ) : lang ( 236 )), ! $o ); if ( $Gb ) $g -> query ( " DROP USER $Ve " );}} page_header (( isset ( $_GET [ " host " ]) ? lang ( 33 ) . " : " . h ( " $ha @ $_GET[host] " ) : lang ( 142 )), $o , array ( " privileges " => array ( '' , lang ( 69 )))); if ( $_POST ){ $K = $_POST ; $ld = $Te ;} else { $K = $_GET + array ( " host " => $g -> result ( " SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1) " )); $K [ " pass " ] = $gf ; if ( $gf != " " ) $K [ " hashed " ] = true ; $ld [( DB == " " || $ld ? " " : idf_escape ( addcslashes ( DB , " %_ \\ " ))) . " .* " ] = array ();} echo ' < form action = " " method = " post " >
2014-05-08 19:46:08 +02:00
< table cellspacing = " 0 " >
2018-04-01 23:34:54 +02:00
< tr >< th > ',lang(32),' < td >< input name = " host " maxlength = " 60 " value = " ',h( $K["host"] ),' " autocapitalize = " off " >
< tr >< th > ',lang(33),' < td >< input name = " user " maxlength = " 16 " value = " ',h( $K["user"] ),' " autocapitalize = " off " >
< tr >< th > ',lang(34),' < td >< input name = " pass " id = " pass " value = " ',h( $K["pass"] ),' " autocomplete = " new-password " >
' ; if ( ! $K [ " hashed " ]) echo
script ( " typePassword(qs('#pass')); " ); echo
checkbox ( " hashed " , 1 , $K [ " hashed " ], lang ( 237 ), " typePassword(this.form['pass'], this.checked); " ), ' </ table >
2014-05-08 19:46:08 +02:00
2018-04-01 23:34:54 +02:00
';echo"<table cellspacing=' 0 '>\n","<thead><tr><th colspan=' 2 '>".lang(69).doc_link(array(' sql ' => " grant.html#priv_level " )); $t = 0 ; foreach ( $ld
as $bf => $kd ){ echo '<th>' . ( $bf != " *.* " ? " <input name='objects[ $t ]' value=' " . h ( $bf ) . " ' size='10' autocapitalize='off'> " : " <input type='hidden' name='objects[ $t ]' value='*.*' size='10'>*.* " ); $t ++ ;} echo " </thead> \n " ; foreach ( array ( " " => " " , " Server Admin " => lang ( 32 ), " Databases " => lang ( 35 ), " Tables " => lang ( 127 ), " Columns " => lang ( 46 ), " Procedures " => lang ( 238 ),) as $Bb => $Wb ){ foreach (( array ) $ig [ $Bb ] as $hg => $vb ){ echo " <tr " . odd () . " ><td " . ( $Wb ? " > $Wb <td " : " colspan='2' " ) . ' lang="en" title="' . h ( $vb ) . '">' . h ( $hg ); $t = 0 ; foreach ( $ld
as $bf => $kd ){ $D = " 'grants[ $t ][ " . h ( strtoupper ( $hg )) . " ]' " ; $Y = $kd [ strtoupper ( $hg )]; if ( $Bb == " Server Admin " && $bf != ( isset ( $ld [ " *.* " ]) ? " *.* " : " .* " )) echo " <td> " ; elseif ( isset ( $_GET [ " grant " ])) echo " <td><select name= $D ><option><option value='1' " . ( $Y ? " selected " : " " ) . " > " . lang ( 239 ) . " <option value='0' " . ( $Y == " 0 " ? " selected " : " " ) . " > " . lang ( 240 ) . " </select> " ; else { echo " <td align='center'><label class='block'> " , " <input type='checkbox' name= $D value='1' " . ( $Y ? " checked " : " " ) . ( $hg == " All privileges " ? " id='grants- $t -all'> " : " > " . ( $hg == " Grant option " ? " " : script ( " qsl('input').onclick = function () { if (this.checked) formUncheck('grants- $t -all'); }; " ))), " </label> " ;} $t ++ ;}}} echo " </table> \n " , ' < p >
2014-05-08 19:46:08 +02:00
< input type = " submit " value = " ',lang(14),' " >
2018-04-01 23:34:54 +02:00
';if(isset($_GET["host"])){echo' < input type = " submit " name = " drop " value = " ',lang(123),' " > ',confirm(lang(171,"$ha@$_GET[host]"));}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$o){$ee=0;foreach((array)$_POST["kill"]as$X){if(kill_process($X))$ee++;}queries_redirect(ME."processlist=",lang(241,$ee),$ee||!$_POST["kill"]);}page_header(lang(112),$o);echo'
2014-05-08 19:46:08 +02:00
< form action = " " method = " post " >
2018-04-01 23:34:54 +02:00
< table cellspacing = " 0 " class = " nowrap checkable " >
',script("mixin(qsl(' table '), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");$t=-1;foreach(process_list()as$t=>$K){if(!$t){echo"<thead><tr lang=' en ' > " .(support( " kill " )? " < th >& nbsp ; " : " " );foreach( $K
as $z => $X ) echo " <th> $z " . doc_link ( array ( 'sql' => " show-processlist.html#processlist_ " . strtolower ( $z ), 'pgsql' => " monitoring-stats.html#PG-STAT-ACTIVITY-VIEW " , 'oracle' => " ../b14237/dynviews_2088.htm " ,)); echo " </thead> \n " ;} echo " <tr " . odd () . " > " . ( support ( " kill " ) ? " <td> " . checkbox ( " kill[] " , $K [ $y == " sql " ? " Id " : " pid " ], 0 ) : " " ); foreach ( $K
as $z => $X ) echo " <td> " . (( $y == " sql " && $z == " Info " && preg_match ( " ~Query|Killed~ " , $K [ " Command " ]) && $X != " " ) || ( $y == " pgsql " && $z == " current_query " && $X != " <IDLE> " ) || ( $y == " oracle " && $z == " sql_text " && $X != " " ) ? " <code class='jush- $y '> " . shorten_utf8 ( $X , 100 , " </code> " ) . ' <a href="' . h ( ME . ( $K [ " db " ] != " " ? " db= " . urlencode ( $K [ " db " ]) . " & " : " " ) . " sql= " . urlencode ( $X )) . '">' . lang ( 242 ) . '</a>' : nbsp ( $X )); echo " \n " ;} echo ' </ table >
2014-05-08 19:46:08 +02:00
< p >
2018-04-01 23:34:54 +02:00
';if(support("kill")){echo($t+1)."/".lang(243,max_connections()),"<p><input type=' submit ' value=' " .lang(244). " '>\n";}echo' < input type = " hidden " name = " token " value = " ', $gi ,' " >
2014-05-08 19:46:08 +02:00
</ form >
2018-04-01 23:34:54 +02:00
' , script ( " tableCheck(); " );} elseif ( isset ( $_GET [ " select " ])){ $a = $_GET [ " select " ]; $S = table_status1 ( $a ); $x = indexes ( $a ); $q = fields ( $a ); $dd = column_foreign_keys ( $a ); $df = $S [ " Oid " ]; parse_str ( $_COOKIE [ " adminer_import " ], $za ); $Lg = array (); $e = array (); $Vh = null ; foreach ( $q
as $z => $p ){ $D = $b -> fieldName ( $p ); if ( isset ( $p [ " privileges " ][ " select " ]) && $D != " " ){ $e [ $z ] = html_entity_decode ( strip_tags ( $D ), ENT_QUOTES ); if ( is_shortable ( $p )) $Vh = $b -> selectLengthProcess ();} $Lg += $p [ " privileges " ];} list ( $M , $md ) = $b -> selectColumnsProcess ( $e , $x ); $Td = count ( $md ) < count ( $M ); $Z = $b -> selectSearchProcess ( $q , $x ); $tf = $b -> selectOrderProcess ( $q , $x ); $_ = $b -> selectLimitProcess (); if ( $_GET [ " val " ] && is_ajax ()){ header ( " Content-Type: text/plain; charset=utf-8 " ); foreach ( $_GET [ " val " ] as $zi => $K ){ $Ha = convert_field ( $q [ key ( $K )]); $M = array ( $Ha ? $Ha : idf_escape ( key ( $K ))); $Z [] = where_check ( $zi , $q ); $J = $n -> select ( $a , $M , $Z , $M ); if ( $J ) echo
reset ( $J -> fetch_row ());} exit ;} $dg = $Ai = null ; foreach ( $x
as $w ){ if ( $w [ " type " ] == " PRIMARY " ){ $dg = array_flip ( $w [ " columns " ]); $Ai = ( $M ? $dg : array ()); foreach ( $Ai
as $z => $X ){ if ( in_array ( idf_escape ( $z ), $M )) unset ( $Ai [ $z ]);} break ;}} if ( $df &&! $dg ){ $dg = $Ai = array ( $df => 0 ); $x [] = array ( " type " => " PRIMARY " , " columns " => array ( $df ));} if ( $_POST &&! $o ){ $bj = $Z ; if ( ! $_POST [ " all " ] && is_array ( $_POST [ " check " ])){ $gb = array (); foreach ( $_POST [ " check " ] as $db ) $gb [] = where_check ( $db , $q ); $bj [] = " (( " . implode ( " ) OR ( " , $gb ) . " )) " ;} $bj = ( $bj ? " \n WHERE " . implode ( " AND " , $bj ) : " " ); if ( $_POST [ " export " ]){ cookie ( " adminer_import " , " output= " . urlencode ( $_POST [ " output " ]) . " &format= " . urlencode ( $_POST [ " format " ])); dump_headers ( $a ); $b -> dumpTable ( $a , " " ); $id = ( $M ? implode ( " , " , $M ) : " * " ) . convert_fields ( $e , $q , $M ) . " \n FROM " . table ( $a ); $od = ( $md && $Td ? " \n GROUP BY " . implode ( " , " , $md ) : " " ) . ( $tf ? " \n ORDER BY " . implode ( " , " , $tf ) : " " ); if ( ! is_array ( $_POST [ " check " ]) || $dg ) $H = " SELECT $id $bj $od " ; else { $xi = array (); foreach ( $_POST [ " check " ] as $X ) $xi [] = " (SELECT " . limit ( $id , " \n WHERE " . ( $Z ? implode ( " AND " , $Z ) . " AND " : " " ) . where_check ( $X , $q ) . $od , 1 ) . " ) " ; $H = implode ( " UNION ALL " , $xi );} $b -> dumpData ( $a , " table " , $H ); exit ;} if ( ! $b -> selectEmailProcess ( $Z , $dd )){ if ( $_POST [ " save " ] || $_POST [ " delete " ]){ $I = true ; $_a = 0 ; $P = array (); if ( ! $_POST [ " delete " ]){ foreach ( $e
as $D => $X ){ $X = process_input ( $q [ $D ]); if ( $X !== null && ( $_POST [ " clone " ] || $X !== false )) $P [ idf_escape ( $D )] = ( $X !== false ? $X : idf_escape ( $D ));}} if ( $_POST [ " delete " ] || $P ){ if ( $_POST [ " clone " ]) $H = " INTO " . table ( $a ) . " ( " . implode ( " , " , array_keys ( $P )) . " ) \n SELECT " . implode ( " , " , $P ) . " \n FROM " . table ( $a ); if ( $_POST [ " all " ] || ( $dg && is_array ( $_POST [ " check " ])) || $Td ){ $I = ( $_POST [ " delete " ] ? $n -> delete ( $a , $bj ) : ( $_POST [ " clone " ] ? queries ( " INSERT $H $bj " ) : $n -> update ( $a , $P , $bj ))); $_a = $g -> affected_rows ;} else { foreach (( array ) $_POST [ " check " ] as $X ){ $Xi = " \n WHERE " . ( $Z ? implode ( " AND " , $Z ) . " AND " : " " ) . where_check ( $X , $q ); $I = ( $_POST [ " delete " ] ? $n -> delete ( $a , $Xi , 1 ) : ( $_POST [ " clone " ] ? queries ( " INSERT " . limit1 ( $a , $H , $Xi )) : $n -> update ( $a , $P , $Xi , 1 ))); if ( ! $I ) break ; $_a += $g -> affected_rows ;}}} $Ge = lang ( 245 , $_a ); if ( $_POST [ " clone " ] && $I && $_a == 1 ){ $ke = last_id (); if ( $ke ) $Ge = lang ( 164 , " $ke " );} queries_redirect ( remove_from_uri ( $_POST [ " all " ] && $_POST [ " delete " ] ? " page " : " " ), $Ge , $I ); if ( ! $_POST [ " delete " ]){ edit_form ( $a , $q ,( array ) $_POST [ " fields " ], ! $_POST [ " clone " ]); page_footer (); exit ;}} elseif ( ! $_POST [ " import " ]){ if ( ! $_POST [ " val " ]) $o = lang ( 246 ); else { $I = true ; $_a = 0 ; foreach ( $_POST [ " val " ] as $zi => $K ){ $P = array (); foreach ( $K
as $z => $X ){ $z = bracket_escape ( $z , 1 ); $P [ idf_escape ( $z )] = ( preg_match ( '~char|text~' , $q [ $z ][ " type " ]) || $X != " " ? $b -> processInput ( $q [ $z ], $X ) : " NULL " );} $I = $n -> update ( $a , $P , " WHERE " . ( $Z ? implode ( " AND " , $Z ) . " AND " : " " ) . where_check ( $zi , $q ), ! $Td &&! $dg , " " ); if ( ! $I ) break ; $_a += $g -> affected_rows ;} queries_redirect ( remove_from_uri (), lang ( 245 , $_a ), $I );}} elseif ( ! is_string ( $Tc = get_file ( " csv_file " , true ))) $o = upload_error ( $Tc ); elseif ( ! preg_match ( '~~u' , $Tc )) $o = lang ( 247 ); else { cookie ( " adminer_import " , " output= " . urlencode ( $za [ " output " ]) . " &format= " . urlencode ( $_POST [ " separator " ])); $I = true ; $sb = array_keys ( $q ); preg_match_all ( '~(?>"[^"]*"|[^"\\r\\n]+)+~' , $Tc , $ze ); $_a = count ( $ze [ 0 ]); $n -> begin (); $N = ( $_POST [ " separator " ] == " csv " ? " , " : ( $_POST [ " separator " ] == " tsv " ? " \t " : " ; " )); $L = array (); foreach ( $ze [ 0 ] as $z => $X ){ preg_match_all ( " ~((?> \" [^ \" ]* \" )+|[^ $N ]*) $N ~ " , $X . $N , $_e ); if ( ! $z &&! array_diff ( $_e [ 1 ], $sb )){ $sb = $_e [ 1 ]; $_a -- ;} else { $P = array (); foreach ( $_e [ 1 ] as $t => $nb ) $P [ idf_escape ( $sb [ $t ])] = ( $nb == " " && $q [ $sb [ $t ]][ " null " ] ? " NULL " : q ( str_replace ( '""' , '"' , preg_replace ( '~^"|"$~' , '' , $nb )))); $L [] = $P ;}} $I = ( ! $L || $n -> insertUpdate ( $a , $L , $dg )); if ( $I ) $I = $n -> commit (); queries_redirect ( remove_from_uri ( " page " ), lang ( 248 , $_a ), $I ); $n -> rollback ();}}} $Hh = $b -> tableName ( $S ); if ( is_ajax ()){ page_headers (); ob_start ();} else
page_header ( lang ( 51 ) . " : $Hh " , $o ); $P = null ; if ( isset ( $Lg [ " insert " ]) ||! support ( " table " )){ $P = " " ; foreach (( array ) $_GET [ " where " ] as $X ){ if ( $dd [ $X [ " col " ]] && count ( $dd [ $X [ " col " ]]) == 1 && ( $X [ " op " ] == " = " || ( ! $X [ " op " ] &&! preg_match ( '~[_%]~' , $X [ " val " ])))) $P .= " &set " . urlencode ( " [ " . bracket_escape ( $X [ " col " ]) . " ] " ) . " = " . urlencode ( $X [ " val " ]);}} $b -> selectLinks ( $S , $P ); if ( ! $e && support ( " table " )) echo " <p class='error'> " . lang ( 249 ) . ( $q ? " . " : " : " . 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 ( $M , $e ); $b -> selectSearchPrint ( $Z , $e , $x ); $b -> selectOrderPrint ( $tf , $e , $x ); $b -> selectLimitPrint ( $_ ); $b -> selectLengthPrint ( $Vh ); $b -> selectActionPrint ( $x ); echo " </form> \n " ; $F = $_GET [ " page " ]; if ( $F == " last " ){ $gd = $g -> result ( count_rows ( $a , $Z , $Td , $md )); $F = floor ( max ( 0 , $gd - 1 ) / $_ );} $Xg = $M ; $nd = $md ; if ( ! $Xg ){ $Xg [] = " * " ; $Cb = convert_fields ( $e , $q , $M ); if ( $Cb ) $Xg [] = substr ( $Cb , 2 );} foreach ( $M
as $z => $X ){ $p = $q [ idf_unescape ( $X )]; if ( $p && ( $Ha = convert_field ( $p ))) $Xg [ $z ] = " $Ha AS $X " ;} if ( ! $Td && $Ai ){ foreach ( $Ai
as $z => $X ){ $Xg [] = idf_escape ( $z ); if ( $nd ) $nd [] = idf_escape ( $z );}} $I = $n -> select ( $a , $Xg , $Z , $nd , $tf , $_ , $F , true ); if ( ! $I ) echo " <p class='error'> " . error () . " \n " ; else { if ( $y == " mssql " && $F ) $I -> seek ( $_ * $F ); $sc = array (); echo " <form action='' method='post' enctype='multipart/form-data'> \n " ; $L = array (); while ( $K = $I -> fetch_assoc ()){ if ( $F && $y == " oracle " ) unset ( $K [ " RNUM " ]); $L [] = $K ;} if ( $_GET [ " page " ] != " last " && $_ != " " && $md && $Td && $y == " sql " ) $gd = $g -> result ( " SELECT FOUND_ROWS() " ); if ( ! $L ) echo " <p class='message'> " . lang ( 12 ) . " \n " ; else { $Qa = $b -> backwardKeys ( $a , $Hh ); echo " <table id='table' cellspacing='0' class='nowrap checkable'> " , script ( " mixin(qs('#table'), { onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown}); " ), " <thead><tr> " . ( ! $md && $M ? " " : " <td><input type='checkbox' id='all-page' class='jsonly'> " . script ( " qs('#all-page').onclick = partial(formCheck, /check/); " , " " ) . " <a href=' " . h ( $_GET [ " modify " ] ? remove_from_uri ( " modify " ) : $_SERVER [ " REQUEST_URI " ] . " &modify=1 " ) . " '> " . lang ( 250 ) . " </a> " ); $Se = array (); $jd = array (); reset ( $M ); $sg = 1 ; foreach ( $L [ 0 ] as $z => $X ){ if ( ! isset ( $Ai [ $z ])){ $X = $_GET [ " columns " ][ key ( $M )]; $p = $q [ $M ? ( $X ? $X [ " col " ] : current ( $M )) : $z ]; $D = ( $p ? $b -> fieldName ( $p , $sg ) : ( $X [ " fun " ] ? " * " : $z )); if ( $D != " " ){ $sg ++ ; $Se [ $z ] = $D ; $d = idf_escape ( $z ); $zd = remove_from_uri ( '(order|desc)[^=]*|page' ) . '&order%5B0%5D=' . urlencode ( $z ); $Wb = " &desc%5B0%5D=1 " ; echo " <th> " . script ( " mixin(qsl('th'), { onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')}); " , " " ), '<a href="' . h ( $zd . ( $tf [ 0 ] == $d || $tf [ 0 ] == $z || ( ! $tf && $Td && $md [ 0 ] == $d ) ? $Wb : '' )) . '">' ; echo
apply_sql_function ( $X [ " fun " ], $D ) . " </a> " ; echo " <span class='column hidden'> " , " <a href=' " . h ( $zd . $Wb ) . " ' title=' " . lang ( 57 ) . " ' class='text'> ↓</a> " ; if ( ! $X [ " fun " ]){ echo '<a href="#fieldset-search" title="' . lang ( 54 ) . '" class="text jsonly"> =</a>' , script ( " qsl('a').onclick = partial(selectSearch, ' " . js_escape ( $z ) . " '); " );} echo " </span> " ;} $jd [ $z ] = $X [ " fun " ]; next ( $M );}} $qe = array (); if ( $_GET [ " modify " ]){ foreach ( $L
as $K ){ foreach ( $K
as $z => $X ) $qe [ $z ] = max ( $qe [ $z ], min ( 40 , strlen ( utf8_decode ( $X ))));}} echo ( $Qa ? " <th> " . lang ( 251 ) : " " ) . " </thead> \n " ; if ( is_ajax ()){ if ( $_ % 2 == 1 && $F % 2 == 1 ) odd (); ob_end_clean ();} foreach ( $b -> rowDescriptions ( $L , $dd ) as $Re => $K ){ $yi = unique_array ( $L [ $Re ], $x ); if ( ! $yi ){ $yi = array (); foreach ( $L [ $Re ] as $z => $X ){ if ( ! preg_match ( '~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~' , $z )) $yi [ $z ] = $X ;}} $zi = " " ; foreach ( $yi
as $z => $X ){ if (( $y == " sql " || $y == " pgsql " ) && preg_match ( '~char|text|enum|set~' , $q [ $z ][ " type " ]) && strlen ( $X ) > 64 ){ $z = ( strpos ( $z , '(' ) ? $z : idf_escape ( $z )); $z = " MD5( " . ( $y != 'sql' || preg_match ( " ~^utf8~ " , $q [ $z ][ " collation " ]) ? $z : " CONVERT( $z USING " . charset ( $g ) . " ) " ) . " ) " ; $X = md5 ( $X );} $zi .= " & " . ( $X !== null ? urlencode ( " where[ " . bracket_escape ( $z ) . " ] " ) . " = " . urlencode ( $X ) : " null%5B%5D= " . urlencode ( $z ));} echo " <tr " . odd () . " > " . ( ! $md && $M ? " " : " <td> " . checkbox ( " check[] " , substr ( $zi , 1 ), in_array ( substr ( $zi , 1 ),( array ) $_POST [ " check " ])) . ( $Td || information_schema ( DB ) ? " " : " <a href=' " . h ( ME . " edit= " . urlencode ( $a ) . $zi ) . " ' class='edit'> " . lang ( 252 ) . " </a> " )); foreach ( $K
as $z => $X ){ if ( isset ( $Se [ $z ])){ $p = $q [ $z ]; $X = $n -> value ( $X , $p ); if ( $X != " " && ( ! isset ( $sc [ $z ]) || $sc [ $z ] != " " )) $sc [ $z ] = ( is_mail ( $X ) ? $Se [ $z ] : " " ); $A = " " ; if ( preg_match ( '~blob|bytea|raw|file~' , $p [ " type " ]) && $X != " " ) $A = ME . 'download=' . urlencode ( $a ) . '&field=' . urlencode ( $z ) . $zi ; if ( ! $A && $X !== null ){ foreach (( array ) $dd [ $z ] as $r ){ if ( count ( $dd [ $z ]) == 1 || end ( $r [ " source " ]) == $z ){ $A = " " ; foreach ( $r [ " source " ] as $t => $nh ) $A .= where_link ( $t , $r [ " target " ][ $t ], $L [ $Re ][ $nh ]); $A = ( $r [ " db " ] != " " ? preg_replace ( '~([?&]db=)[^&]+~' , '\\1' . urlencode ( $r [ " db " ]), ME ) : ME ) . 'select=' . urlencode ( $r [ " table " ]) . $A ; if ( $r [ " ns " ]) $A = preg_replace ( '~([?&]ns=)[^&]+~' , '\\1' . urlencode ( $r [ " ns " ]), $A ); if ( count ( $r [ " source " ]) == 1 ) break ;}}} if ( $z == " COUNT(*) " ){ $A = ME . " select= " . urlencode ( $a ); $t = 0 ; foreach (( array ) $_GET [ " where " ] as $W ){ if ( ! array_key_exists ( $W [ " col " ], $yi )) $A .= where_link ( $t ++ , $W [ " col " ], $W [ " val " ], $W [ " op " ]);} foreach ( $yi
as $Yd => $W ) $A .= where_link ( $t ++ , $Yd , $W );} $X = select_value ( $X , $A , $p , $Vh ); $u = h ( " val[ $zi ][ " . bracket_escape ( $z ) . " ] " ); $Y = $_POST [ " val " ][ $zi ][ bracket_escape ( $z )]; $nc =! is_array ( $K [ $z ]) && is_utf8 ( $X ) && $L [ $Re ][ $z ] == $K [ $z ] &&! $jd [ $z ]; $Uh = preg_match ( '~text|lob~' , $p [ " type " ]); if (( $_GET [ " modify " ] && $nc ) || $Y !== null ){ $qd = h ( $Y !== null ? $Y : $K [ $z ]); echo " <td> " . ( $Uh ? " <textarea name=' $u ' cols='30' rows=' " . ( substr_count ( $K [ $z ], " \n " ) + 1 ) . " '> $qd </textarea> " : " <input name=' $u ' value=' $qd ' size=' $qe[$z] '> " );} else { $ue = strpos ( $X , " <i>...</i> " ); echo " <td id=' $u ' data-text=' " . ( $ue ? 2 : ( $Uh ? 1 : 0 )) . " ' " . ( $nc ? " " : " data-warning=' " . h ( lang ( 253 )) . " ' " ) . " > $X </td> " ;}}} if ( $Qa ) echo " <td> " ; $b -> backwardKeysPrint ( $Qa , $L [ $Re ]); echo " </tr> \n " ;} if ( is_ajax ()) exit ; echo " </table> \n " ;} if ( ! is_ajax ()){ if ( $L || $F ){ $Bc = true ; if ( $_GET [ " page " ] != " last " ){ if ( $_ == " " || ( count ( $L ) < $_ && ( $L ||! $F ))) $gd = ( $F ? $F * $_ : 0 ) + count ( $L ); elseif ( $y != " sql " ||! $Td ){ $gd = ( $Td ? false : found_rows ( $S , $Z )); if ( $gd < max ( 1e4 , 2 * ( $F + 1 ) * $_ )) $gd = reset ( slow_query ( count_rows ( $a , $Z , $Td , $md ))); else $Bc = false ;}} $Ff = ( $_ != " " && ( $gd === false || $gd > $_ || $F )); if ( $Ff ){ echo (( $gd === false ? count ( $L ) + 1 : $gd - $F * $_ ) > $_ ? '<p><a href="' . h ( remove_from_uri ( " page " ) . " &page= " . ( $F + 1 )) . '" class="loadmore">' . lang ( 254 ) . '</a>' . script ( " qsl('a').onclick = partial(selectLoadMore, " . ( + $_ ) . " , ' " . lang ( 255 ) . " ...'); " , " " ) : '' ), " \n " ;}} echo " <div class='footer'><div> \n " ; if ( $L || $F ){ if ( $Ff ){ $Be = ( $gd === false ? $F + ( count ( $L ) >= $_ ? 2 : 1 ) : floor (( $gd - 1 ) / $_ )); echo " <fieldset> " ; if ( $y != " simpledb " ){ echo " <legend><a href=' " . h ( remove_from_uri ( " page " )) . " '> " . lang ( 256 ) . " </a></legend> " , script ( " qsl('a').onclick = function () { pageClick(this.href, +prompt(' " . lang ( 256 ) . " ', ' " . ( $F + 1 ) . " ')); return false; }; " ), pagination ( 0 , $F ) . ( $F > 5 ? " ... " : " " ); for ( $t = max ( 1 , $F - 4 ); $t < min ( $Be , $F + 5 ); $t ++ ) echo
pagination ( $t , $F ); if ( $Be > 0 ){ echo ( $F + 5 < $Be ? " ... " : " " ),( $Bc && $gd !== false ? pagination ( $Be , $F ) : " <a href=' " . h ( remove_from_uri ( " page " ) . " &page=last " ) . " ' title='~ $Be '> " . lang ( 257 ) . " </a> " );}} else { echo " <legend> " . lang ( 256 ) . " </legend> " , pagination ( 0 , $F ) . ( $F > 1 ? " ... " : " " ),( $F ? pagination ( $F , $F ) : " " ),( $Be > $F ? pagination ( $F + 1 , $F ) . ( $Be > $F + 1 ? " ... " : " " ) : " " );} echo " </fieldset> \n " ;} echo " <fieldset> " , " <legend> " . lang ( 258 ) . " </legend> " ; $bc = ( $Bc ? " " : " ~ " ) . $gd ; echo
checkbox ( " all " , 1 , 0 ,( $gd !== false ? ( $Bc ? " " : " ~ " ) . lang ( 146 , $gd ) : " " ), " var checked = formChecked(this, /check/); selectCount('selected', this.checked ? ' $bc ' : checked); selectCount('selected2', this.checked || !checked ? ' $bc ' : checked); " ) . " \n " , " </fieldset> \n " ; if ( $b -> selectCommandPrint ()){ echo '<fieldset' ,( $_GET [ " modify " ] ? '' : ' class="jsonly"' ), '><legend>' , lang ( 250 ), ' </ legend >< div >
< input type = " submit " value = " ',lang(14),' " ',($_GET["modify"]?' ':' title = " '.lang(246).' " '),' >
2014-05-08 19:46:08 +02:00
</ div ></ fieldset >
2018-04-01 23:34:54 +02:00
< fieldset >< legend > ',lang(122),' < span id = " selected " ></ span ></ legend >< div >
2014-05-08 19:46:08 +02:00
< input type = " submit " name = " edit " value = " ',lang(10),' " >
2018-04-01 23:34:54 +02:00
< input type = " submit " name = " clone " value = " ',lang(242),' " >
< input type = " submit " name = " delete " value = " ',lang(18),' " > ',confirm(),' </ div ></ fieldset >
';}$ed=$b->dumpFormat();foreach((array)$_GET["columns"]as$d){if($d["fun"]){unset($ed[' sql ']);break;}}if($ed){print_fieldset("export",lang(71)." <span id=' selected2 '></span>");$Df=$b->dumpOutput();echo($Df?html_select("output",$Df,$za["output"])." ":""),html_select("format",$ed,$za["format"])," <input type=' submit ' name=' export ' value=' " .lang(71). " '>\n","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($sc,' strlen '),$e);}echo"</div></div>\n";if($b->selectImportPrint()){echo"<div>","<a href=' #import'>".lang(70)."</a>",script("qsl('a').onclick = partial(toggle, 'import');",""),"<span id='import' class='hidden'>: ","<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$za["format"],1);echo" <input type='submit' name='import' value='".lang(70)."'>","</span>","</div>";}echo"<input type='hidden' name='token' value='$gi'>\n","</form>\n",(!$md&&$M?"":script("tableCheck();"));}}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$xh=isset($_GET["status"]);page_header($xh?lang(114):lang(113));$Oi=($xh?show_status():show_variables());if(!$Oi)echo"<p class='message'>".lang(12)."\n";else{echo"<table cellspacing='0'>\n";foreach($Oi
as $z => $X ){ echo " <tr> " , " <th><code class='jush- " . $y . ( $xh ? " status " : " set " ) . " '> " . h ( $z ) . " </code> " , " <td> " . nbsp ( $X );} echo " </table> \n " ;}} elseif ( isset ( $_GET [ " script " ])){ header ( " Content-Type: text/javascript; charset=utf-8 " ); if ( $_GET [ " script " ] == " db " ){ $Eh = array ( " Data_length " => 0 , " Index_length " => 0 , " Data_free " => 0 ); foreach ( table_status () as $D => $S ){ json_row ( " Comment- $D " , nbsp ( $S [ " Comment " ])); if ( ! is_view ( $S )){ foreach ( array ( " Engine " , " Collation " ) as $z ) json_row ( " $z - $D " , nbsp ( $S [ $z ])); foreach ( $Eh + array ( " Auto_increment " => 0 , " Rows " => 0 ) as $z => $X ){ if ( $S [ $z ] != " " ){ $X = format_number ( $S [ $z ]); json_row ( " $z - $D " ,( $z == " Rows " && $X && $S [ " Engine " ] == ( $qh == " pgsql " ? " table " : " InnoDB " ) ? " ~ $X " : $X )); if ( isset ( $Eh [ $z ])) $Eh [ $z ] += ( $S [ " Engine " ] != " InnoDB " || $z != " Data_free " ? $S [ $z ] : 0 );} elseif ( array_key_exists ( $z , $S )) json_row ( " $z - $D " );}}} foreach ( $Eh
as $z => $X ) json_row ( " sum- $z " , format_number ( $X )); json_row ( " " );} elseif ( $_GET [ " script " ] == " kill " ) $g -> query ( " KILL " . number ( $_POST [ " kill " ])); else { foreach ( count_tables ( $b -> databases ()) as $m => $X ){ json_row ( " tables- $m " , $X ); json_row ( " size- $m " , db_size ( $m ));} json_row ( " " );} exit ;} else { $Nh = array_merge (( array ) $_POST [ " tables " ],( array ) $_POST [ " views " ]); if ( $Nh &&! $o &&! $_POST [ " search " ]){ $I = true ; $Ge = " " ; if ( $y == " sql " && $_POST [ " tables " ] && count ( $_POST [ " tables " ]) > 1 && ( $_POST [ " drop " ] || $_POST [ " truncate " ] || $_POST [ " copy " ])) queries ( " SET foreign_key_checks = 0 " ); if ( $_POST [ " truncate " ]){ if ( $_POST [ " tables " ]) $I = truncate_tables ( $_POST [ " tables " ]); $Ge = lang ( 259 );} elseif ( $_POST [ " move " ]){ $I = move_tables (( array ) $_POST [ " tables " ],( array ) $_POST [ " views " ], $_POST [ " target " ]); $Ge = lang ( 260 );} elseif ( $_POST [ " copy " ]){ $I = copy_tables (( array ) $_POST [ " tables " ],( array ) $_POST [ " views " ], $_POST [ " target " ]); $Ge = lang ( 261 );} elseif ( $_POST [ " drop " ]){ if ( $_POST [ " views " ]) $I = drop_views ( $_POST [ " views " ]); if ( $I && $_POST [ " tables " ]) $I = drop_tables ( $_POST [ " tables " ]); $Ge = lang ( 262 );} elseif ( $y != " sql " ){ $I = ( $y == " sqlite " ? queries ( " VACUUM " ) : apply_queries ( " VACUUM " . ( $_POST [ " optimize " ] ? " " : " ANALYZE " ), $_POST [ " tables " ])); $Ge = lang ( 263 );} elseif ( ! $_POST [ " tables " ]) $Ge = lang ( 9 ); elseif ( $I = queries (( $_POST [ " optimize " ] ? " OPTIMIZE " : ( $_POST [ " check " ] ? " CHECK " : ( $_POST [ " repair " ] ? " REPAIR " : " ANALYZE " ))) . " TABLE " . implode ( " , " , array_map ( 'idf_escape' , $_POST [ " tables " ])))){ while ( $K = $I -> fetch_assoc ()) $Ge .= " <b> " . h ( $K [ " Table " ]) . " </b>: " . h ( $K [ " Msg_text " ]) . " <br> " ;} queries_redirect ( substr ( ME , 0 , - 1 ), $Ge , $I );} page_header (( $_GET [ " ns " ] == " " ? lang ( 35 ) . " : " . h ( DB ) : lang ( 75 ) . " : " . h ( $_GET [ " ns " ])), $o , true ); if ( $b -> homepage ()){ if ( $_GET [ " ns " ] !== " " ){ echo " <h3 id='tables-views'> " . lang ( 264 ) . " </h3> \n " ; $Mh = tables_list (); if ( ! $Mh ) echo " <p class='message'> " . lang ( 9 ) . " \n " ; else { echo " <form action='' method='post'> \n " ; if ( support ( " table " )){ echo " <fieldset><legend> " . lang ( 265 ) . " <span id='selected2'></span></legend><div> " , " <input type='search' name='query' value=' " . h ( $_POST [ " query " ]) . " '> " , script ( " qsl('input').onkeydown = partialArg(bodyKeydown, 'search'); " , " " ), " <input type='submit' name='search' value=' " . lang ( 54 ) . " '> \n " , " </div></fieldset> \n " ; if ( $_POST [ " search " ] && $_POST [ " query " ] != " " ){ $_GET [ " where " ][ 0 ][ " op " ] = " LIKE %% " ; search_tables ();}} $cc = doc_link ( array ( 'sql' => 'show-table-status.html' )); echo " <table cellspacing='0' class='nowrap checkable'> \n " , script ( " mixin(qsl('table'), { onclick: tableClick, ondblclick: partialArg(tableClick, true)}); " ), '<thead><tr class="wrap">' , '<td><input id="check-all" type="checkbox" class="jsonly">' . script ( " qs('#check-all').onclick = partial(formCheck, /^(tables|views) \ [/); " , " " ), '<th>' . lang ( 127 ), '<td>' . lang ( 266 ) . doc_link ( array ( 'sql' => 'storage-engines.html' )), '<td>' . lang ( 118 ) . doc_link ( array ( 'sql' => 'charset-charsets.html' , 'mariadb' => 'supported-character-sets-and-collations/' )), '<td>' . lang ( 267 ) . $cc , '<td>' . lang ( 268 ) . $cc , '<td>' . lang ( 269 ) . $cc , '<td>' . lang ( 49 ) . doc_link ( array ( 'sql' => 'example-auto-increment.html' , 'mariadb' => 'auto_increment/' )), '<td>' . lang ( 270 ) . $cc ,( support ( " comment " ) ? '<td>' . lang ( 48 ) . $cc : '' ), " </thead> \n " ; $T = 0 ; foreach ( $Mh
as $D => $U ){ $Ri = ( $U !== null &&! preg_match ( '~table~i' , $U )); $u = h ( " Table- " . $D ); echo '<tr' . odd () . '><td>' . checkbox (( $Ri ? " views[] " : " tables[] " ), $D , in_array ( $D , $Nh , true ), " " , " " , " " , $u ), '<th>' . ( support ( " table " ) || support ( " indexes " ) ? " <a href=' " . h ( ME ) . " table= " . urlencode ( $D ) . " ' title=' " . lang ( 40 ) . " ' id=' $u '> " . h ( $D ) . '</a>' : h ( $D )); if ( $Ri ){ echo '<td colspan="6"><a href="' . h ( ME ) . " view= " . urlencode ( $D ) . '" title="' . lang ( 41 ) . '">' . ( preg_match ( '~materialized~i' , $U ) ? lang ( 125 ) : lang ( 126 )) . '</a>' , '<td align="right"><a href="' . h ( ME ) . " select= " . urlencode ( $D ) . '" title="' . lang ( 39 ) . '">?</a>' ;} else { foreach ( array ( " Engine " => array (), " Collation " => array (), " Data_length " => array ( " create " , lang ( 42 )), " Index_length " => array ( " indexes " , lang ( 129 )), " Data_free " => array ( " edit " , lang ( 43 )), " Auto_increment " => array ( " auto_increment=1&create " , lang ( 42 )), " Rows " => array ( " select " , lang ( 39 )),) as $z => $A ){ $u = " id=' $z - " . h ( $D ) . " ' " ; echo ( $A ? " <td align='right'> " . ( support ( " table " ) || $z == " Rows " || ( support ( " indexes " ) && $z != " Data_length " ) ? " <a href=' " . h ( ME . " $A[0] = " ) . urlencode ( $D ) . " ' $u title=' $A[1] '>?</a> " : " <span $u >?</span> " ) : " <td id=' $z - " . h ( $D ) . " '> " );} $T ++ ;} echo ( support ( " comment " ) ? " <td id='Comment- " . h ( $D ) . " '> " : " " );} echo " <tr><td> <th> " . lang ( 243 , count ( $Mh )), " <td> " . nbsp ( $y == " sql " ? $g -> result ( " SELECT @@storage_engine " ) : " " ), " <td> " . nbsp ( db_collation ( DB , collations ())); foreach ( array ( " Data_length " , " Index_length " , " Data_free " ) as $z ) echo " <td align='right' id='sum- $z '> " ; echo " </table> \n " ; if ( ! information_schema ( DB )){ echo " <div class='footer'><div> \n " ; $Li = " <input type='submit' value=' " . lang ( 271 ) . " '> " . on_help ( " 'VACUUM' " ); $pf = " <input type='submit' name='optimize' value=' " . lang ( 272 ) . " '> " . on_help ( $y == " sql " ? " 'OPTIMIZE TABLE' " : " 'VACUUM OPTIMIZE' " ); echo " <fieldset><legend> " . lang ( 122 ) . " <span id='selected'></span></legend><div> " . ( $y == " sqlite " ? $Li : ( $y == " pgsql " ? $Li . $pf : ( $y == " sql " ? " <input type='submit' value=' " . lang ( 273 ) . " '> " . on_help ( " 'ANALYZE TABLE' " ) . $pf . " <input type='submit' name='check' value=' " . lang ( 274 ) . " '> " . on_help ( " 'CHECK TABLE' " ) . " <input type='submit' name='repair' value=' " . lang ( 275 ) . " '> " . on_help ( " 'REPAIR TABLE' " ) : " " ))) . " <input type='submit' name='truncate' value=' " . lang ( 276 ) . " '> " . on_help ( $y == " sqlite " ? " 'DELETE' " : " 'TRUNCATE " . ( $y == " pgsql " ? " ' " : " TABLE' " )) . confirm () . " <input type='submit' name='drop' value=' " . lang ( 123 ) . " '> " . on_help ( " 'DROP TABLE' " ) . confirm () . " \n " ; $l = ( support ( " scheme " ) ? $b -> schemas () : $b -> databases ()); if ( count ( $l ) != 1 && $y != " sqlite " ){ $m = ( isset ( $_POST [ " target " ]) ? $_POST [ " target " ] : ( support ( " scheme " ) ? $_GET [ " ns " ] : DB )); echo " <p> " . lang ( 277 ) . " : " ,( $l ? html_select ( " target " , $l , $m ) : '<input name="target" value="' . h ( $m ) . '" autocapitalize="off">' ), " <input type='submit' name='move' value=' " . lang ( 278 ) . " '> " ,( support ( " copy " ) ? " <input type='submit' name='copy' value=' " . lang ( 279 ) . " '> " : " " ), " \n " ;} echo " <input type='hidden' name='all' value=''> " ; echo
script ( " qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views) \ [/)); " . ( support ( " table " ) ? " selectCount('selected2', formChecked(this, /^tables \ [/) || $T ); " : " " ) . " } " ), " <input type='hidden' name='token' value=' $gi '> \n " , " </div></fieldset> \n " , " </div></div> \n " ;} echo " </form> \n " , script ( " tableCheck(); " );} echo '<p class="links"><a href="' . h ( ME ) . 'create=">' . lang ( 72 ) . " </a> \n " ,( support ( " view " ) ? '<a href="' . h ( ME ) . 'view=">' . lang ( 200 ) . " </a> \n " : " " ); if ( support ( " routine " )){ echo " <h3 id='routines'> " . lang ( 139 ) . " </h3> \n " ; $Pg = routines (); if ( $Pg ){ echo " <table cellspacing='0'> \n " , '<thead><tr><th>' . lang ( 179 ) . '<td>' . lang ( 47 ) . '<td>' . lang ( 217 ) . " <td> </thead> \n " ; odd ( '' ); foreach ( $Pg
as $K ){ $D = ( $K [ " SPECIFIC_NAME " ] == $K [ " ROUTINE_NAME " ] ? " " : " &name= " . urlencode ( $K [ " ROUTINE_NAME " ])); echo '<tr' . odd () . '>' , '<th><a href="' . h ( ME . ( $K [ " ROUTINE_TYPE " ] != " PROCEDURE " ? 'callf=' : 'call=' ) . urlencode ( $K [ " SPECIFIC_NAME " ]) . $D ) . '">' . h ( $K [ " ROUTINE_NAME " ]) . '</a>' , '<td>' . h ( $K [ " ROUTINE_TYPE " ]), '<td>' . h ( $K [ " DTD_IDENTIFIER " ]), '<td><a href="' . h ( ME . ( $K [ " ROUTINE_TYPE " ] != " PROCEDURE " ? 'function=' : 'procedure=' ) . urlencode ( $K [ " SPECIFIC_NAME " ]) . $D ) . '">' . lang ( 132 ) . " </a> " ;} echo " </table> \n " ;} echo '<p class="links">' . ( support ( " procedure " ) ? '<a href="' . h ( ME ) . 'procedure=">' . lang ( 216 ) . '</a>' : '' ) . '<a href="' . h ( ME ) . 'function=">' . lang ( 215 ) . " </a> \n " ;} if ( support ( " sequence " )){ echo " <h3 id='sequences'> " . lang ( 280 ) . " </h3> \n " ; $dh = get_vals ( " SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema() ORDER BY sequence_name " ); if ( $dh ){ echo " <table cellspacing='0'> \n " , " <thead><tr><th> " . lang ( 179 ) . " </thead> \n " ; odd ( '' ); foreach ( $dh
as $X ) echo " <tr " . odd () . " ><th><a href=' " . h ( ME ) . " sequence= " . urlencode ( $X ) . " '> " . h ( $X ) . " </a> \n " ; echo " </table> \n " ;} echo " <p class='links'><a href=' " . h ( ME ) . " sequence='> " . lang ( 222 ) . " </a> \n " ;} if ( support ( " type " )){ echo " <h3 id='user-types'> " . lang ( 24 ) . " </h3> \n " ; $Ji = types (); if ( $Ji ){ echo " <table cellspacing='0'> \n " , " <thead><tr><th> " . lang ( 179 ) . " </thead> \n " ; odd ( '' ); foreach ( $Ji
as $X ) echo " <tr " . odd () . " ><th><a href=' " . h ( ME ) . " type= " . urlencode ( $X ) . " '> " . h ( $X ) . " </a> \n " ; echo " </table> \n " ;} echo " <p class='links'><a href=' " . h ( ME ) . " type='> " . lang ( 226 ) . " </a> \n " ;} if ( support ( " event " )){ echo " <h3 id='events'> " . lang ( 140 ) . " </h3> \n " ; $L = get_rows ( " SHOW EVENTS " ); if ( $L ){ echo " <table cellspacing='0'> \n " , " <thead><tr><th> " . lang ( 179 ) . " <td> " . lang ( 281 ) . " <td> " . lang ( 206 ) . " <td> " . lang ( 207 ) . " <td></thead> \n " ; foreach ( $L
as $K ){ echo " <tr> " , " <th> " . h ( $K [ " Name " ]), " <td> " . ( $K [ " Execute at " ] ? lang ( 282 ) . " <td> " . $K [ " Execute at " ] : lang ( 208 ) . " " . $K [ " Interval value " ] . " " . $K [ " Interval field " ] . " <td> $K[Starts] " ), " <td> $K[Ends] " , '<td><a href="' . h ( ME ) . 'event=' . urlencode ( $K [ " Name " ]) . '">' . lang ( 132 ) . '</a>' ;} echo " </table> \n " ; $_c = $g -> result ( " SELECT @@event_scheduler " ); if ( $_c && $_c != " ON " ) echo " <p class='error'><code class='jush-sqlset'>event_scheduler</code>: " . h ( $_c ) . " \n " ;} echo '<p class="links"><a href="' . h ( ME ) . 'event=">' . lang ( 205 ) . " </a> \n " ;} if ( $Mh ) echo
script ( " ajaxSetHtml(' " . js_escape ( ME ) . " script=db'); " );}}} page_footer ();