123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817 |
- <?php
- /** Adminer - Compact database management
- * @link http://www.adminer.org/
- * @author Jakub Vrana, http://www.vrana.cz/
- * @copyright 2007 Jakub Vrana
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
- * @version 4.1.0
- */error_reporting(6135);$nc=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($nc||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$xg=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($xg)$$X=$xg;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");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");if($_GET["file"]=="favicon.ico"){header("Content-Type: image/x-icon");echo
- lzw_decompress("\0\0\0` \0�\0\n @\0�C��\"\0`E�Q����?�tvM'�Jd�d\\�b0\0�\"��fӈ��s5����A�XPaJ�0���8�#R�T��z`�#.��c�X��Ȁ?�-\0�Im?�.�M��\0ȯ(̉��/(%�\0");}elseif($_GET["file"]=="default.css"){header("Content-Type: text/css; charset=utf-8");echo
- lzw_decompress("\n1̇�ٌ�l7��B1�4vb0��fs���n2B�ѱ٘�n:�#(�b.\rDc)��a7E����l�ñ��i1̎s���-4��f� ��i7������Fé�vt2���!�r0���t~�U�'3M��W�B�'c�P�:6T\rc�A�zr_�WK�\r-�VNFS%~�c���&�\\^�r����u�ŎÞ�ً4'7k����Q��h�'g\rFB\ryT7SS�P�1=ǤcI��:�d��m>�S8L�J��t.M��� ϋ`'C����889�� �Q����2�#8А����6m����j��h�<�����9/��:�J�)ʂ�\0d>!\0Z��v�n��o(���k�7��s��>��!�R\"*nS�\0@P\"��(�#[���@g�o���zn�9k�8�n���1�I*��=�n������0�c(�;�à��!���*c��>Ύ�E7D�LJ��1�J=���1L��?�s=#`�3\$4���uȱ��zG�C YAt�?;�Q�k&��YP�u��ǯ}UaHV%G;�s��<A\0\\��P�\\��&ª�V��\n�SU�t���r���2� l^�Z6�ej����A�d�[�sն�JP����ҝ��8�=����6#˂74*���#e���!�7{�6��<o�C�9v[�M��-`��k�>�l�ڴ��I��H�3�x����w0t6��%MR%��jh�B�<�\0�AQ<P<:��u/�;\\>��-��ʈ��QH\nv�L+v�æ�<�\r��v����\\*����Ӵݢg��n˩��TЩ2P�\r��ߋ\"+z�8���:#�����2��J[�i����;z�����r�3#�ى�:�n�\r㽃e�pdݍ� �2c��4�k���\rG��E6_����މb��/��HB%�0�>���hoW�nxl֍�浃CQ^�������\r����4lK{�Z��:���Ã�.�p��Ă�J�B-�+B���(�T�%��J�0�l�T�`+�-��@B��ۄV��\0��C�,�0t���F���?Ġ�\na@Ɍ>��ZEC��O�-���^Q�&���)I)�����R�]\r��9�7_��\r�F80�Ob� ���>���\nR�_��8��٫�ov0�bCA�F!�t��ă%0�/�zAYO(4������ '�] I��8hH�05�3�@x&n��|T���)`�.�s6eY�D�z�����Jѓ��.��{GEb��Ӌ����2��{\$**��@�C��-:zYHZI��5F]��Y��C�O�A����`x'�.*9t'{�(�wP����=�*���*�xwr��*c���c|�D���V��\r�V.�0���V�d�?Ҁ��,E͝`T��6ۈ-����ڎT[ѐ�z��.Ar��̀P��n�c=a�9F�n�!�u��A���0iP��J6e�T]V�[\rX��a��v�k�\n+E���ܕ*\0�~���@g\"�NCI\$��Ɍ���x@W�y�*vuD�\0�v�댆V\0�V`G�u�E�֕��f�l�h�@�)0@�T��7���§RA�ٷ�3ۘ��/Q�]�,s�{VR�����F���A��<�vץ�%@9��F��5t�%�+�/�8;�W����J��o:�N�`� ����h��{ܣ�� �Ԑ8�Eu�&�W|Ɇ���U�&\r\"����|-udž�N��:nc��fV����#U20�>\"���>�`�k]�-��x�S�͇Т����c��B��}�&`��r+E��\$�yN���b,���Wx ��-9��r�,��`�+���ˊ��C��)��7�x\r��W�fM�SR�\\�z��Q�̓��uA���2���4�L&�Hi µ���S\$)e���g rȌ��\$]Z�iYs���kW�n>�7E1k8�d�r�k����E���w�wcm�Ty����a�\$tx\rB��=����*�<���l�f�K��N/��� �l���kH��8�.���?f�����6�ч�{gi/\"�@��K��@2��a|#,Z��� ��w�d�������6w�^&��t��P�����]���.����T��kro����\ro=�%��h`:\0᱂����|ꊣ�a�Ԯ6*:��*��rO-^����n���M�}���Aya���\n�u^��rnO\r���`�T~</�w�y�}�:�|�����̡6������v�\rc<�b#������\$�s��|燇V)�h�TC��(Ľ���]6��1�!1M��@a�/�`�>ٸ�ߣ�����C/�6ഷ#p@p���`Z���ch��\0��\0o��4O�O�i\0-\n���/�\0�D�.� ���.�Đ\0fi��ȫ���\0��ID��\0��\r��0f��o�����G����eJ|\r���l �3�~�iP��&���/�\0�9 ^\0r�0]�� �o��.�\"� ���M���v�P�Z��mp�P���ڜ�ޏ���{��C?��k��ϼ}��d��ʏ�~=�.��- � �m1>h���Е1;QI�OP�\r��c�pApV�k\rQ*�Q}���q>��u�15�BqQ[1f��l���ap���\0��*�J�Q=�����G��������_��b�GHF.�0�� = 2P��������P!�#(3 \n�!1&72f��`�/��\0��\"P�U�\$�\r0��,QrU&2f��_�X���]�9\"�S'�'�y�8\r����kW)O�)��*Ra%�\\i�%�&ҳ+r��3�S`�,�v��&2�L�&Pu*��-�0\"�%HĬԞ��@ؓ��H�B�P(��\$p&�,1M� �ح��;\rn�.�� I�.�',1�)�4���2�u+�3� `�S��pL\nt��_*�S3;6r�'h35�55䜋d2q+6�8�O7sC\"pm8ҭ��6��9�m\n@e0�<8B�8�<,(���8��\0� �0�J�<@��I���R6pԭmG�\"11�6��.\"����5̂��:��8b�A1�;�';�?<*\$�,�̍o= �T��/3�#��҆�");}elseif($_GET["file"]=="functions.js"){header("Content-Type: text/javascript; charset=utf-8");echo
- lzw_decompress("f:��gCI��\n0��S��a9��S`�����&�(��n0���QI��f��\$�At^ s�G��tf6e��y��()L�S��P'�����R'�fq]\"�s> )�`�H2�Eq9��?�*)��t'��ϧ�\n \r�s<�Pi2IN��*(=2�gX��.3�N�Y4�B<�L���i�̥2��z=�0H���'�ꌚ�u�tt:������e�]`pX9��o5�g��I��,2O4��х�M�S�(�a��#������|�G�b���x�^Z[��G��uTv�(ҝm@V�(���bN<��`��X�1�+��9J8�2\r�K�9�h� ���`�����I8䛱S���t�2�+,��I�� ��p�9a���< \\8Cz��\r��^���]�1\\7�C8_Ep^����M1�w\"'4f�SX9ES|䛅�k3�B@��Xa=No4t7��dD3�p����:)\\;�����\r)8H��44Pc=\n�!pd��QN\r�H�'����2�#\"եm-�b,� �M.���-IK�)��e'��\"���>2X�œe�j:9^�1c���ȝ�:Y�@�u�㓛4�X�&��|�)ђ��-K�x����S��1��\$��@\\�!x]\0��������F�CO�:�1K��*�F4a���k���KϚ����2l�p�3J<��,2��8#� ��\r����� �h����F��݉2P����l(�\$ְ\nJ۷-��ǰcc~�F���r��tb���m{h�.�{�tk�B�Kc�z4�C�9�۫~>�����`Ɠ�C �s:���!c���ڵ�*W�HX:W��;N���j*�/(�_p3��HI�Kl�n!tr�G㭺�tC� v�?m㤣�����\0C����oܥcbf6I��'\r�b��7h�`��9�i�d5��taM�={ɩ�`NoK� !d4��zWXdmH��*���S ]��3&\0ڰ d%A�-�� ��(�������Q�}���U!t7�䋆�>x��t{mY��0�@^��\"�=���@t\r����+Y�.���X�\n�I'KT��^(�D.@���++@�3���X� aE�!,�Y��2-432Ԍ�MO��I\$q% ċG�X9���[R\0n��и P�Jy\r �B�p\\H�pgSɼ�Faejk�.4��C.^�yi��9�PĈe\"ΔNY���BH�#8�B1\"�j\\کx��#��@G 9�2��f.Ќpsr�TJ�x�k���4KIl�f�8z��Kȇ>AK�n^��=&��A��*?'��^%;��4܀���9��Q��h�N��>M�=['�vHI�J�����v��R�t��<��Ҳ�^��z�B^�h�'��ɩ�)-'#��9JT�)�@jO!��c,e�j����@H,���j�a��v�Z�>��ҷ�)E`\0\n��T�P�8L<�c�:F��\$\n��휆��CHm\"�j�y�A�S���S��Q����{T']W��U�)_L��i�m�O������P:g�{��Zė�.�{���Dh\n����a�\r]9�t��!XA�[Ȱ��C��ׁ\n:��ha����\"ݢa2Lm���\\ ��p5�@��@m��|W����%�|u���+hK�L&�� �3�.XW�ٺ���*q��c��%�.K����_�)�u�2W\$O]�d8���g�?mFy�ly�%Ӊ����DQ��.uIJ�������L��,����3��j�0t a�<�\0Pr�mNs8ٌk>M9,����B���x�უzo���uB?`����&�I�<����e�Y�s��zԇ*�.'t����z�)m*4X=�tI=�nѦy�ޚ��c2��`����.Y���:��K�N��r06�_rJ��k�tO�|^͈��z\nϿ鱕�<W�1n.�X�`��g�VG4Z��r�!����Y[���z:L�D��@T �0�`���pjSn\"Y��g �`�}Ě����\n\n�4��\rg��O7ܿb��y��)�E���)w>�~ur���29h�t�gB#�����F�p(�@�`u0�у(flG�a0bZ7J@�I_PZ��yq^��7���G�3d�����3�铄0�����{ָ����a6�P��4W �d:���W\n�t4���.��D�y�ȧ�85��AM�L�Xw5�ese���C #���rrY� Ǯ!�����唟@/\r� �0�wEl\"�O�W�<Q��۠�Ek��SQi�d��\\k٬��8���H����\"�bL}�%� ��-^� _�h\nF�-.�2nj���VM�xnj��m\\\$����*\n���'�~� Z@�����V��L\"���p��5��O,����˹\0\n��-0�\r4�p��b�0f�p�mg�i��O�.(�P9�APH+�NHpf��4?B�M��JF��.���\0�����i�jƀP�+(�&��a��%l]'��l^@(�5�N fs�������bz ��e>�p���k �D�\r4a�N��Y({�D��nƆ���>jĨ1�� ��<�l-�x��\r�G�O Qw��qw�c�P�b\r�̶�� �����d�6����s�ࢎ����ж�r��j>��J����Ȯ�b�3�(F��zސ��r�`O��X��\rZ�q�\r �1\$���gk�l��r+���kf�'�5�8�4�6�\0�-�.i~4�E<\$�J�lru2F;Bn<�%#lq%�� b=��#L�(HJ1b%\r縼�z�����G2��^8w��^%�� ���G�*g�7D\0^�r�c��p��L,����*�Xr�\$ �8��,�*�D�����`�\n���Z���s1l�1�\\{��.I~`�*3���]1�F͑1X -�%#���S3L�l6\$Cr�C/��\r�%,�|��� Ȇnj�� �su8�J���䬗9��h���N�����.���P�Ft��\$�3\n�FB/�=4�-����͏9�# O:I��]#�7B��,:��<�N�D�@�R��\n��#��z�%8i:\0�z�' Y�*�&��/K�֦���U4�z�a>4�\0�f*\0�*TK02�<�0Sf���?D�a4X-�u�j\$E6\0N�i����\n�c9�H����HIb��F�����s�R~t�I���3����L�;% 0p.B�FBnMK��R�sD�'�a��������D\r1�O�\0����s�gL^̅���O>l��C<D�H�-4<��\"V]`�/B��U&�ӹ-#w;�^�M��r�q�0�-�o�~pK��� p���\nq�,4�W�\$F�nl\0�M�L�\n��-�m�\0�)�Z@�Z������^@� ��&Սd���]`�����t\r��'\$^R�'�O]��SЬ�3�5ⓘF\"Q[u�[�H\$�o`6Zu��mo[��]�X�T� �]�Ҟ��\\c�b�:�b�U\0�W2�Vb��e�2/�d%<YRt7�'f�0�u�ru�h�U@cTs�V��gF��{_-_P�E��T:{��V�d����-�Ic���ȁ��M���iv�� J�\0m3@JX�RMU_���p�5)k�kl-\$,Ɠ\r&�\r���O�(o��k+r� �\\�P7\"*^�P�\rc�<>��t#~R�\"�en� ��s���;�D �It��up t@��8d\0�@�lTw�r �ww�~ b� ��J ��u�\n��, u;jַ7s��{*�o�>q�<-\0� �\n����|¹rc��v7�i7O{EC�(�1�p�y�҇n������Z��[r>8�X����{��~j�~��(��(Y`��7_»z%vd�'�%.�\$w/.=�p�&����8V5R=�N�4��(��fu���Jl�j�u`zXQ.�X!������k�q�rp��~��~T���i�c�fn��x��@�S��3*�6��b ���ؤݐ�r�pp��n=)ƭ�\0��L�(L��n�/�-88�s\0zg��\n��L��K�S!m�&����\"���b8}BXZy,ͦd _X���^\r1�z���BuW�7�;s8ly^B�����fZ`�������FyYg��!�� Pl횣O8�f<I�,���\n@���ۍdp4j\0*�\r�l]�y�\r��[=��?+�,'N��}TYs\$w�f�ɛ��\r�D(�M#\$�h�_ey���+�\"K�4\0zY�D�]�.�*�x�����rL�И]\rj ^�@�)���\r��Qrr'p0����\\P�,\"�-sɒPÊ��q�o�w����Ť'�%y�cύ�v�,\rK���P�U@�珈�A�2��ȥq|�� 2\r�\"�Ci���?.���@��<���0��Q�t�ty=D�[F�pG\0Rٳ����'Q@-6�2��*�/@P���d;7[�ؒ!\"z�S�-~o[�D!*�Ʈ0N4 �1�1�8��{l\$D� G�|G\$v!r��-3T�m�ę�\r��q0̽N��n�H�SF d�QR����c��͇ղS\rcC.n��iBx-l�v��@��ᛎ!(�H�X�c�g(���#%�Cn�(P�G9��\"1�7�DG�۲1�So8��S��q�.��p��P h�e��0֬k+�@�c�RG�h� �L���/��`V.FA^\\l����5\0��`\0�E|C�jImPty�AnGu'p�d-����05p��&�I�u%�\nO�<|2\$��@�\r�FDR�^`1���f9�`�/�� �V���;e�\0<<���e�dϲ��1Ҳ����k����D�4V�Yу���������w���kp��;�r�Ɗ�^\ni��\0����c:��)�y�\0zYvz9�]��⫡`W��Y�͝�փ��͋���ؗ�pe��#��1��f���ڵ�']ĵ�?]ĉ-����=�����8�oT�W=���\r���\\ѭl��y���������q=!^��⏅�fq��Z���\0V�]=�F��x�n`�\r�?�t�XQɑ��tZnq<�J\$c����<�����v��k����e֮�\$�^u�^�)i���矗�w�nߪ��S�<�>��G���3�. �<���7���Ĝ�mޥV�iwמ� �0�/\n\r%1�\0y�K���E��\r��Ⳛ�ޠ������e�NL����:C�'?�~��6 ��\$}�jf��R\r�WD��.T\n��N�T�}�_��E|퓗U�}�O'��I�,ʖ7Ϳ���:h������\$�Z0��DV�`t Xn�v�jG�s�9l�����B�㓐��rSF<;�g%v(���(Q��ץP(�\nFl���?j\0o݀3��{�dx�����f��b��W-,Qu�,+��a.Y���l[��%�WSx�\\� �D�G,�l��]@L��\" �|p�?l�Za�8���0!�/�ºo�\$�v�ց��`rߣ��G\0�,��� �0YPN��'0��U��W�0B���2Ag0gD�M�B4�&1�ɚ����w�������!�0��`-�7�F)+��(\0007(r�\$9��Lŀ����T���L�=\"��KQ.N<�X@�}�+ �@��Ȧ�,�������f��~��D/ŘjhZNJ��Cp�A��2C��� f=`�*�|-�s�K;,��\rPxT\"}��C5k�]O����Ύ��!�m�_�F P~�BR���@\0l�w����e��mDj����0%����� P���Jx��&%�B�:8Ct \n�!B'#����C61�Mb\\�u`��\0�&�7x�J�y�D�\rL~3`L&��ɒ�`�B�P����!�Nc�SW}�!� ��\$P\0^���\r�S���^tq? �*GL�P����+�mtY\"����,��\r�C�,��Q�IL�b*\"(���/�'PZ��\n����FዄX���\n����7�<~��7U��[y*ǎ�����7\nh\nZ��� 1\0g-�8\0#�F(��Al�KcfO�Ü����@�\0p:@\\z��8���Bc�M�+af�ƃ�b�\n�P�\$������� {���@%�w��TS²�0�X��f�&=I���{\0��ᚋ�ah�X\\s��\$�@���;�\$�)oC�rD���Б���q�%K�cL\"vP�#�{+\0{�����-ąDL�H�D��T*�D�� ��D��Z9Z\n��?��(<H�`D9��I%�?�ę��8�b~�Qj��U�SE����E��˲S����잠�INJ�Q9���p.����Y����6M���@F� a�I�f,�)�����f#�\nX!i/�\$����T��n, ;�ZM�{,Q��o�:��n�̛�M)��IRO2�ԩ��'5l�1���?ZՏ�Bbp� b,1�ѣ!\$/��RD�!��w��(*E����\n4�r,\"��]�`�X�17[JKJ�!�������!}\$}��g���L�G�#t@�Y��;��(ԍ�|?�\r:(�~\"a�����_\"q��!�8��\0�ы`cC}(�F_+�8LYc���^3.�U�@]!����.P-�|fAU���.#�2&PD zd����LH���)}\0X��\0P����c!���ϡH7R�^�(DdQ�JH(V*�[O�X1��9����WL�I�JD�L\"k�7�\nB�0����c3y��j�0���|&��&�@2� �v��\0/� A��g\"&e1����'\r.�Y�d�!��fU2ʁ�eɇ� p�3p-�PXT�<��\\\0L�DI��%��;2h�5�M@C5陎f��\ntإ�6D�\$�v�(��\"\\� R&R���D�TO\r�\0��l\\p�98��b�Q�%3Cx9d8I���o`'s�˸D�(Ih�!��\0C\0�����`\"���hp0�T�P�p��4�'����)��0z�o��\0��DH�����\\� �\0�E��Ƙ5鬀�sZ#p�\00000=��]��+c�L�&x?3��Fq\0��Pg�-�܀Zs������J�C��P�[O�����F'�oÀ��3\0�L�����#P���3�\\�@�1!�M�ntnB�.�[1sjQ�<��\r=�B!`PR�����2�!��b�+��WB�,<�� 0ʬ�<���e������ќُ�ɒ�)�\$�T>�E� �s}*8�`)�I\n�Ȗ,LʶUҞ?��D�)Re�8�ւ�ݠq�\n��(>E@r��h7Z[�u����2'�@.Sa��VxJ)-0��d�t�a�@wJ�+\"�\\�8� �ؔ����(p(xZt=>h�p3hg?����\0��\0.����1�mK]��/�����J�.��[c�N� f� 0-ҩ�����N���-jBu d|2��i�ݗq���)�W��9H����Ae�Ϛ(�i���t��儌*�R���\n�<�gp HF���ҰZy�7I�9t�PI\n���(��,2e#iV��\"�pγ��P�춚���X�Sj�W�! �r�8�d&�\$a�K�!uU��2�U��/@_��-8�F���P@�V��Ud��v�z���Z�U��H��@QV*�L�b�,�C+�A4ur@��s|g�e��QvM��� \"d�QY�3R��[:(D\0��>\0�u�BJ5S�V�ћl�L��b�V��%ux[h�U�#���Cnٛ%��J�KoJU eβ&\0��0��RJ&T�mcZ�-�t��hy^P��\0�rw�{@�^�t�e�P?2]KN�q�&~�`.,�d�C���(/\$x��*Y��\\�T�Fh�Q��9� ^A�h�[3=��5�|��x���ΡU7��T-P<�\\;b���̢j%�:��\n %�«��r�<�Ŷ�-@`;{-���6��p'8�22ުE/��& �RJ��a\nW�i9��N�OB�\$�\n���E�/25o(��o)ɓ��K\n<e�ϰ+B��,�e��f��݁��A��Ll��yg��1��e�+��\"�ʊ��a e����M���&�����sS�*��ϰ:��d�� ��p�v�Fʊg�H�-E��Y��\n��zgٲ2��v���Ĩ�tZ\0�PR �dp�4��A�l�m3jKN������x@�gЀ�L9�j����+s���)��pQ7@34Is�I1�G[�щ�%V������g�\\��a����o�7۔�6�\r��@_lR�l�u�+�j�zJ�ۖ�����:G��r3���g�rV�P�ҷ0Y(EP\$�[P� �%����D.����^Ȁ�7n�?�nR����!h`�Z\"ⅸ�8�NI3�)BU�S{�sj���0�N�zv�Y���\rp�[5��\0�j2+��,����ԥ*�ݹ%�,���Ĺ��� -��a\0F���\n����+��[��Zl ?���hLɨQ9��@����9C���\\/_����!.o��RP:�����F�C�qIY,3�(�I�q��DG7=�����`�]���:M� �b����\$�A�[qy�6^f��n��h��^��@)� B@u{��B�NG#�P�iZ����.��cO��{�^�w���o�}kj������d�۱5�Si�B�E1�#8�1�nm]�%P6��f���\$Pt�5�.D�%�Ԉ+#Y��X5�lXgSJk�H��W@.@G�w'b��PY���F� 4\$1�Cx�\\Č(�F�A&�S|#��Bl\$�+NMi}���ER�,=U�@��3P Q� �����/�@���>L�|���%�'#��RRD@Â��xC!\\�E��F��/��!t�s���AW������ _���E�!�&c���]eFKG.+@�^iA�ʧ'�Z�Oa�S52O����EF1r�t-�\0�8����~�;V���D�+��7T��V>��� ^��d�ũ�����}��D�\r*������(��R��H�㶵(*�5�� ������(-[)�(p>��o��u�ӝx�6&ϠW��>��苍��T����1���\"�\\�g�l�1�Uz���q���+V#L~X��Y��K��4 �9A]\\q8���J��w�u^�'��K?�%���q!9,���Y4B�M�J�W'������B�A���c:�����y+i�cp�'GL*�q�R���c������?��D���0� \\�MM�\0�&I�ɃK�)u˗��')���F�aw�(O��\0�e2�d��!��@#DG6����.L��F�!�+�]�>h�I\0ߐ+-�x^gЁt��P^�0��������nȾ4����e�j�[Oӎ��]��4�*�\0��ԡO5�]��Ӈ��U�|�t���& \$�8�E�����Ud�j��\0q�ѳd@'<��/���kp�\rf7*I���ؘ@�-^j�����W�ɍH��44�N�&Zʖu�Q�T�_'@;π�r~��h/@:\r�v2�,�VH����[��Ўk|�!6a� ��V\$�jε�f3˭VqL��#�� ~a2��m����ƨ]G&�)b�AA��B�W}�C_B�t��]L.����Ae�����@ȕW6�ޛ���8X��\n\n�y':C@�8K�(��2\"�_P��D`���;�J���4��Hb�Z^l5�P( T(\0�f���\0t��\0�?��P�U~��{\$��'���`�v��4\0^�J Jɪ�����tCmZ� :L� ;�N�#�,�PȺ�s�ĥ\0D����>>��j)��NS�t8\n��ʢ���#xi��@¬�>zr���m{k`����d��R��E�F\n:B�}F(�a�HI�>h��l��<\0'�(�}��1�I�ءǀe�~ã��h�()_��tv�e-D�a�Dz�0��gY�J�����Q���υs����A#���gK����4{�\n��@D�1숉PM��ޒ@^:8�nщ��Dnh�IAT�a4�EO��7��T\0004 ��6_:<�\0[�!vH�h.'�\0���QX�� E�u`v]��p������O������+�ȗh��\0��f@)�ȯ�)���\0[�h�6㰼y\$\"X>�>��q�!Omwu[��P�� \"���e�����;�Tym�ƻcv�v�6ݴ_�+�G` 2uE�mqUB�m{5��m~'��N���������lm���v��˷\r�)l���:��d��g�\0����4���j�qT;n�, D�T�������yC?P{�w8\nz\r�gs�zO�o�2@n'w�t��Ud=t8�������ZP݅8�_���v���0���/Pt(\n[N�V�~n��P.����g�)�U�5��S��c�q�f�]������V־�5�#��p�]r����^\0����y@����>�T-�+�ܻX��a����\0*D[�Q�>�d*���rE@���+ ������� L�g#����Q&���F��Ѣ���Aڣ�}�D[�\0f�*��ِ��,D��~D<\"��VB>@�T\$��@���3P�F�'���FHs���bLJG�56���Q ��3*;L#c�(���^��)�H\\��a�|��!ŏ3bH���g)�02�;1bǓ�&��jn�X����V0X�ֳ����Fd\r���H��gaL�q 'S\n<��8\n\n����7��.x��6�21�P�J\"���\n�t6eU\0�k��9�zK�v���P��LON�Ӫ���]�𠝎P��<םB_�~���ZG��xc�A�0�\0�����z��L(t�8�>��ݠHp��<��9��E^{|O<��p�Ra>n����4|9aϜ���śx��\"��n�~b����Hx��^G���kΦ�s�Ё�");}elseif($_GET["file"]=="jush.js"){header("Content-Type: text/javascript; charset=utf-8");echo
- lzw_decompress("v0��F����==��FS ��_6MƳ���r:�E�CI��o:�C��Xc��\r�J(:=�E���a28�x�?�'�i�SANN���xs�NB��Vl0���S ��Ul�(D|҄��P��>�E�㩶yHch��-3Eb�� �b��pE�p�9.����~\n�?Kb�iw|�`��d.�x8EN��!��2��3���\r���Y���y6GFmY�8o7\n\r�0��\0�Dbc�!�Q7Шd8���~��N)�Eг`�Ns��`�S)�O���/�<�x�9�o�����3n��2�!r�:;�+�9�CȨ���\n<�`��b�\\�?�`�4\r#`�<�Be�B#�N ��\r.D`��j�4���p�ar��㢺�>�8�\$�c��1�c���c����{n7����A�N�RLi\r1���!�(�j´�+��62�X�8+����.\r����!x���h�'��6S�\0R����O�\n��1(W0���7q��:N�E:68n+��մ5_(�s�\r��/m�6P�@�EQ���9\n�V-���\"�.:�J��8we�q�|؇�X�]��Y X�e�zW�� �7��Z1��hQf��u�j�4Z{p\\AU�J<��k��@�ɍ��@�}&���L7U�wuYh��2��@�u� P�7�A�h����3Û��XEͅZ�]�l�@Mplv�)� ��HW���y>�Y�-�Y��/�������hC�[*��F�#~�!�`�\r#0P�C˝�f������\\���^�%B<�\\�f�ޱ�����&/�O��L\\jF��jZ�1�\\:ƴ>�N��XaF�A�������f�h{\"s\n�64������?�8�^p�\"띰�ȸ\\�e(�P�N��q[g��r�&�}Ph���W��*��r_s�P�h���\n���om������#���.�\0@�pdW �\$Һ�Q۽Tl0� ��HdH�)��ۏ��)P���H�g��U����B�e\r�t:��\0)\"�t�,�����[�(D�O\nR8!�Ƭ֚��lA�V��4�h��Sq<��@}���gK�]���]�=90��'����wA<����a�~��W��D|A���2�X�U2��yŊ��=�p)�\0P �s��n�3�r�f\0�F���v��G��I@�%���+��_I`����\r.��N���KI�[�ʖSJ���aUf�Sz���M��%��\"Q|9��Bc�a�q\0�8�#�<a��:z1Uf��>�Z�l������e5#U@iUG��n�%Ұs���;gxL�pP�?B��Q�\\�b��龒Q�=7�:��ݡQ�\r:�t�:y(� �\n�d)���\n�X;����CaA�\r���P�GH�!���@�9\n\nAl~H���V\ns��ի�Ư�bBr���������3�\r�P�%�ф\r}b/�Α\$�5�P�C�\"w�B_��U�gAt��夅�^Q��U���j���Bvh졄4�)��+�)<�j^�<L��4U*���Bg�����*n�ʖ�-���� 9O\$��طzyM�3�\\9���.o�����E(i������7 tߚ�-&�\nj!\r��y�y�D1g���]��yR�7\"������~����)TZ0E9M�YZtXe!�f�@�{Ȭyl 8�;���R{��8�Į�e�+UL�'�F�1���8PE5- �_!�7��[2�J��;�HR��ǹ�8p痲݇@��0,ծpsK0\r�4��\$sJ���4�DZ��I��'\$cL�R��MpY&����i�z3G�zҚJ%��P�-��[�/x�T�{p��z�C�v���:�V'�\\��KJa��M�&���Ӿ\"�e�o^Q+h^��iT��1�OR�l�,5[ݘ\$��)��N�\n��[�b���|;���p�74�ܔ¢��I�C�\\��X��\n%�h�I��4�g�P:<���k�1Q�+\\��^咠�V��C���W��`83B-9F@�n�T>���lj-����&��`9q�������P�y6��\r.y�&���ả��E8�0����kA��V�T7�p��x�)ޡ~�M���!�Et���P\\��ϗm~c�B�\\\n�m�v{���9`G[��~xsL�\\�I����Xwy\n��u����S�c���1?A�*���{�����Ϳ�|9/����E��4��/�W�[ȳ>��]�r����v�~B� PB`T�H>0�B��)�>�N!4\"���xW-�X)�0�BhA0�J2P@>�AA)�S��n��n�O�Q�����b�r���Ҧ�����h��@ȋ��(��\n�F��ϖ�ƙ�(�γ��P\0�N��o}��l�<�n������l�oq\0/Q\0of*ʑN��P�\r/�pA�Y\0p\\��~��b�Lh �!�� �P��d�.��y\no\0���ж�Ppt�P�ov�Ђkn��\0z+�l6������0���P�oF�N��F��Op��N`���\rog��0}P�\n��@���15\r�9\$M\r�\\�\ngg�����\$Q \r��Dd���8\$��k�D�j֢Ԇ�&�������bѬ�갿�� �=\n0������Pؠ~ج6e���2%�x\"p�@X��~���?�цZelf\0�Z), ,^�`�\0�8&���٩��r�� ���kFJ��P>V��ԍp��8%2>�Bm���@�G(��s\$��d�̜v�\"�p�w��6��}(V�Kˠ�K�L ¾���W��q�\r���̤ʀQ�L%�P�dJ��H�NxK:\n�� �%fn��%Ҍ�D�M� �[#�T\r��r�.�LL�&W/>h6@�E���LP�v�C��6O:Yh^mn6�n�j>7`z`N�\\�j\rg�\r�i2I\$\"@�[`�hM�3q3d��\0ֵ��ys\$`�D��\$\0�QOf1�&�\"~0��`��\"@ZG�) Y:S��D.S%͈���3�� d��m�U5����<�S�SZ3�%r�����{�e3Cu6�o73�d�L\"�c7�LN��Y���k�>����.�p��2�Q�������3�VذWB�DtCq#C@�I�P�DT_D�:��Q<�UF�=�1�@\$��6�<c�r�f%��,|�27#w7�Tq��6s�l-1cP�m�q��\n@���5\0P!`\\\r@�\"C�-\0RR�tFH8�|N��-��d�g���\r��)F�*h�`���CK4�1�ʍkMKCRf@w4B�J��2\"䌴�\r1Q4�2,\"��'��x��y�R�%RēS�5K��IFz #XP�>��f��-WX\r���pU��D�t&7@����?���� ���}O1�2��2�#UK*�)�긋�0o<>�]H���ƿr�LGN���W%��M^��9X:�ɥN�����s�E��@xy�(H�ƙMd�5<52B� �k!>\r^J`�I�S�N��4'ƚ*�*`�>��`|�0,�DJ�Fxb���4lTؕ�[��[�\\���Ԡ�\\{��6\\ޖ� ��(#mJԣ,�`�I��J�խ���l�� �j�j֟?֣kG�k�T9��]3ohuJ����W�\rk��)\0�3��@x�,�-� 5B����=��࣐#�gf��&���Z`�#�o��Xf��\r �Jh�����5rqnz���s�,6�o�tD�y���b��h��Ctn�9n���`�X�&�\r'tpL�7�Η�&���l�Z-��w�{r��@iUzM�{rxא�m�SB�\r@� H*BD.7�(��3XCV �<W�у�|d�q*@��@���+x��̼`��^�̘߬__��ND�X\0Q_D]}t�Y��p�f�w��\"�3�z�n«MY��ZR\0��Q�?�{�M3���*�1 ,�\"�g*U�*���̫zҌW5NV2O-|��ɍӁ�,�]�B�d�\r��/O�t��Á��0�xƆ���ЮOC�8�-0�\r���0���@]�X̊���\\\0�0N��у4�i�;��At�8X�x�\r����������݊��7�<�@Sl�'L��9W� �θ�Ϭ����ı��R����\r�Ϡ���|�X��a���7y���\rwe����Y!��E�������cRIdBOk�28[�m�J�+L ��ٸOXpf���9ѝDϛ��ߪw�@˓�Y�������\\y�Ac٣�Xg��%����1��j �X�9Cc݇�R����QF�pd�=�C�����\n\r�Ց��dj�٫�xE��2FX��x_��ţ�5���}q���M%�ZM�:\n�zW�X7���:�Zi�npY;��>ʘ��Ɇ:6�;�Z�X0��̢#��c�MyU�i2,q�F˚�b�J @�gG�|4�g��mzW��� �)��r|�X`Sc�է�˙��c����!�B�����/}{4J�\0�Ýn�Kuz @�m�Ѯ�߭y͞�y�\"�)u�����Y睘s�c�y둶����y�����7�|��|��{Ϙ*)��4Y`ϵ[v������^NX�������W�����7�;�_��*x����\r�߉xm+�m���� ����\$\n�l�);���|٠�ڙ�:�N��:���_�8N��U�5;�p+U�L��\\�9������O:I����zQ�����T��)�XG���J{w8���ʼn�U��\$������PxTY�pjh��J�À��J�{���@�ǂ����Z���s��h˘�X�\0ۖlӖ����θ����Y}�����^�@u2�S�#U��;È|�������P\\��#��|�<��\\����J�,����\\�̚E����]W�l��,���ɖ<�Ό�>Yn�),Ιr���Լ�⍺]�� �\$����q�DJ�=����X�I-�ŀ���a�ll�õ]\\�w(i�C�׃t��<i-u[uV�D֓�Q¸�xb�k�LI�.k��@����N��[�l<o=-]1`蔼�d���M�7�@�%C=]�����/|-������q�������*�C��O~�Q��s�`��(���D��ɲ��[���>�k�R�u��\\+>)3��P��P���6��M%���pԌ��A�3qmu2�fz�ۯ�4s� ��`ێ��-k�S%6\"IT5��~��\"���Ut_ Tuv�ֽ�Yw���0I7���L�\$��1M�?�e@3�q{,����\"&Vi����I�?��m����UWR��\"uiT��u�q��j\"�G�����(��-��By��5�c��?��w���T��`ei��Jtb�g�U�3����@��~�+���\0M�G�7`���\0�_�-��?\r�V��?�FO�6�`\no�ϚIn��*p���e���\"T{[Гp^��\nlh@l0[/���po�JK�X����<�=�9{Ǿ6�<eߏAx���ǂ���4x[͞L�~>!�OQx�{ZVFԎ`���~I�ߖ��L)�Q[�T��M����T�*BC�~ ���\n��gÈŅp9zK���w��zO9di^�'�+���Dz4�gHA��Ly��\n�r�<I�jKQ�Sn�==\r.�o7½��%a;�k��mX��Zi%P�i�\r������/��L`pR0��&���I (��\\.�*m�*�(�֎��\$����\nw��Х�8a�\n&���Um� M֨P+\"Ly��?�M\n�2� L\nbS �N���r�!w�jw`��\$��r���a�v�^�q�F��6���i*����_x��\n�f�I�:B&�6@�ɓKED����QD(V`.1\0Q\$��F��H��T���zІ��\r�jkzM����Y��(61��x�+�%dj��o\n¦�\rg��\"�Ɍ���?�1- 3h�X��)�yj�5r�N�#Q����w{_���G)���1i�� ��<�Z��pX���\$�?�=%.��Ү&��%\\�8w�!��a4�<JB[�ĺ�u4�%��47��%gѐ�&��Z(@ �E�{@��#��2�h@�#���џ���@\$�8\n\0U��j�A(ׁ�2�O��8ڀ�5����@��&'�\n�D�\$i#��#�t\n�P�Ts#]P* �D�uc���P�O|pc���P ގ�i#�}��:<��\0\0����ťlo#}�F�R�Tp@��'� `Q�ycTp(Ɗ@�eh\0��Ձ8\nrx� c�<`N���:)DY\n*D��2{dZ)A��4�����cZL�2��<��\\�\$r#����7�����!�����N�{O�@\$�< Ѣ��V�Z�ƞ52.�A�#D0��\0��I���\"P'�H �_)�x@��*��AOh�hI)I�L1����%�JI�B���g�i\"p��K2}���(C���=�t�xC��&F� r���o��@@'��% �H�T�Ꮘ �Ԙ:=�)\0.�]��5 .���(p��L!�8�\0�� �R\0L�Ya�bk�6�)Y��� �Ԯ� h�zZ����Ig�VO3o��Lg�3�Y2�ۉ�DoP�`3̸ec-�r7�2ԗD����B��Z���%�/I{M�\0p��́.`���o*�ԯ%�T��\0�&�iR\n�+�o���\r�^2q���\0\\�I@� �K�#peC*!>�/�%|ȅ̒�ގ��\$�)���1P30(\r�+\nZ�z��))\0*�\0k����2��υ(�E86�s�t�f&������+;��76&�K�_�(�9f�,@-��4l\$ۂe7\0��:l�L��M7�.\0��|��o�J۩��Z�u�̺�'�y{�H,#\0vU@9!�� �'��&��G���@_-ٿ��t�;���:����u�<��L�i�Κ_ꀝأ@U6���#�_�L'~��/�m`\\T�']=I��t�Ǟ���)��q�s�9�a<RPº|�t��t&5��s�l�@� �K�wS���l�:9�N�wS��|�g���O��AП<�BȀ\0�/�z@� ������=?=i�O��kӟ=\0E@i��\$BנhO\0�>D�P��U��цj�H��9F�BcCi��BwM��t�x�P��M�?p��=���8�����lg~���t�a��%]b\$��\r�r���a,6�t��W)�\0U��F� |�쓢�vh�Q�*��O�l.C\$�\\��ցRR�<lc��&Cj3��%�ZM���z9GpY��\0i\$D��d��zt[')[)Q����k�pi0�#cþ��NE��(�C2L �@9�h�EJ5�,�h{&Jz�0n�v��>[��j���[�]�K��R�J�>.;���F=Rڌ�<r��M�=�Ԓ��h�^Y\\Rmn��� Nn*g�����B��5^Q҉@O��x��HI�T���9�)(��&��}A)P�\\/��_�!́H��ڑ���\0�B��\$z4�TYu�J�v\0ꏃ���%@�32\0S�m�--�Gi@��Q�%�j�Y�+FuzlS����W3�ŷOr�U\$E��;�M��\\�Ա�u/��jeQ����,#J��XP�<UH�TVV�#U��Ub�OU�DZ�⢵��8��UJuS�����g)XDZK���B�\n�@2���x@d&�� ��eܫI�@�Fw�8��\$�'I�V�V�U\$�ET�_�*�d�/�FC�Ydp��vG��3���њ�L^(�`�j��2S���c�W��JQYi�HB���ck�R�\n��U\$j�\n�ZAi�U*wKDRxW�L�+f���@�A4��Gz�R\n�5�b�\\_�� ���0�C@�\$X\0+�]����\"?�n��+QIj\n�x\r��B`S��M�����\r�o�@��6X�\"{�\0��b��)��M��cM�W �D_�α�v@{c�:��%[%��C��1��;Aƈ��Tn� \0� a�p��e~�U5 s�V��e|M9��9 h�@�\0��~�@.� �l�� Jv]��D�f�7�F�ᱳ���,/+:����XIi�\0U��@N���\r�ʢ,�.�i����m_�F�������YiU��J�!�g�Lj�����D�iKA��6����-U�Kf�_N�\0�-3����3+�d�i�D \"���M�ml�L�X��㯸��>�&|U�с�`�h��2���n6����I+�né-nD��`�����ɔ�@�B!;X�smȯ��pC`�p5����O�%Z/��5���#CK`�X���cb�Q#��Qa������q��p���)��G+~ۖ��\"�lM_^z��!���E���Х������a���p86��n+o�J����,��w\n�]̓p��R��'�e�J�q��'ܨ%�'�nlO�h@>NBȊX5�,�����rGr���Z l\r(�ˑjI���l��%b�;s+�נ�Wg7�)�*e��1����3�L�e@(�p\0��Î�ds��A��D\0Í\\bD�\nu�/&1��XRץE楂5�T�\r�}7��������A٬���k�\\���͵����q�2܀��Z-wo���t�Z����]�-yq2j+Ն�խë���n�XA��\0�\0��+S�+�Y6_B�V�7z�nZ@̆�Էƴ]�-UMJc*������s\"�+\0��x�B3^���0\r������c��\\j��*�P-\\Q8�ʎ���l�c�%X��VB�}�,��;(�`*Q� \$���r��{�K��C��%�\r��x ��Q���,�����/�v��\" p���~ ��� �J5e����E�-^�X;c�\\��m��7��?�6C*庮�,7�Hf�/�9e�0[@��!b����UБ=��i.Joc�j;��B�\0���]Ք��v�G��8�O\\\0�NJ�O��\$��.& p��\\�H1b�p��:F\"8Ŷ�����Vx����R��x��=�3�f1��+|��\0�B��kb�P�Lђ��\$z����c ���i,Pcb,p�n(��,��`�'/�~��kֵ��p�q-��ȱ�V��܆��\r�� \0��dS�����+�\"�鈭1\0(�-��1~�tc��f���Bۑb}ؠ��0<1\r���L���\$��2d\"1�&�ƀBóN��\r��B\rr��\"?v�d�Z��.\".\0?w��9�o��\r�0�с�!��dR��뤶\0���H��ra�%Њ�+\0yr�H�sϒ4W#�,\$�� \0�*xB�\nP���|� 8@/�\0�2U���b�����Ϊx�!�d����N�3S�?��P���(�g\n8��pp����S9�@�' �\0�y���\0�y4�6�H<�����\n`S������CY�����jp:\0N(Ӎ��X4�k���g�Dy��<�n4���rS<�����?�\n��B��f('���~dgәS��?<��Vg(1����2������)���f`�Z��a�>t{������>��\0��P�`O��\\s�<�?4�w�~���f@z���~hBW������xhA���O'=�Pײ����=��c[ys���g�|���掳%�M�,Q���8'X �hlUs���٢� �4��qD��x*�8g�NL�BȖ�;�}%e�@Y�v�ho!\$�NcCX��@�;YH'���@^ ���Rf^x�\0^os�_f���;��pj]�:�Ԥ��.mL�l\r���V�\0�@܀��\"���1%�!_��@-]8f����-����a�]Y�W�ψh`(���J�@���\r����Y kB(�x��:5�B\\QkO[:�0�¼��uk�X�\\�P\0�[�x��Ů�`�RIG��k5�����Yz��Pҙ�=�l=���e�\0�2=k` �[K��B�����8��C��}k�c{#�آ��l�dfF.̵�-�A���6��K��������P�v�'��lHiA��8C��� G�`Gbyپ��- 0�Ĭ;[*_���m�lH{(;Uo���*�]�,ċ������X���80C��K �!N���(I`�� V�Dv���w�rpc,�����\0���9~s�Xn������r[ec�4d�p�i \\��e2���l��aZCk�gl�bB���7x%������Ż��k`�\n�(@ź���5�ݘ�ϭċ#t��ܖ��E�}ńs�Lv��E���\nQQ۔���76}��Or��j�b�%@7���۵�h�w�n�k�`V�q�����~���~���4��{�������ˁ;���8p2mP+ d�aX8&,=�n�}�!�/�K&\r��t�H��)/��Y���6@�=}���EU��lK��\\k�b[��1G����M�)�J�xX�E�T� /�\"-��<4�xD�����p�(�3�ʟ�ߴ�'�+�\$\r��<r��n`H\\t\"��70=��Y�W�hs�\r�w�~�!�0@6l�\\� ��/�B�7������>F��܉\\��Rپ-�n���ܧ\n�?F~��a��+x�����\r�l,f�C�+���w�i�G����.X!�_�71ym�~���D��7��� ��������G;g�w��b/89��x�@!R�9�éJq�Y�h�'3���Ĭ*��Xw�ˮ^��� �7���5�����`�:�#��+ۭ0����S��@0�o7:&~r(Z��G1z������p���d�N��`�/Fz@8�t0�Z�_ ���0��{��L�n��ׇoE�Í��=r���Gj]��H����ҷ���Af+���V����m��7���B����*q��}c�w��=ۄg��wE�-H�������&Rh4��M�Z��_L��]W��V'�զ���\"u�@-�aM�s�@9�L:�Ւ]�#��a�oyb�\n\0[��r�p*}Q�bw����?����;Vc���ʰ�� �.�s索X�ְ�y�R=�&d��r�O����2�j!�ux�����R{N�&��ѻ�5��}��vy۰�1o8Z#��{��N�r�����Q:B�HzW{��W{:�r����}D\$�j7)�P������CvV��X���d�D7�፮���,�h���_�]�^�qσܟxO�]���?p{�\"��O�8Q�?xw}�J�?�9k���x�5bu�&����o���^�����>�w�g]��h�#�?+���m�(�����/ng� �5�5<�;����ȅ�˳��x�%���;�(��V�;��o-��˽���.e�nkp���_�F�X�9�Wj�Q���CBا�v3R=�솦;a�][y�Ȼ4�/�|��##v� @_ǭ}U�M>����1���\rC�M�q��C�����mc�,kzy4��K���ބ���>�a��!i1�p\nA`�J�x�V,�\n}�K��+���s�J�v��(S=��#�:M>���U�� z��ڞ�����y4�&=@M��X�0P'{b6 E � #���@M���6uOu�K�_\r��)E�)�G9��Z>�o#�G��l@��%�L������s�0 Z/����+���@_������=����||0���O�~�y|O�~����E�/rH�j�\\>�׀t-���,!`�7��Vo�G9�k����C��������\n��}�!�Q-G�>���v;ޞ�����o�|@ 2?(����jI��\0S��>��X��X|���6 4��?v���?��~7��/��o||d\n_��o���-���k7>��_���S�����~/�>~��� �����P�~C�?+Y�@���*|�*�2���>m�}�������o�|O���ݿR�{���p��#P��o¿�+ܠ\"��z3�\$���0 �>�+�\n���� ������߾��c� ���#��>��K�P>�\0��/������;�l�x>��`\"����H�3���:��\0��9쳛\0��i�n?@\n�u�>c��瀪jCP'���BO�>2��ܠ#�&%(0�����3�������,@|�� ,�K�\n/�@������|�S )���,�@x�9L�\$����쀫 3@�K��*�@��pFA`&@{����� 0J���C�b0?�����?p�\0 � #�`���3ao#�z:`>Aa �or���ͿH�X�����O������o@�[��3���[����*O�#~\\(����P\np+��?+��4\0u@�PU�?x� �A�\n�`\$�j\n��\\���,��A���oď����oA��B�͏��������?(�'��\0�t��pV���\n�=��T#�>�ΫC������ \"?x���;� 0z#�>�\$P|\0��%����7�Bb�\0��Bk���Bb��\n�\0��R6 >=�X \0>#�ΓEL۾\"�������>�60��U\n�N/����\n�14>P 𤀗�I\0������<>�ါA��KD`'�����0���4\r��B�Xx\0������W������36P�>d?�\"c��+l1��������>h�H �b��<��B��3�BC:�#D��=��3�.���Dϛ�r?2B�!�h�+��3���G>���\0)C\r�*�\r�e P������4�\$9P3��?s7�Ab�8���æ�D3��C��h�IR6�4â��:p�B#�PVC)\$<0�Bo�=��������C�L\"��A];�@'B��;@��>�8P�B]\n�@�CE, *ASݍ3� �A��\0�+1\n?K�;3�\"��B�\"N1 DI\r<0��@�X/rDQTC/��gTB��?��\n�9\0���90�����#�\$��7�DY4%1%Db?+�I\rB��\$,�\0���JQ+��DJ���� ���Ğ���/���� y?�3D\0&��0j��S�D�y����/� ���ďHl����!q+#�h �����%�o{�شT>��F�~|�HB��P0��> \nc�nD1����T�L8qSC�ͺ5�Ay�0�\"�W 23D�>��0�D��hj��Ø�\$LQ�����_EO�5�C;\n� ���X�3�@[��@�(��Atp��%�`DiTP*X\n�+���(�}Ed]�xB���n>����'��p\0�8\n����\n�M�A�Zo�C����\\>#<@\$�s�b����b���6>��0��M\n8�3�yAt���4���M/��B��D�C�\0C�d����.��#o�#?\$h F�͚N/�B����1�Ɩ�DhpDƔ��q����h�(\0��J��(0�IAz����!��P��+�ec�>�?(��]��ܬ�\$�\rD!h�*<���������\$*O�C�l.�V\$>�A\r#����@���<@\">�h��)@��DRQ���dr 'A|�S�����\\g��F]�Q�3�>� ,��?A-�GeH��ӣ~����Gn��6��Gb�������3����P�\$/����搳�1D��-C�� #�퀜�\0����0>�Y�M�?tM�=�q���|��E���P��4D23��=��\n�B�P\n�B�toPF�,H��B�\nT]#�?E���۾{�4��@����v�)\0������Y ����!\$�O�Ĉ��\r��@� d\r�m@��+i\rF��5I\0c`\n�Hx����E% RP�@���94F��H%���RS1DȠ��NM���i`%�� �A\0+�2KL�o�D �9`&\0��4��B����đ#kp�� ���;�x2�s!K��@1#� ��L�\$`�EE���>�{���Le�yC����x@!K葖�;� )��e��>i!�e����!��ã<s��\0D0o�?�0��@�%�>\rB�ZN`\"@-kD���;D�14D?\n5-\$8��֒ҎD�d4>KL��C&pvF�!L�R�w`��\rHq�D��@�?3��P�4�\$�i1��?3�Rx#6��2MIJ�B0�>U�\nQ�(���|\0��y�yH�>�j��!%�|0�U �/�J���2Č��J������/��\nL6�b�k�?�t�ow>���<D���!��?9�T1:CT���Eŝ쉰O�7|�)GΣ撠��\"lMxJ��a��D�\0�e�\0�>ă�@�I\nk���i��D䀸\$3C�d���\"@<�\$�\n?I��+H8 ��N\$������t ���+��Mw��J�.��\$\r��\$i*��:�6�8� ``����f\0>'�݊`ז* 0��ˈ��<�s��^�o����:ӻ���\0��V̬�7\0���\r�1Kb�H���=-��2�\0�����K|��)*��.���4 ��Y8m@º����������\$:���J�H*M�˾E�E��K�l����.���F��=�ތg )Fv� o���*\r�\"\0���0#����� 4�\0�\n�]J�LoΤ?D����B���\0p0�&�1 �� )���7�\$G/�o��A��d�)(BAc�Q���1�Ņ1,;q\r��d�3LX�6���a1�p��Z��NS�D��@�2�s\"?��,!X3j9��7��ri�����)��D˪Q8,|��.��p3/�I3Pp!��J�������Ӓ��%�S0ʘ��<u09\r��\0ژJ�;�TY���k.h5f�:���]4��/�T��.���0��� �<;P���,���C�t\0�\rx�\r��.IbOo,��g<\$��!;� �\\�\0�,�5�>�? �Ų�)�.�[�W��+��\0>�ޤ�A{M�5��� �<N\n�SNͰ\rb,�4�RY;�W��Y:-���*]KR���>\0�5 5sNM�P�%泂.s�7R_`���!��Nt��EZu2G �C7�� �r[2�OSF��8Y�O:�� 3�|�\$��v*ܻSX��]+\"U,,�y��NPd�ᎌ�#�S�Y4!}���,ў2��I�=L��J1�;,�č� :�!�t�6/s��Θ\$�r�8B�PS��~�; 4N�3� 5ο- 3F.ʜ�)�8jԜ�\$��VH@�\0���sM���ǵί+�����_5�>��\"VPgN\\�X.�θ<�eǀ�:�A�;��݈`���0=8G��Δ��k�?.�f2��I�*�:���z\$�A�ONԜ�Rθ�<ۈ���=�I�aN�=�X�\n�;�B_KE=L�aO��:��@�Mu=�S���=�3���;�s��;\"��\0�>��2�{4�!�u������ Ta�9�u\$��\n ��u:FY4��?��Ķ+{�\0�˚���O���0�Yd��9�+��͈a�͋@��S��Y9Zr��?�OS��\0���`�̈́!X0�\$v@��9N�bl��\n>J���1Ka/��SA����3��J8<�\".*ؕA�6��.��~��d���.�@���<�Π�P���\nr�7�/��,6+;��-�N�\r�J̱�;Cz\0�P���`��2��ОLMӾ;PS�g�~�\nPC�v�=�����(%���<����0��;��9��s7\0��fN]D��4H��8�`�\$Q2�`N�C;�y�.c4��M���TT5 c�&���3�>V��܁O;F����̶/-�a�r��r���\r`1L��h@�\r�XH��ڭ��Q�v�Je4J�F��΅IF���h:�+�[n�\rM?�@ɘ�Ti�\0`c�h�`P@����F�;2�Ѵ%U�2Q�G&����f��a���?P��O?9�\0004:��% ̣3��K��\r��\n>�T�%Ѓ�,4���<���:F!�d�gK0�Ћ�\0L�s���V:cs�8M;-��r�Q�:� �Rl6ĻR��d��'t���IXK��0����\0�J/6���}�����D���A̽ӬK\$������\\� ��W-˥t�\0�.(6�Kz��-R�7:��-�d��/].+ �wK��T�&�-�@2R��/���L/r�R�����Q�-�,��Q�\$�-4�K�Ke2R���L�/��SI�;4�SL3��R�L�2��K�M\r\$.�\0�/�\"S��̕Լ`�K�M���R�M�#��˺�(4��+�����_,SP�L��\r���Y�Ľ�F0~��MZ��MԤD��̀�!1�\0�2�{��4M�w|�4�O,�8Z\"Ä-C�C�@��O+�F1� �su�\r>��� P\"S�P�,=\0004�LL5!��4�:�=@�Q�O�@t���3�f����e}@C��-J1�-�B�Q��P�I��SI�B�+�VX1O��=P%�7[D��� �dTVE�I��B��F�zhAtQ�/�?SV=8�͞Tn�=<Op�\"�?'~��Ib���8`���QS��8�P�H�2f�6�9�WO��;�B+��0�\0�����P|�%��8�B�';Ot5��S�o��T)S�4�TP�L�BԍOuPt�T�R0���:�-Q 3�)E\rE��TaQX��?T�6�^�8�N<�S�K� \n�S��]B�'G%B���T�En��ϱ�8�r�B�#^��>�QX6��M���7;B�N�<<x\rHt�5S}Z����.�15R��ULkT�_�c.�\r\\4�П3�,@1�485���a�\r��yA@0��i�*�yW�� ��W�u�<X)�/8X@��VQ�ǵ}<=T�aT�/]`t�T�0j�V�ثu�U�W��@��*z��\r�6 4��E�z�\$�\"14���`H5���,��U�ɘJ�,�bS��Z�h�P�\$���S�V%WX`�8J�\n�^��Ԓ3�i�?�\05f4<S�SMC\r�\r�j���\0�\ra��Xa1Ն���㵑%?P\"U'V~\rQ�ST�[�Z��UT�ouB�V|3s��7Y�?����Y�qAVnJ-_5�U\n�*g\r6�\$������dMcՀV+9Sk�?�:]�҇X�b��4ua���i]}t��2�Dk���]Y�5_�C]�ĵ�\0�X*U�\n?U}s���0��f=R��\r,;�� G�1-m�T�x\0��YP�����\r�c���id�<2}x`�V�(�8N�V�9ut&D�R%m-���.�е�SX���rU,��y*��_݀U���+�N����4��aׄ�U��ZL0T5s��X`��V exs �V�C\"=Wb/�G� W�ɛn@� ��>@6V8�*�>\0�`�w�.� �8S���(�� �3� 6Xp5]`���a�HӼ��\n��.<Wb6V^<�5π�(I6�SجdKy\nt�\0[�a���1X\\s�شm�d5�X�b������@�ӎ�a]�Y��c(Q��3�W��C˂V뽆`��Ɛ���@��U[V�X5��YK��6I��4qd�9�5Xeu�8�`4�J��>dKp��OF���VS��!qtE���e(�a�\r�sW�e��n��^ +VYW�edVQNe%V6���Ճu�7�Y=\r�H�Xcz&W�;c��+=B��,oԧ+�\r��7+�A�\0�7�h,�Q�\ri�3ON�A�@���<��SVM��ݞժ����UDNW5�62��62'�\\M\r5W�cՀS]0�%Q�uT�ʱE��Rt�V��\nE�u���c���5��8�J�*��J�Z:ؽN���;SH7Bϒ+��w~݅�52O�c��5��\0c��vXX��}�AZ~����zU\\A/.e�H�ͅу�U�ak��fy0�6BP։��`��5�4��TYfCqa�:�I%[̣P�g�斱T�+uw�N��Ď\"O�>��6�\n��� ˝V�#R��V���k�M����Av\0���^\rgº�\\mrTz��-\rc3N�%Sb��#ReMfW�MX\r��S�Y�'M;m=p\n��4�2�[d -���ע�5���l<�vӒ<��V&�aOMQ�Q@�-C �ڑm�d����T�m��VH\rc9��p�d���P�\\�v��@-�!+��o`S�YO����كo+p�\n�6�T\rkr�XB\"�����P��]���UV��_o-V͗��䣐6�۬��]���n�>T��B5��ļN������g8�BU[�pU�`<�� t�a�\0�:͇ի��\"(\\[3�����b\$��M�e��u6\r���\\}5у�L�[9� ܈G��W|�\r�V�\\h���Q8>A���GEʣZ�r�=�tV�n�UUm��nԳ1\\%n�\r����Z�2�[R�+<TSUUQ�[J���� �\"�hR��7U��/[PHY��Z0��5�\\!m,�>��r�}�#1�t������5S�@:�{6�MwU=�AR�[�p7�[ձ\$���RoVpֻ[�D �]5[�p�][R[�Nڒ�o�S��S�8\"?�Y[Б��PD�,�Y�\0��U']�����8�q��]�3��7m�^z�N��Z\n����Y�t���8��C��1V�`�M�gJ�E�E�:Q�u��a[�v�җ|�w�y���M7|�X�r�^Ex-���]�r�W*55xiy�\"3�����W[ `�K\$)�{ �_]���5L�y%[�Ҝ�yC��Y�Iw����!�@|٢V�+s\"V0��AR;�y��U=�Ow\$ؗ�=E��K��h�M�_�䵼ݒ����f��a�U����=#�Ԁ��:��MUA����WO�QG��s��w�\\�<AS�7~�\r�ՠ^�f`J�5�I{�o\0;����\"�_tx���V�^��\\��\r��^�g��Ջ�ayH7D��!|k.v�l�������h�.[�� ת]-e��X_NpՔ�>=fH�U��O��5�nH���s�M-�3���1�p-���W CL��\\��1S��y{�&w�[�\"�v��%~�\rw�V�l`�+ կU��߰j�aO��\r}�*]_V��5��5�%i�Y8U���D\r�V�Z�~e��ً(�b��;u�Q�.��\0�_|n\0��W�S��ڟS��ς���c۶ט��u�ز\r떰���.�7Q@���_�-�d�TPŧu\\�X�U�P��~���U��`ENi����B��D��\n99!�BN�9�^�8�cH�C?H���������");}else{header("Content-Type: image/gif");switch($_GET["file"]){case"plus.gif":echo"GIF89a\0\0�\0001���\0\0����\0\0\0!�\0\0\0,\0\0\0\0\0\0!�����M��*)�o��) q��e���#��L�\0;";break;case"cross.gif":echo"GIF89a\0\0�\0001���\0\0����\0\0\0!�\0\0\0,\0\0\0\0\0\0#�����#\na�Fo~y�.�_wa��1�J�G�L�6]\0\0;";break;case"up.gif":echo"GIF89a\0\0�\0001���\0\0����\0\0\0!�\0\0\0,\0\0\0\0\0\0 �����MQN\n�}��a8�y�aŶ�\0��\0;";break;case"down.gif":echo"GIF89a\0\0�\0001���\0\0����\0\0\0!�\0\0\0,\0\0\0\0\0\0 �����M��*)�[W�\\��L&ٜƶ�\0��\0;";break;case"arrow.gif":echo"GIF89a\0\n\0�\0\0������!�\0\0\0,\0\0\0\0\0\n\0\0�i������Ӳ\0\0;";break;}}exit;}
- require_once __DIR__.'/../inc/global.inc.php';
- if (!isset($_configuration['db_manager_enabled']) || !$_configuration['db_manager_enabled']) {
- die('Setting db_manager_enabled must be set to true in configuration.php to access this DB manager');
- }
- if (!api_is_global_platform_admin()) {
- die('Please connect as a global administrator to access this DB manager');
- }
- function
- connection(){global$e;return$e;}function
- adminer(){global$b;return$b;}function
- idf_unescape($Jc){$fd=substr($Jc,-1);return
- str_replace($fd.$fd,$fd,substr($Jc,1,-1));}function
- escape_string($X){return
- substr(q($X),1,-1);}function
- remove_slashes($Me,$nc=false){if(get_magic_quotes_gpc()){while(list($y,$X)=each($Me)){foreach($X
- as$Zc=>$W){unset($Me[$y][$Zc]);if(is_array($W)){$Me[$y][stripslashes($Zc)]=$W;$Me[]=&$Me[$y][stripslashes($Zc)];}else$Me[$y][stripslashes($Zc)]=($nc?$W:stripslashes($W));}}}}function
- bracket_escape($Jc,$_a=false){static$lg=array(':'=>':1',']'=>':2','['=>':3');return
- strtr($Jc,($_a?array_flip($lg):$lg));}function
- h($Ff){return
- htmlspecialchars(str_replace("\0","",$Ff),ENT_QUOTES);}function
- nbsp($Ff){return(trim($Ff)!=""?h($Ff):" ");}function
- nl_br($Ff){return
- str_replace("\n","<br>",$Ff);}function
- checkbox($E,$Y,$Ma,$dd="",$Yd="",$Qa=""){$K="<input type='checkbox' name='$E' value='".h($Y)."'".($Ma?" checked":"").($Yd?' onclick="'.h($Yd).'"':'').">";return($dd!=""||$Qa?"<label".($Qa?" class='$Qa'":"").">$K".h($dd)."</label>":$K);}function
- optionlist($ce,$qf=null,$Dg=false){$K="";foreach($ce
- as$Zc=>$W){$de=array($Zc=>$W);if(is_array($W)){$K.='<optgroup label="'.h($Zc).'">';$de=$W;}foreach($de
- as$y=>$X)$K.='<option'.($Dg||is_string($y)?' value="'.h($y).'"':'').(($Dg||is_string($y)?(string)$y:$X)===$qf?' selected':'').'>'.h($X);if(is_array($W))$K.='</optgroup>';}return$K;}function
- html_select($E,$ce,$Y="",$Xd=true){if($Xd)return"<select name='".h($E)."'".(is_string($Xd)?' onchange="'.h($Xd).'"':"").">".optionlist($ce,$Y)."</select>";$K="";foreach($ce
- as$y=>$X)$K.="<label><input type='radio' name='".h($E)."' value='".h($y)."'".($y==$Y?" checked":"").">".h($X)."</label>";return$K;}function
- select_input($wa,$ce,$Y="",$_e=""){return($ce?"<select$wa><option value=''>$_e".optionlist($ce,$Y,true)."</select>":"<input$wa size='10' value='".h($Y)."' placeholder='$_e'>");}function
- confirm(){return" onclick=\"return confirm('".'Are you sure?'."');\"";}function
- print_fieldset($t,$kd,$Lg=false,$Yd=""){echo"<fieldset><legend><a href='#fieldset-$t' onclick=\"".h($Yd)."return !toggle('fieldset-$t');\">$kd</a></legend><div id='fieldset-$t'".($Lg?"":" class='hidden'").">\n";}function
- bold($Ga,$Qa=""){return($Ga?" class='active $Qa'":($Qa?" class='$Qa'":""));}function
- odd($K=' class="odd"'){static$s=0;if(!$K)$s=-1;return($s++%2?$K:'');}function
- js_escape($Ff){return
- addcslashes($Ff,"\r\n'\\/");}function
- json_row($y,$X=null){static$oc=true;if($oc)echo"{";if($y!=""){echo($oc?"":",")."\n\t\"".addcslashes($y,"\r\n\"\\/").'": '.($X!==null?'"'.addcslashes($X,"\r\n\"\\/").'"':'undefined');$oc=false;}else{echo"\n}\n";$oc=true;}}function
- ini_bool($Nc){$X=ini_get($Nc);return(preg_match('~^(on|true|yes)$~i',$X)||(int)$X);}function
- sid(){static$K;if($K===null)$K=(SID&&!($_COOKIE&&ini_bool("session.use_cookies")));return$K;}function
- set_password($Ig,$O,$V,$G){$_SESSION["pwds"][$Ig][$O][$V]=($_COOKIE["adminer_key"]&&is_string($G)?array(encrypt_string($G,$_COOKIE["adminer_key"])):$G);}function
- get_password(){$K=get_session("pwds");if(is_array($K))$K=($_COOKIE["adminer_key"]?decrypt_string($K[0],$_COOKIE["adminer_key"]):false);return$K;}function
- q($Ff){global$i;return$i->quote($Ff);}function
- get_vals($I,$c=0){global$e;$K=array();$J=$e->query($I);if(is_object($J)){while($L=$J->fetch_row())$K[]=$L[$c];}return$K;}function
- get_key_vals($I,$f=null,$bg=0){global$e;if(!is_object($f))$f=$e;$K=array();$f->timeout=$bg;$J=$f->query($I);$f->timeout=0;if(is_object($J)){while($L=$J->fetch_row())$K[$L[0]]=$L[1];}return$K;}function
- get_rows($I,$f=null,$j="<p class='error'>"){global$e;$db=(is_object($f)?$f:$e);$K=array();$J=$db->query($I);if(is_object($J)){while($L=$J->fetch_assoc())$K[]=$L;}elseif(!$J&&!is_object($f)&&$j&&defined("PAGE_HEADER"))echo$j.error()."\n";return$K;}function
- unique_array($L,$v){foreach($v
- as$u){if(preg_match("~PRIMARY|UNIQUE~",$u["type"])){$K=array();foreach($u["columns"]as$y){if(!isset($L[$y]))continue
- 2;$K[$y]=$L[$y];}return$K;}}}function
- where($Z,$l=array()){global$x;$K=array();$wc='(^[\w\(]+('.str_replace("_",".*",preg_quote(idf_escape("_"))).')?\)+$)';foreach((array)$Z["where"]as$y=>$X){$y=bracket_escape($y,1);$c=(preg_match($wc,$y)?$y:idf_escape($y));$K[]=$c.(($x=="sql"&&preg_match('~^[0-9]*\\.[0-9]*$~',$X))||$x=="mssql"?" LIKE ".q(addcslashes($X,"%_\\")):" = ".unconvert_field((isset($l[$y])?$l[$y]:null),q($X)));if($x=="sql"&&preg_match('~char|text~',(isset($l[$y])?$l[$y]["type"]:null))&&preg_match("~[^ -@]~",$X))$K[]="$c = ".q($X)." COLLATE utf8_bin";}foreach((array)(isset($Z["null"])?$Z["null"]:null)as$y)$K[]=(preg_match($wc,$y)?$y:idf_escape($y))." IS NULL";return
- implode(" AND ",$K);}function
- where_check($X,$l=array()){parse_str($X,$La);remove_slashes(array(&$La));return
- where($La,$l);}function
- where_link($s,$c,$Y,$Zd="="){return"&where%5B$s%5D%5Bcol%5D=".urlencode($c)."&where%5B$s%5D%5Bop%5D=".urlencode(($Y!==null?$Zd:"IS NULL"))."&where%5B$s%5D%5Bval%5D=".urlencode($Y);}function
- convert_fields($d,$l,$N=array()){$K="";foreach($d
- as$y=>$X){if($N&&!in_array(idf_escape($y),$N))continue;$ua=convert_field($l[$y]);if($ua)$K.=", $ua AS ".idf_escape($y);}return$K;}function
- cookie($E,$Y,$nd=2592000){global$ba;$qe=array($E,(preg_match("~\n~",$Y)?"":$Y),($nd?time()+$nd:0),preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$qe[]=true;return
- call_user_func_array('setcookie',$qe);}function
- restart_session(){if(!ini_bool("session.use_cookies"))session_start();}function
- stop_session(){if(!ini_bool("session.use_cookies"))session_write_close();}function&get_session($y){ if(isset($_GET["username"])) return $_SESSION[$y][DRIVER][SERVER][$_GET["username"]];}function
- set_session($y,$X){$_SESSION[$y][DRIVER][SERVER][$_GET["username"]]=$X;}function
- auth_url($Ig,$O,$V,$h=null){global$Db;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($Db))."|username|".($h!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($Ig!="server"||$O!=""?urlencode($Ig)."=".urlencode($O)."&":"")."username=".urlencode($V).($h!=""?"&db=".urlencode($h):"").($B[2]?"&$B[2]":"");}function
- is_ajax(){return((isset($_SERVER["HTTP_X_REQUESTED_WITH"])?$_SERVER["HTTP_X_REQUESTED_WITH"]:null)=="XMLHttpRequest");}function
- redirect($A,$C=null){if($C!==null){restart_session();$_SESSION["messages"][preg_replace('~^[^?]*~','',($A!==null?$A:$_SERVER["REQUEST_URI"]))][]=$C;}if($A!==null){if($A=="")$A=".";header("Location: $A");exit;}}function
- query_redirect($I,$A,$C,$Ue=true,$bc=true,$hc=false,$ag=""){global$e,$j,$b;if($bc){$Bf=microtime(true);$hc=!$e->query($I);$ag=format_time($Bf);}$Af="";if($I)$Af=$b->messageQuery($I,$ag);if($hc){$j=error().$Af;return
- false;}if($Ue)redirect($A,$C.$Af);return
- true;}function
- queries($I){global$e;static$Pe=array();static$Bf;if(!$Bf)$Bf=microtime(true);if($I===null)return
- array(implode("\n",$Pe),format_time($Bf));$Pe[]=(preg_match('~;$~',$I)?"DELIMITER ;;\n$I;\nDELIMITER ":$I).";";return$e->query($I);}function
- apply_queries($I,$S,$Xb='table'){foreach($S
- as$Q){if(!queries("$I ".$Xb($Q)))return
- false;}return
- true;}function
- queries_redirect($A,$C,$Ue){list($Pe,$ag)=queries(null);return
- query_redirect($Pe,$A,$C,$Ue,false,!$Ue,$ag);}function
- format_time($Bf){return
- sprintf('%.3f s',max(0,microtime(true)-$Bf));}function
- remove_from_uri($pe=""){return
- substr(preg_replace("~(?<=[?&])($pe".(SID?"":"|".session_name()).")=[^&]*&~",'',"$_SERVER[REQUEST_URI]&"),0,-1);}function
- pagination($F,$nb){return" ".($F==$nb?$F+1:'<a href="'.h(remove_from_uri("page").($F?"&page=$F".($_GET["next"]?"&next=".urlencode($_GET["next"]):""):"")).'">'.($F+1)."</a>");}function
- get_file($y,$ub=false){$lc=$_FILES[$y];if(!$lc)return
- null;foreach($lc
- as$y=>$X)$lc[$y]=(array)$X;$K='';foreach($lc["error"]as$y=>$j){if($j)return$j;$E=$lc["name"][$y];$ig=$lc["tmp_name"][$y];$eb=file_get_contents($ub&&preg_match('~\\.gz$~',$E)?"compress.zlib://$ig":$ig);if($ub){$Bf=substr($eb,0,3);if(function_exists("iconv")&&preg_match("~^\xFE\xFF|^\xFF\xFE~",$Bf,$af))$eb=iconv("utf-16","utf-8",$eb);elseif($Bf=="\xEF\xBB\xBF")$eb=substr($eb,3);$K.=$eb."\n\n";}else$K.=$eb;}return$K;}function
- upload_error($j){$xd=($j==UPLOAD_ERR_INI_SIZE?ini_get("upload_max_filesize"):0);return($j?'Unable to upload a file.'.($xd?" ".sprintf('Maximum allowed file size is %sB.',$xd):""):'File does not exist.');}function
- repeat_pattern($ye,$ld){return
- str_repeat("$ye{0,65535}",$ld/65535)."$ye{0,".($ld%65535)."}";}function
- is_utf8($X){return(preg_match('~~u',$X)&&!preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~',$X));}function
- shorten_utf8($Ff,$ld=80,$Jf=""){if(!preg_match("(^(".repeat_pattern("[\t\r\n -\x{FFFF}]",$ld).")($)?)u",$Ff,$B))preg_match("(^(".repeat_pattern("[\t\r\n -~]",$ld).")($)?)",$Ff,$B);return
- h($B[1]).$Jf.(isset($B[2])?"":"<i>...</i>");}function
- format_number($X){return
- strtr(number_format($X,0,".",','),preg_split('~~u','0123456789',-1,PREG_SPLIT_NO_EMPTY));}function
- friendly_url($X){return
- preg_replace('~[^a-z0-9_]~i','-',$X);}function
- hidden_fields($Me,$Kc=array()){while(list($y,$X)=each($Me)){if(!in_array($y,$Kc)){if(is_array($X)){foreach($X
- as$Zc=>$W)$Me[$y."[$Zc]"]=$W;}else
- echo'<input type="hidden" name="'.h($y).'" value="'.h($X).'">';}}}function
- 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
- table_status1($Q,$ic=false){$K=table_status($Q,$ic);return($K?$K:array("Name"=>$Q));}function
- column_foreign_keys($Q){global$b;$K=array();foreach($b->foreignKeys($Q)as$m){foreach($m["source"]as$X)$K[$X][]=$m;}return$K;}function
- enum_input($U,$wa,$k,$Y,$Rb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$sd);$K=($Rb!==null?"<label><input type='$U'$wa value='$Rb'".((is_array($Y)?in_array($Rb,$Y):$Y===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($sd[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ma=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$K.=" <label><input type='$U'$wa value='".($s+1)."'".($Ma?' checked':'').'>'.h($b->editVal($X,$k)).'</label>';}return$K;}function
- input($k,$Y,$p){global$e,$sg,$b,$x;$E=h(bracket_escape($k["field"]));echo"<td class='function'>";if(is_array($Y)&&!$p){$ta=array($Y);if(version_compare(PHP_VERSION,5.4)>=0)$ta[]=JSON_PRETTY_PRINT;$Y=call_user_func_array('json_encode',$ta);$p="json";}$cf=($x=="mssql"&&$k["auto_increment"]);if($cf&&!$_POST["save"])$p=null;$xc=(isset($_GET["select"])||$cf?array("orig"=>'original'):array())+$b->editFunctions($k);$wa=" name='fields[$E]'";if($k["type"]=="enum")echo
- nbsp($xc[""])."<td>".$b->editInput($_GET["edit"],$k,$wa,$Y);else{$oc=0;foreach($xc
- as$y=>$X){if($y===""||!$X)break;$oc++;}$Xd=($oc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($k["field"])))."]']; if ($oc > f.selectedIndex) f.selectedIndex = $oc;\" onkeyup='keyupChange.call(this);'":"");$wa.=$Xd;$Cc=(in_array($p,$xc)||isset($xc[$p]));echo(count($xc)>1?"<select name='function[$E]' onchange='functionChange(this);'".on_help("getTarget(event).value.replace(/^SQL\$/, '')",1).">".optionlist($xc,$p===null||$Cc?$p:"")."</select>":nbsp(reset($xc))).'<td>';$Pc=$b->editInput($_GET["edit"],$k,$wa,$Y);if($Pc!="")echo$Pc;elseif($k["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$sd);foreach($sd[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ma=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$E][$s]' value='".(1<<$s)."'".($Ma?' checked':'')."$Xd>".h($b->editVal($X,$k)).'</label>';}}elseif(preg_match('~blob|bytea|raw|file~',$k["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$E'$Xd>";elseif(($Yf=preg_match('~text|lob~',$k["type"]))||preg_match("~\n~",$Y)){if($Yf&&$x!="sqlite")$wa.=" cols='50' rows='12'";else{$M=min(12,substr_count($Y,"\n")+1);$wa.=" cols='30' rows='$M'".($M==1?" style='height: 1.2em;'":"");}echo"<textarea$wa>".h($Y).'</textarea>';}elseif($p=="json")echo"<textarea$wa cols='50' rows='12' class='jush-js'>".h($Y).'</textarea>';else{$zd=(!preg_match('~int~',$k["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$k["length"],$B)?((preg_match("~binary~",$k["type"])?2:1)*$B[1]+($B[3]?1:0)+($B[2]&&!$k["unsigned"]?1:0)):($sg[$k["type"]]?$sg[$k["type"]]+($k["unsigned"]?0:1):0));if($x=='sql'&&$e->server_info>=5.6&&preg_match('~time~',$k["type"]))$zd+=7;echo"<input".((!$Cc||$p==="")&&preg_match('~(?<!o)int~',$k["type"])?" type='number'":"")." value='".h($Y)."'".($zd?" maxlength='$zd'":"").(preg_match('~char|binary~',$k["type"])&&$zd>20?" size='40'":"")."$wa>";}}}function
- process_input($k){global$b;$Jc=bracket_escape($k["field"]);$p=$_POST["function"][$Jc];$Y=$_POST["fields"][$Jc];if($k["type"]=="enum"){if($Y==-1)return
- false;if($Y=="")return"NULL";return+$Y;}if($k["auto_increment"]&&$Y=="")return
- null;if($p=="orig")return($k["on_update"]=="CURRENT_TIMESTAMP"?idf_escape($k["field"]):false);if($p=="NULL")$Y=null;if($k["type"]=="set")return
- array_sum((array)$Y);if($p=="json"){$p="";$Y=json_decode($Y,true);if(!is_array($Y))return
- false;return$Y;}if(preg_match('~blob|bytea|raw|file~',$k["type"])&&ini_bool("file_uploads")){$lc=get_file("fields-$Jc");if(!is_string($lc))return
- false;return
- q($lc);}return$b->processInput($k,$Y,$p);}function
- fields_from_edit(){global$i;$K=array();foreach((array)$_POST["field_keys"]as$y=>$X){if($X!=""){$X=bracket_escape($X);$_POST["function"][$X]=$_POST["field_funs"][$y];$_POST["fields"][$X]=$_POST["field_vals"][$y];}}foreach((array)$_POST["fields"]as$y=>$X){$E=bracket_escape($y,1);$K[$E]=array("field"=>$E,"privileges"=>array("insert"=>1,"update"=>1),"null"=>1,"auto_increment"=>($y==$i->primary),);}return$K;}function
- search_tables(){global$b,$e;$_GET["where"][0]["op"]="LIKE %%";$_GET["where"][0]["val"]=$_POST["query"];$tc=false;foreach(table_status('',true)as$Q=>$R){$E=$b->tableName($R);if(isset($R["Engine"])&&$E!=""&&(!$_POST["tables"]||in_array($Q,$_POST["tables"]))){$J=$e->query("SELECT".limit("1 FROM ".table($Q)," WHERE ".implode(" AND ",$b->selectSearchProcess(fields($Q),array())),1));if(!$J||$J->fetch_row()){if(!$tc){echo"<ul>\n";$tc=true;}echo"<li>".($J?"<a href='".h(ME."select=".urlencode($Q)."&where[0][op]=".urlencode($_GET["where"][0]["op"])."&where[0][val]=".urlencode($_GET["where"][0]["val"]))."'>$E</a>\n":"$E: <span class='error'>".error()."</span>\n");}}}echo($tc?"</ul>":"<p class='message'>".'No tables.')."\n";}function
- dump_headers($Ic,$Fd=false){global$b;$K=$b->dumpHeaders($Ic,$Fd);$ne=$_POST["output"];if($ne!="text")header("Content-Disposition: attachment; filename=".$b->dumpFilename($Ic).".$K".($ne!="file"&&!preg_match('~[^0-9a-z]~',$ne)?".$ne":""));session_write_close();ob_flush();flush();return$K;}function
- dump_csv($L){foreach($L
- as$y=>$X){if(preg_match("~[\"\n,;\t]~",$X)||$X==="")$L[$y]='"'.str_replace('"','""',$X).'"';}echo
- implode(($_POST["format"]=="csv"?",":($_POST["format"]=="tsv"?"\t":";")),$L)."\r\n";}function
- apply_sql_function($p,$c){return($p?($p=="unixepoch"?"DATETIME($c, '$p')":($p=="count distinct"?"COUNT(DISTINCT ":strtoupper("$p("))."$c)"):$c);}function
- get_temp_dir(){$K=ini_get("upload_tmp_dir");if(!$K){if(function_exists('sys_get_temp_dir'))$K=sys_get_temp_dir();else{$mc=@tempnam("","");if(!$mc)return
- false;$K=dirname($mc);unlink($mc);}}return$K;}function
- password_file($jb){$mc=get_temp_dir()."/adminer.key";$K=@file_get_contents($mc);if($K||!$jb)return$K;$o=@fopen($mc,"w");if($o){$K=rand_string();fwrite($o,$K);fclose($o);}return$K;}function
- rand_string(){return
- md5(uniqid(mt_rand(),true));}function
- select_value($X,$_,$k,$Zf){global$b,$ba;if(is_array($X)){$K="";foreach($X
- as$Zc=>$W)$K.="<tr>".($X!=array_values($X)?"<th>".h($Zc):"")."<td>".select_value($W,$_,$k,$Zf);return"<table cellspacing='0'>$K</table>";}if(!$_)$_=$b->selectLink($X,$k);if($_===null){if(is_mail($X))$_="mailto:$X";if($Oe=is_url($X))$_=(($Oe=="http"&&$ba)||preg_match('~WebKit~i',$_SERVER["HTTP_USER_AGENT"])?$X:"$Oe://www.adminer.org/redirect/?url=".urlencode($X));}$K=$b->editVal($X,$k);if($K!==null){if($K==="")$K=" ";elseif($Zf!=""&&is_shortable($k)&&is_utf8($K))$K=shorten_utf8($K,max(0,+$Zf));else$K=h($K);}return$b->selectVal($K,$_,$k,$X);}function
- is_mail($Ob){$va='[-a-z0-9!#$%&\'*+/=?^_`{|}~]';$Cb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';$ye="$va+(\\.$va+)*@($Cb?\\.)+$Cb";return
- is_string($Ob)&&preg_match("(^$ye(,\\s*$ye)*\$)i",$Ob);}function
- is_url($Ff){$Cb='[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])';return(preg_match("~^(https?)://($Cb?\\.)+$Cb(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i",$Ff,$B)?strtolower($B[1]):"");}function
- is_shortable($k){return
- preg_match('~char|text|lob|geometry|point|linestring|polygon|string~',$k["type"]);}function
- count_rows($Q,$Z,$Vc,$r){global$x;$I=" FROM ".table($Q).($Z?" WHERE ".implode(" AND ",$Z):"");return($Vc&&($x=="sql"||count($r)==1)?"SELECT COUNT(DISTINCT ".implode(", ",$r).")$I":"SELECT COUNT(*)".($Vc?" FROM (SELECT 1$I$zc) x":$I));}function
- slow_query($I){global$b,$T;$h=$b->database();$bg=$b->queryTimeout();if(support("kill")&&is_object($f=connect())&&($h==""||$f->select_db($h))){$bd=$f->result("SELECT CONNECTION_ID()");echo'<script type="text/javascript">
- var timeout = setTimeout(function () {
- ajax(\'',js_escape(ME),'script=kill\', function () {
- }, \'token=',$T,'&kill=',$bd,'\');
- }, ',1000*$bg,');
- </script>
- ';}else$f=null;ob_flush();flush();$K=@get_key_vals($I,$f,$bg);if($f){echo"<script type='text/javascript'>clearTimeout(timeout);</script>\n";ob_flush();flush();}return
- array_keys($K);}function
- get_token(){$Se=rand(1,1e6);return($Se^$_SESSION["token"]).":$Se";}function
- verify_token(){list($T,$Se)=explode(":",$_POST["token"]);return($Se^$_SESSION["token"])==$T;}function
- lzw_decompress($Da){$_b=256;$Ea=8;$Sa=array();$df=0;$ef=0;for($s=0;$s<strlen($Da);$s++){$df=($df<<8)+ord($Da[$s]);$ef+=8;if($ef>=$Ea){$ef-=$Ea;$Sa[]=$df>>$ef;$df&=(1<<$ef)-1;$_b++;if($_b>>$Ea)$Ea++;}}$zb=range("\0","\xFF");$K="";foreach($Sa
- as$s=>$Ra){$Nb=$zb[$Ra];if(!isset($Nb))$Nb=$Pg.$Pg[0];$K.=$Nb;if($s)$zb[]=$Pg.$Nb[0];$Pg=$Nb;}return$K;}function
- on_help($Ya,$xf=0){return" onmouseover='helpMouseover(this, event, ".h($Ya).", $xf);' onmouseout='helpMouseout(this, event);'";}function
- edit_form($a,$l,$L,$_g){global$b,$x,$T,$j;$Of=$b->tableName(table_status1($a,true));page_header(($_g?'Edit':'Insert'),$j,array("select"=>array($a,$Of)),$Of);if($L===false)echo"<p class='error'>".'No rows.'."\n";echo'<div id="message"></div>
- <form action="" method="post" enctype="multipart/form-data" id="form">
- ';if(!$l)echo"<p class='error'>".'You have no privileges to update this table.'."\n";else{echo"<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";foreach($l
- as$E=>$k){echo"<tr><th>".$b->fieldName($k);$vb=(isset($_GET["set"])?$_GET["set"][bracket_escape($E)]:null);if($vb===null){$vb=$k["default"];if($k["type"]=="bit"&&preg_match("~^b'([01]*)'\$~",$vb,$af))$vb=$af[1];}$Y=($L!==null?(!empty($L[$E])&&$x=="sql"&&preg_match("~enum|set~",$k["type"])?(is_array($L[$E])?array_sum($L[$E]):+$L[$E]):$L[$E]):(!$_g&&$k["auto_increment"]?"":(isset($_GET["select"])?false:$vb)));if(empty($_POST["save"])&&is_string($Y))$Y=$b->editVal($Y,$k);$p=(!empty($_POST["save"])?(string)$_POST["function"][$E]:($_g&&$k["on_update"]=="CURRENT_TIMESTAMP"?"now":($Y===false?null:($Y!==null?'':'NULL'))));if(preg_match("~time~",$k["type"])&&$Y=="CURRENT_TIMESTAMP"){$Y="";$p="now";}input($k,$Y,$p);echo"\n";}if(!support("table"))echo"<tr>"."<th><input name='field_keys[]' onkeyup='keyupChange.call(this);' onchange='fieldChange(this);' value=''>"."<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($l){echo"<input type='submit' value='".'Save'."'>\n";if(!isset($_GET["select"]))echo"<input type='submit' name='insert' value='".($_g?'Save and continue edit'."' onclick='return !ajaxForm(this.form, \"".'Saving'.'...", this)':'Save and insert next')."' title='Ctrl+Shift+Enter'>\n";}echo($_g?"<input type='submit' name='delete' value='".'Delete'."'".confirm().">\n":($_POST||!$l?"":"<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n"));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"]),'">
- <input type="hidden" name="save" value="1">
- <input type="hidden" name="token" value="',$T,'">
- </form>
- ';}global$b,$e,$Db,$Kb,$Ub,$j,$xc,$_c,$ba,$Oc,$x,$ca,$ed,$Wd,$ze,$Gf,$Dc,$T,$ng,$sg,$zg,$ga;if(!$_SERVER["REQUEST_URI"])$_SERVER["REQUEST_URI"]=$_SERVER["ORIG_PATH_INFO"];if(!strpos($_SERVER["REQUEST_URI"],'?')&&$_SERVER["QUERY_STRING"]!="")$_SERVER["REQUEST_URI"].="?$_SERVER[QUERY_STRING]";$ba=(isset($_SERVER["HTTPS"])?true:false)&&strcasecmp($_SERVER["HTTPS"],"off");@ini_set("session.use_trans_sid",false);session_cache_limiter("");if(!defined("SID")){session_name("adminer_sid");$qe=array(0,preg_replace('~\\?.*~','',$_SERVER["REQUEST_URI"]),"",$ba);if(version_compare(PHP_VERSION,'5.2.0')>=0)$qe[]=true;call_user_func_array('session_set_cookie_params',$qe);session_start();}remove_slashes(array(&$_GET,&$_POST,&$_COOKIE),$nc);if(get_magic_quotes_runtime())set_magic_quotes_runtime(false);@set_time_limit(0);@ini_set("zend.ze1_compatibility_mode",false);@ini_set("precision",20);function
- get_langx(){return'en';}function
- lang($mg,$Nd=null){if(is_array($mg)){$Be=($Nd==1?0:1);$mg=$mg[$Be];}$mg=str_replace("%d","%s",$mg);$Nd=format_number($Nd);return
- sprintf($mg,$Nd);}if(extension_loaded('pdo')){class
- Min_PDO
- extends
- PDO{var$_result,$server_info,$affected_rows,$errno,$error;function
- __construct(){global$b;$Be=array_search("SQL",$b->operators);if($Be!==false)unset($b->operators[$Be]);}function
- dsn($Hb,$V,$G){try{parent::__construct($Hb,$V,$G);}catch(Exception$Zb){auth_error($Zb->getMessage());}$this->setAttribute(13,array('Min_PDOStatement'));$this->server_info=$this->getAttribute(4);}function
- query($I,$tg=false){$J=parent::query($I);$this->error="";if(!$J){list(,$this->errno,$this->error)=$this->errorInfo();return
- false;}$this->store_result($J);return$J;}function
- multi_query($I){return$this->_result=$this->query($I);}function
- store_result($J=null){if(!$J){$J=$this->_result;if(!$J)return
- false;}if($J->columnCount()){$J->num_rows=$J->rowCount();return$J;}$this->affected_rows=$J->rowCount();return
- true;}function
- next_result(){if(!$this->_result)return
- false;$this->_result->_offset=0;return@$this->_result->nextRowset();}function
- result($I,$k=0){$J=$this->query($I);if(!$J)return
- false;$L=$J->fetch();return$L[$k];}}class
- Min_PDOStatement
- extends
- PDOStatement{var$_offset=0,$num_rows;function
- fetch_assoc(){return$this->fetch(2);}function
- fetch_row(){return$this->fetch(3);}function
- fetch_field(){$L=(object)$this->getColumnMeta($this->_offset++);$L->orgtable=$L->table;$L->orgname=$L->name;$L->charsetnr=(in_array("blob",(array)$L->flags)?63:0);return$L;}}}$Db=array();class
- Min_SQL{var$_conn;function
- Min_SQL($e){$this->_conn=$e;}function
- quote($Y){return($Y===null?"NULL":$this->_conn->quote($Y));}function
- select($Q,$N,$Z,$r,$ee=array(),$z=1,$F=0,$Ie=false){global$b,$x;$Vc=(count($r)<count($N));$I=$b->selectQueryBuild($N,$Z,$r,$ee,$z,$F);if(!$I)$I="SELECT".limit(((isset($_GET["page"])?$_GET["page"]:null)!="last"&&+$z&&$r&&$Vc&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").implode(", ",$N)."\nFROM ".table($Q),($Z?"\nWHERE ".implode(" AND ",$Z):"").($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):""),($z!=""?+$z:null),($F?$z*$F:0),"\n");$Bf=microtime(true);$K=$this->_conn->query($I);if($Ie)echo$b->selectQuery($I,format_time($Bf));return$K;}function
- delete($Q,$Qe,$z=0){$I="FROM ".table($Q);return
- queries("DELETE".($z?limit1($I,$Qe):" $I$Qe"));}function
- update($Q,$P,$Qe,$z=0,$sf="\n"){$Gg=array();foreach($P
- as$y=>$X)$Gg[]="$y = $X";$I=table($Q)." SET$sf".implode(",$sf",$Gg);return
- queries("UPDATE".($z?limit1($I,$Qe):" $I$Qe"));}function
- insert($Q,$P){return
- queries("INSERT INTO ".table($Q).($P?" (".implode(", ",array_keys($P)).")\nVALUES (".implode(", ",$P).")":" DEFAULT VALUES"));}function
- insertUpdate($Q,$M,$He){return
- false;}function
- begin(){return
- queries("BEGIN");}function
- commit(){return
- queries("COMMIT");}function
- rollback(){return
- queries("ROLLBACK");}}$Db=array("server"=>"MySQL")+$Db;if(!defined("DRIVER")){$Ee=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
- Min_DB
- extends
- MySQLi{var$extension="MySQLi";function
- Min_DB(){parent::init();}function
- connect($O=null,$V=null,$G=null,$ignore1=null,$ignore2=null,$ignore3=null){mysqli_report(MYSQLI_REPORT_OFF);@list($Gc,$Ae)=explode(":",$O,2);$K=@$this->real_connect(($O!=""?$Gc:ini_get("mysqli.default_host")),($O.$V!=""?$V:ini_get("mysqli.default_user")),($O.$V.$G!=""?$G:ini_get("mysqli.default_pw")),null,(is_numeric($Ae)?$Ae:ini_get("mysqli.default_port")),(!is_numeric($Ae)?$Ae:null));if($K){if(method_exists($this,'set_charset'))$this->set_charset("utf8");else$this->query("SET NAMES utf8");}return$K;}function
- result($I,$k=0){$J=$this->query($I);if(!$J)return
- false;$L=$J->fetch_array();return$L[$k];}function
- quote($Ff){return"'".$this->escape_string($Ff)."'";}}}elseif(extension_loaded("mysql")&&!(ini_get("sql.safe_mode")&&extension_loaded("pdo_mysql"))){class
- Min_DB{var$extension="MySQL",$server_info,$affected_rows,$errno,$error,$_link,$_result;function
- 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);if(function_exists('mysql_set_charset'))mysql_set_charset("utf8",$this->_link);else$this->query("SET NAMES utf8");}else$this->error=mysql_error();return(bool)$this->_link;}function
- quote($Ff){return"'".mysql_real_escape_string($Ff,$this->_link)."'";}function
- select_db($qb){return
- mysql_select_db($qb,$this->_link);}function
- query($I,$tg=false){$J=@($tg?mysql_unbuffered_query($I,$this->_link):mysql_query($I,$this->_link));$this->error="";if(!$J){$this->errno=mysql_errno($this->_link);$this->error=mysql_error($this->_link);return
- false;}if($J===true){$this->affected_rows=mysql_affected_rows($this->_link);$this->info=mysql_info($this->_link);return
- true;}return
- new
- Min_Result($J);}function
- multi_query($I){return$this->_result=$this->query($I);}function
- store_result(){return$this->_result;}function
- next_result(){return
- false;}function
- result($I,$k=0){$J=$this->query($I);if(!$J||!$J->num_rows)return
- false;return
- mysql_result($J->_result,0,$k);}}class
- Min_Result{var$num_rows,$_result,$_offset=0;function
- Min_Result($J){$this->_result=$J;$this->num_rows=mysql_num_rows($J);}function
- fetch_assoc(){return
- mysql_fetch_assoc($this->_result);}function
- fetch_row(){return
- mysql_fetch_row($this->_result);}function
- fetch_field(){$K=mysql_fetch_field($this->_result,$this->_offset++);$K->orgtable=$K->table;$K->orgname=$K->name;$K->charsetnr=($K->blob?63:0);return$K;}function
- __destruct(){mysql_free_result($this->_result);}}}elseif(extension_loaded("pdo_mysql")){class
- Min_DB
- extends
- Min_PDO{var$extension="PDO_MySQL";function
- connect($O,$V,$G){$this->dsn("mysql:charset=utf8;host=".str_replace(":",";unix_socket=",preg_replace('~:(\\d)~',';port=\\1',$O)),$V,$G);$this->query("SET NAMES utf8");return
- true;}function
- select_db($qb){return$this->query("USE ".idf_escape($qb));}function
- query($I,$tg=false){$this->setAttribute(1000,!$tg);return
- parent::query($I,$tg);}}}class
- Min_Driver
- extends
- Min_SQL{function
- insert($Q,$P){return($P?parent::insert($Q,$P):queries("INSERT INTO ".table($Q)." ()\nVALUES ()"));}function
- insertUpdate($Q,$M,$He){$d=array_keys(reset($M));$Fe="INSERT INTO ".table($Q)." (".implode(", ",$d).") VALUES\n";$Gg=array();foreach($d
- as$y)$Gg[$y]="$y = VALUES($y)";$Jf="\nON DUPLICATE KEY UPDATE ".implode(", ",$Gg);$Gg=array();$ld=0;foreach($M
- as$P){$Y="(".implode(", ",$P).")";if($Gg&&(strlen($Fe)+$ld+strlen($Y)+strlen($Jf)>1e6)){if(!queries($Fe.implode(",\n",$Gg).$Jf))return
- false;$Gg=array();$ld=0;}$Gg[]=$Y;$ld+=strlen($Y)+2;}return
- queries($Fe.implode(",\n",$Gg).$Jf);}}function
- idf_escape($Jc){return"`".str_replace("`","``",$Jc)."`";}function
- table($Jc){return
- idf_escape($Jc);}function
- connect(){global$b;$e=new
- Min_DB;$mb=$b->credentials();if($e->connect($mb[0],$mb[1],$mb[2])){$e->query("SET sql_quote_show_create = 1, autocommit = 1");return$e;}$K=$e->error;if(function_exists('iconv')&&!is_utf8($K)&&strlen($lf=iconv("windows-1250","utf-8",$K))>strlen($K))$K=$lf;return$K;}function
- get_databases($pc){global$e;$K=get_session("dbs");if($K===null){$I=($e->server_info>=5?"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA":"SHOW DATABASES");$K=($pc?slow_query($I):get_vals($I));restart_session();set_session("dbs",$K);stop_session();}return$K;}function
- limit($I,$Z,$z,$Pd=0,$sf=" "){return" $I$Z".($z!==null?$sf."LIMIT $z".($Pd?" OFFSET $Pd":""):"");}function
- limit1($I,$Z){return
- limit($I,$Z,1);}function
- db_collation($h,$Wa){global$e;$K=null;$jb=$e->result("SHOW CREATE DATABASE ".idf_escape($h),1);if(preg_match('~ COLLATE ([^ ]+)~',$jb,$B))$K=$B[1];elseif(preg_match('~ CHARACTER SET ([^ ]+)~',$jb,$B))$K=$Wa[$B[1]][-1];return$K;}function
- engines(){$K=array();foreach(get_rows("SHOW ENGINES")as$L){if(preg_match("~YES|DEFAULT~",$L["Support"]))$K[]=$L["Engine"];}return$K;}function
- logged_user(){global$e;return$e->result("SELECT USER()");}function
- tables_list(){global$e;return
- get_key_vals($e->server_info>=5?"SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME":"SHOW TABLES");}function
- count_tables($g){$K=array();foreach($g
- as$h)$K[$h]=count(get_vals("SHOW TABLES IN ".idf_escape($h)));return$K;}function
- table_status($E="",$ic=false){global$e;$K=array();foreach(get_rows($ic&&$e->server_info>=5?"SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ".($E!=""?"AND TABLE_NAME = ".q($E):"ORDER BY Name"):"SHOW TABLE STATUS".($E!=""?" LIKE ".q(addcslashes($E,"%_\\")):""))as$L){if($L["Engine"]=="InnoDB")$L["Comment"]=preg_replace('~(?:(.+); )?InnoDB free: .*~','\\1',$L["Comment"]);if(!isset($L["Engine"]))$L["Comment"]="";if($E!="")return$L;$K[$L["Name"]]=$L;}return$K;}function
- is_view($R){return$R["Engine"]===null;}function
- fk_support($R){return
- preg_match('~InnoDB|IBMDB2I~i',$R["Engine"]);}function
- fields($Q){$K=array();foreach(get_rows("SHOW FULL COLUMNS FROM ".table($Q))as$L){preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~',$L["Type"],$B);$K[$L["Field"]]=array("field"=>$L["Field"],"full_type"=>$L["Type"],"type"=>isset($B[1])?$B[1]:null,"length"=>isset($B[2])?$B[2]:null,"unsigned"=>ltrim((isset($B[3])?$B[3]:'').(isset($B[4])?$B[4]:'')),"default"=>($L["Default"]!=""||preg_match("~char|set~",$B[1])?$L["Default"]:null),"null"=>($L["Null"]=="YES"),"auto_increment"=>($L["Extra"]=="auto_increment"),"on_update"=>(preg_match('~^on update (.+)~i',$L["Extra"],$B)?$B[1]:""),"collation"=>$L["Collation"],"privileges"=>array_flip(preg_split('~, *~',$L["Privileges"])),"comment"=>$L["Comment"],"primary"=>($L["Key"]=="PRI"),);}return$K;}function
- indexes($Q,$f=null){$K=array();foreach(get_rows("SHOW INDEX FROM ".table($Q),$f)as$L){$K[$L["Key_name"]]["type"]=($L["Key_name"]=="PRIMARY"?"PRIMARY":($L["Index_type"]=="FULLTEXT"?"FULLTEXT":($L["Non_unique"]?"INDEX":"UNIQUE")));$K[$L["Key_name"]]["columns"][]=$L["Column_name"];$K[$L["Key_name"]]["lengths"][]=$L["Sub_part"];$K[$L["Key_name"]]["descs"][]=null;}return$K;}function
- foreign_keys($Q){global$e,$Wd;static$ye='`(?:[^`]|``)+`';$K=array();$kb=$e->result("SHOW CREATE TABLE ".table($Q),1);if($kb){preg_match_all("~CONSTRAINT ($ye) FOREIGN KEY \\(((?:$ye,? ?)+)\\) REFERENCES ($ye)(?:\\.($ye))? \\(((?:$ye,? ?)+)\\)(?: ON DELETE ($Wd))?(?: ON UPDATE ($Wd))?~",$kb,$sd,PREG_SET_ORDER);foreach($sd
- as$B){preg_match_all("~$ye~",$B[2],$zf);preg_match_all("~$ye~",$B[5],$Uf);$K[idf_unescape($B[1])]=array("db"=>idf_unescape($B[4]!=""?$B[3]:$B[4]),"table"=>idf_unescape($B[4]!=""?$B[4]:$B[3]),"source"=>array_map('idf_unescape',$zf[0]),"target"=>array_map('idf_unescape',$Uf[0]),"on_delete"=>($B[6]?$B[6]:"RESTRICT"),"on_update"=>($B[7]?$B[7]:"RESTRICT"),);}}return$K;}function
- view($E){global$e;return
- array("select"=>preg_replace('~^(?:[^`]|`[^`]*`)*\\s+AS\\s+~isU','',$e->result("SHOW CREATE VIEW ".table($E),1)));}function
- collations(){$K=array();foreach(get_rows("SHOW COLLATION")as$L){if($L["Default"])$K[$L["Charset"]][-1]=$L["Collation"];else$K[$L["Charset"]][]=$L["Collation"];}ksort($K);foreach($K
- as$y=>$X)asort($K[$y]);return$K;}function
- information_schema($h){global$e;return($e->server_info>=5&&$h=="information_schema")||($e->server_info>=5.5&&$h=="performance_schema");}function
- error(){global$e;return
- h(preg_replace('~^You have an error.*syntax to use~U',"Syntax error",$e->error));}function
- error_line(){global$e;if(preg_match('~ at line ([0-9]+)$~',$e->error,$af))return$af[1]-1;}function
- create_database($h,$Va){set_session("dbs",null);return
- queries("CREATE DATABASE ".idf_escape($h).($Va?" COLLATE ".q($Va):""));}function
- drop_databases($g){restart_session();set_session("dbs",null);return
- apply_queries("DROP DATABASE",$g,'idf_escape');}function
- rename_database($E,$Va){if(create_database($E,$Va)){$bf=array();foreach(tables_list()as$Q=>$U)$bf[]=table($Q)." TO ".idf_escape($E).".".table($Q);if(!$bf||queries("RENAME TABLE ".implode(", ",$bf))){queries("DROP DATABASE ".idf_escape(DB));return
- true;}}return
- false;}function
- auto_increment(){$za=" PRIMARY KEY";if($_GET["create"]!=""&&$_POST["auto_increment_col"]){foreach(indexes($_GET["create"])as$u){if(in_array($_POST["fields"][$_POST["auto_increment_col"]]["orig"],$u["columns"],true)){$za="";break;}if($u["type"]=="PRIMARY")$za=" UNIQUE";}}return" AUTO_INCREMENT$za";}function
- alter_table($Q,$E,$l,$qc,$ab,$Sb,$Va,$ya,$ue){$sa=array();foreach($l
- as$k)$sa[]=($k[1]?($Q!=""?($k[0]!=""?"CHANGE ".idf_escape($k[0]):"ADD"):" ")." ".implode($k[1]).($Q!=""?$k[2]:""):"DROP ".idf_escape($k[0]));$sa=array_merge($sa,$qc);$Cf="COMMENT=".q($ab).($Sb?" ENGINE=".q($Sb):"").($Va?" COLLATE ".q($Va):"").($ya!=""?" AUTO_INCREMENT=$ya":"").$ue;if($Q=="")return
- queries("CREATE TABLE ".table($E)." (\n".implode(",\n",$sa)."\n) $Cf");if($Q!=$E)$sa[]="RENAME TO ".table($E);$sa[]=$Cf;return
- queries("ALTER TABLE ".table($Q)."\n".implode(",\n",$sa));}function
- alter_indexes($Q,$sa){foreach($sa
- as$y=>$X)$sa[$y]=($X[2]=="DROP"?"\nDROP INDEX ".idf_escape($X[1]):"\nADD $X[0] ".($X[0]=="PRIMARY"?"KEY ":"").($X[1]!=""?idf_escape($X[1])." ":"")."(".implode(", ",$X[2]).")");return
- queries("ALTER TABLE ".table($Q).implode(",",$sa));}function
- truncate_tables($S){return
- apply_queries("TRUNCATE TABLE",$S);}function
- drop_views($Kg){return
- queries("DROP VIEW ".implode(", ",array_map('table',$Kg)));}function
- drop_tables($S){return
- queries("DROP TABLE ".implode(", ",array_map('table',$S)));}function
- move_tables($S,$Kg,$Uf){$bf=array();foreach(array_merge($S,$Kg)as$Q)$bf[]=table($Q)." TO ".idf_escape($Uf).".".table($Q);return
- queries("RENAME TABLE ".implode(", ",$bf));}function
- copy_tables($S,$Kg,$Uf){queries("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");foreach($S
- as$Q){$E=($Uf==DB?table("copy_$Q"):idf_escape($Uf).".".table($Q));if(!queries("\nDROP TABLE IF EXISTS $E")||!queries("CREATE TABLE $E LIKE ".table($Q))||!queries("INSERT INTO $E SELECT * FROM ".table($Q)))return
- false;}foreach($Kg
- as$Q){$E=($Uf==DB?table("copy_$Q"):idf_escape($Uf).".".table($Q));$Jg=view($Q);if(!queries("DROP VIEW IF EXISTS $E")||!queries("CREATE VIEW $E AS $Jg[select]"))return
- false;}return
- true;}function
- trigger($E){if($E=="")return
- array();$M=get_rows("SHOW TRIGGERS WHERE `Trigger` = ".q($E));return
- reset($M);}function
- triggers($Q){$K=array();foreach(get_rows("SHOW TRIGGERS LIKE ".q(addcslashes($Q,"%_\\")))as$L)$K[$L["Trigger"]]=array($L["Timing"],$L["Event"]);return$K;}function
- trigger_options(){return
- array("Timing"=>array("BEFORE","AFTER"),"Event"=>array("INSERT","UPDATE","DELETE"),"Type"=>array("FOR EACH ROW"),);}function
- routine($E,$U){global$e,$Ub,$Oc,$sg;$qa=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$rg="((".implode("|",array_merge(array_keys($sg),$qa)).")\\b(?:\\s*\\(((?:[^'\")]|$Ub)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ye="\\s*(".($U=="FUNCTION"?"":$Oc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$rg";$jb=$e->result("SHOW CREATE $U ".idf_escape($E),2);preg_match("~\\(((?:$ye\\s*,?)*)\\)\\s*".($U=="FUNCTION"?"RETURNS\\s+$rg\\s+":"")."(.*)~is",$jb,$B);$l=array();preg_match_all("~$ye\\s*,?~is",$B[1],$sd,PREG_SET_ORDER);foreach($sd
- as$pe){$E=str_replace("``","`",$pe[2]).$pe[3];$l[]=array("field"=>$E,"type"=>strtolower($pe[5]),"length"=>preg_replace_callback("~$Ub~s",'normalize_enum',$pe[6]),"unsigned"=>strtolower(preg_replace('~\\s+~',' ',trim("$pe[8] $pe[7]"))),"null"=>1,"full_type"=>$pe[4],"inout"=>strtoupper($pe[1]),"collation"=>strtolower($pe[9]),);}if($U!="FUNCTION")return
- array("fields"=>$l,"definition"=>$B[11]);return
- array("fields"=>$l,"returns"=>array("type"=>$B[12],"length"=>$B[13],"unsigned"=>$B[15],"collation"=>$B[16]),"definition"=>$B[17],"language"=>"SQL",);}function
- routines(){return
- get_rows("SELECT ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = ".q(DB));}function
- routine_languages(){return
- array();}function
- last_id(){global$e;return$e->result("SELECT LAST_INSERT_ID()");}function
- explain($e,$I){return$e->query("EXPLAIN ".($e->server_info>=5.1?"PARTITIONS ":"").$I);}function
- found_rows($R,$Z){return($Z||$R["Engine"]!="InnoDB"?null:$R["Rows"]);}function
- types(){return
- array();}function
- schemas(){return
- array();}function
- get_schema(){return"";}function
- set_schema($nf){return
- true;}function
- create_sql($Q,$ya){global$e;$K=$e->result("SHOW CREATE TABLE ".table($Q),1);if(!$ya)$K=preg_replace('~ AUTO_INCREMENT=\\d+~','',$K);return$K;}function
- truncate_sql($Q){return"TRUNCATE ".table($Q);}function
- use_sql($qb){return"USE ".idf_escape($qb);}function
- trigger_sql($Q,$Hf){$K="";foreach(get_rows("SHOW TRIGGERS LIKE ".q(addcslashes($Q,"%_\\")),null,"-- ")as$L)$K.="\n".($Hf=='CREATE+ALTER'?"DROP TRIGGER IF EXISTS ".idf_escape($L["Trigger"]).";;\n":"")."CREATE TRIGGER ".idf_escape($L["Trigger"])." $L[Timing] $L[Event] ON ".table($L["Table"])." FOR EACH ROW\n$L[Statement];;\n";return$K;}function
- 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
- convert_field($k){if(preg_match("~binary~",$k["type"]))return"HEX(".idf_escape($k["field"]).")";if($k["type"]=="bit")return"BIN(".idf_escape($k["field"])." + 0)";if(preg_match("~geometry|point|linestring|polygon~",$k["type"]))return"AsWKT(".idf_escape($k["field"]).")";}function
- unconvert_field($k,$K){if(preg_match("~binary~",$k["type"]))$K="UNHEX($K)";if($k["type"]=="bit")$K="CONV($K, 2, 10) + 0";if(preg_match("~geometry|point|linestring|polygon~",$k["type"]))$K="GeomFromText($K)";return$K;}function
- support($jc){global$e;return!preg_match("~scheme|sequence|type|view_trigger".($e->server_info<5.1?"|event|partitioning".($e->server_info<5?"|routine|trigger|view":""):"")."~",$jc);}$x="sql";$sg=array();$Gf=array();foreach(array('Numbers'=>array("tinyint"=>3,"smallint"=>5,"mediumint"=>8,"int"=>10,"bigint"=>20,"decimal"=>66,"float"=>12,"double"=>21),'Date and time'=>array("date"=>10,"datetime"=>19,"timestamp"=>19,"time"=>10,"year"=>4),'Strings'=>array("char"=>255,"varchar"=>65535,"tinytext"=>255,"text"=>65535,"mediumtext"=>16777215,"longtext"=>4294967295),'Lists'=>array("enum"=>65535,"set"=>64),'Binary'=>array("bit"=>20,"binary"=>255,"varbinary"=>65535,"tinyblob"=>255,"blob"=>65535,"mediumblob"=>16777215,"longblob"=>4294967295),'Geometry'=>array("geometry"=>0,"point"=>0,"linestring"=>0,"polygon"=>0,"multipoint"=>0,"multilinestring"=>0,"multipolygon"=>0,"geometrycollection"=>0),)as$y=>$X){$sg+=$X;$Gf[$y]=array_keys($X);}$zg=array("unsigned","zerofill","unsigned zerofill");$ae=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","REGEXP","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","SQL");$xc=array("char_length","date","from_unixtime","lower","round","sec_to_time","time_to_sec","upper");$_c=array("avg","count","count distinct","group_concat","max","min","sum");$Kb=array(array("char"=>"md5/sha1/password/encrypt/uuid","binary"=>"md5/sha1","date|time"=>"now",),array("(^|[^o])int|float|double|decimal"=>"+/-","date"=>"+ interval/- interval","time"=>"addtime/subtime","char|text"=>"concat",));}define("SERVER",$_GET[DRIVER]);define("DB",$_GET["db"]);define("ME",preg_replace('~^[^?]*/([^?]*).*~','\\1',$_SERVER["REQUEST_URI"]).'?'.(sid()?SID.'&':'').(SERVER!==null?DRIVER."=".urlencode(SERVER).'&':'').(isset($_GET["username"])?"username=".urlencode($_GET["username"]).'&':'').(DB!=""?'db='.urlencode(DB).'&'.(isset($_GET["ns"])?"ns=".urlencode($_GET["ns"])."&":""):''));$ga="4.1.0";class
- Adminer{var$operators;function
- name(){return"<a href='http://www.adminer.org/' target='_blank' id='h1'>Adminer</a>";}function
- credentials(){return
- array(SERVER,$_GET["username"],get_password());}function
- permanentLogin($jb=false){return
- password_file($jb);}function
- bruteForceKey(){return$_SERVER["REMOTE_ADDR"];}function
- database(){return
- DB;}function
- databases($pc=true){return
- get_databases($pc);}function
- schemas(){return
- schemas();}function
- queryTimeout(){return
- 5;}function
- headers(){return
- true;}function
- head(){return
- true;}function
- loginForm(){global$Db;echo'<table cellspacing="0">
- <tr><th>System<td>',html_select("auth[driver]",$Db,DRIVER,"loginDriver(this);"),'<tr><th>Server<td><input name="auth[server]" value="',h(SERVER),'" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
- <tr><th>Username<td><input name="auth[username]" id="username" value="',h((isset($_GET["username"])?$_GET["username"]:'')),'" autocapitalize="off">
- <tr><th>Password<td><input type="password" name="auth[password]">
- <tr><th>Database<td><input name="auth[db]" value="',h((isset($_GET["db"])?$_GET["db"]:''));?>" autocapitalize="off">
- </table>
- <script type="text/javascript">
- var username = document.getElementById('username');
- focus(username);
- username.form['auth[driver]'].onchange();
- </script>
- <?php
- echo"<p><input type='submit' value='".'Login'."'>\n",checkbox("auth[permanent]",1,(isset($_COOKIE["adminer_permanent"])?$_COOKIE["adminer_permanent"]:false),'Permanent login')."\n";}function
- login($qd,$G){return
- true;}function
- tableName($Nf){return
- h($Nf["Name"]);}function
- fieldName($k,$ee=0){return'<span title="'.h($k["full_type"]).'">'.h($k["field"]).'</span>';}function
- selectLinks($Nf,$P=""){echo'<p class="links">';$pd=array("select"=>'Select data');if(support("table")||support("indexes"))$pd["table"]='Show structure';if(support("table")){if(is_view($Nf))$pd["view"]='Alter view';else$pd["create"]='Alter table';}if($P!==null)$pd["edit"]='New item';foreach($pd
- as$y=>$X)echo" <a href='".h(ME)."$y=".urlencode($Nf["Name"]).($y=="edit"?$P:"")."'".bold(isset($_GET[$y])).">$X</a>";echo"\n";}function
- foreignKeys($Q){return
- foreign_keys($Q);}function
- backwardKeys($Q,$Mf){return
- array();}function
- backwardKeysPrint($Aa,$L){}function
- selectQuery($I,$ag){global$x;return"<p><code class='jush-$x'>".h(str_replace("\n"," ",$I))."</code> <span class='time'>($ag)</span>".(support("sql")?" <a href='".h(ME)."sql=".urlencode($I)."'>".'Edit'."</a>":"")."</p>";}function
- rowDescription($Q){return"";}function
- rowDescriptions($M,$rc){return$M;}function
- selectLink($X,$k){}function
- selectVal($X,$_,$k,$le){$K=($X===null?"<i>NULL</i>":(preg_match("~char|binary~",$k["type"])&&!preg_match("~var~",$k["type"])?"<code>$X</code>":$X));if(preg_match('~blob|bytea|raw|file~',$k["type"])&&!is_utf8($X))$K=lang(array('%d byte','%d bytes'),strlen($le));return($_?"<a href='".h($_)."'".(is_url($_)?" rel='noreferrer'":"").">$K</a>":$K);}function
- editVal($X,$k){return$X;}function
- selectColumnsPrint($N,$d){global$xc,$_c;print_fieldset("select",'Select',$N);$s=0;$N[""]=array();foreach($N
- as$y=>$X){$X=$_GET["columns"][$y];$c=select_input(" name='columns[$s][col]' onchange='".($y!==""?"selectFieldChange(this.form)":"selectAddRow(this)").";'",$d,$X["col"]);echo"<div>".($xc||$_c?"<select name='columns[$s][fun]' onchange='helpClose();".($y!==""?"":" this.nextSibling.nextSibling.onchange();")."'".on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'",1).">".optionlist(array(-1=>"")+array_filter(array('Functions'=>$xc,'Aggregation'=>$_c)),$X["fun"])."</select>"."($c)":$c)."</div>\n";$s++;}echo"</div></fieldset>\n";}function
- selectSearchPrint($Z,$d,$v){print_fieldset("search",'Search',$Z);foreach($v
- as$s=>$u){if($u["type"]=="FULLTEXT"){echo"(<i>".implode("</i>, <i>",array_map('h',$u["columns"]))."</i>) AGAINST"," <input type='search' name='fulltext[$s]' value='".h($_GET["fulltext"][$s])."' onchange='selectFieldChange(this.form);'>",checkbox("boolean[$s]",1,isset($_GET["boolean"][$s]),"BOOL"),"<br>\n";}}$_GET["where"]=(array)$_GET["where"];reset($_GET["where"]);$Ka="this.nextSibling.onchange();";for($s=0;$s<=count($_GET["where"]);$s++){list(,$X)=each($_GET["where"]);if(!$X||("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators))){echo"<div>".select_input(" name='where[$s][col]' onchange='$Ka'",$d,$X["col"],"(".'anywhere'.")"),html_select("where[$s][op]",$this->operators,$X["op"],$Ka),"<input type='search' name='where[$s][val]' value='".h($X["val"])."' onchange='".($X?"selectFieldChange(this.form)":"selectAddRow(this)").";' onkeydown='selectSearchKeydown(this, event);' onsearch='selectSearchSearch(this);'></div>\n";}}echo"</div></fieldset>\n";}function
- selectOrderPrint($ee,$d,$v){print_fieldset("sort",'Sort',$ee);$s=0;foreach((array)$_GET["order"]as$y=>$X){if($X!=""){echo"<div>".select_input(" name='order[$s]' onchange='selectFieldChange(this.form);'",$d,$X),checkbox("desc[$s]",1,isset($_GET["desc"][$y]),'descending')."</div>\n";$s++;}}echo"<div>".select_input(" name='order[$s]' onchange='selectAddRow(this);'",$d),checkbox("desc[$s]",1,false,'descending')."</div>\n","</div></fieldset>\n";}function
- selectLimitPrint($z){echo"<fieldset><legend>".'Limit'."</legend><div>";echo"<input type='number' name='limit' class='size' value='".h($z)."' onchange='selectFieldChange(this.form);'>","</div></fieldset>\n";}function
- selectLengthPrint($Zf){if($Zf!==null){echo"<fieldset><legend>".'Text length'."</legend><div>","<input type='number' name='text_length' class='size' value='".h($Zf)."'>","</div></fieldset>\n";}}function
- selectActionPrint($v){echo"<fieldset><legend>".'Action'."</legend><div>","<input type='submit' value='".'Select'."'>"," <span id='noindex' title='".'Full table scan'."'></span>","<script type='text/javascript'>\n","var indexColumns = ";$d=array();foreach($v
- as$u){if($u["type"]!="FULLTEXT")$d[reset($u["columns"])]=1;}$d[""]=1;foreach($d
- as$y=>$X)json_row($y);echo";\n","selectFieldChange(document.getElementById('form'));\n","</script>\n","</div></fieldset>\n";}function
- selectCommandPrint(){return!information_schema(DB);}function
- selectImportPrint(){return!information_schema(DB);}function
- selectEmailPrint($Pb,$d){}function
- selectColumnsProcess($d,$v){global$xc,$_c;$N=array();$r=array();foreach((array)(isset($_GET["columns"])?$_GET["columns"]:null)as$y=>$X){if($X["fun"]=="count"||($X["col"]!=""&&(!$X["fun"]||in_array($X["fun"],$xc)||in_array($X["fun"],$_c)))){$N[$y]=apply_sql_function($X["fun"],($X["col"]!=""?idf_escape($X["col"]):"*"));if(!in_array($X["fun"],$_c))$r[]=$N[$y];}}return
- array($N,$r);}function
- selectSearchProcess($l,$v){global$x;$K=array();foreach($v
- as$s=>$u){if($u["type"]=="FULLTEXT"&&$_GET["fulltext"][$s]!="")$K[]="MATCH (".implode(", ",array_map('idf_escape',$u["columns"])).") AGAINST (".q($_GET["fulltext"][$s]).(isset($_GET["boolean"][$s])?" IN BOOLEAN MODE":"").")";}foreach((array)(isset($_GET["where"])?$_GET["where"]:null)as$X){if("$X[col]$X[val]"!=""&&in_array($X["op"],$this->operators)){$cb=" $X[op]";if(preg_match('~IN$~',$X["op"])){$Lc=process_length($X["val"]);$cb.=" ".($Lc!=""?$Lc:"(NULL)");}elseif($X["op"]=="SQL")$cb=" $X[val]";elseif($X["op"]=="LIKE %%")$cb=" LIKE ".$this->processInput($l[$X["col"]],"%$X[val]%");elseif(!preg_match('~NULL$~',$X["op"]))$cb.=" ".$this->processInput($l[$X["col"]],$X["val"]);if($X["col"]!="")$K[]=idf_escape($X["col"]).$cb;else{$Xa=array();foreach($l
- as$E=>$k){$Xc=preg_match('~char|text|enum|set~',$k["type"]);if((is_numeric($X["val"])||!preg_match('~(^|[^o])int|float|double|decimal|bit~',$k["type"]))&&(!preg_match("~[\x80-\xFF]~",$X["val"])||$Xc)){$E=idf_escape($E);$Xa[]=($x=="sql"&&$Xc&&!preg_match('~^utf8~',$k["collation"])?"CONVERT($E USING utf8)":$E);}}$K[]=($Xa?"(".implode("$cb OR ",$Xa)."$cb)":"0");}}}return$K;}function
- selectOrderProcess($l,$v){$K=array();foreach((array)(isset($_GET["order"])?$_GET["order"]:null)as$y=>$X){if($X!="")$K[]=(preg_match('~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\\)|COUNT\\(\\*\\))$~',$X)?$X:idf_escape($X)).(isset($_GET["desc"][$y])?" DESC":"");}return$K;}function
- selectLimitProcess(){return(isset($_GET["limit"])?$_GET["limit"]:"50");}function
- selectLengthProcess(){return(isset($_GET["text_length"])?$_GET["text_length"]:"100");}function
- selectEmailProcess($Z,$rc){return
- false;}function
- selectQueryBuild($N,$Z,$r,$ee,$z,$F){return"";}function
- messageQuery($I,$ag){global$x;restart_session();$Ec=&get_session("queries");$t="sql-".count($Ec[$_GET["db"]]);if(strlen($I)>1e6)$I=preg_replace('~[\x80-\xFF]+$~','',substr($I,0,1e6))."\n...";$Ec[$_GET["db"]][]=array($I,time(),$ag);return" <span class='time'>".@date("H:i:s")."</span> <a href='#$t' onclick=\"return !toggle('$t');\">".'SQL command'."</a>"."<div id='$t' class='hidden'><pre><code class='jush-$x'>".shorten_utf8($I,1000).'</code></pre>'.($ag?" <span class='time'>($ag)</span>":'').(support("sql")?'<p><a href="'.h(str_replace("db=".urlencode(DB),"db=".urlencode($_GET["db"]),ME).'sql=&history='.(count($Ec[$_GET["db"]])-1)).'">'.'Edit'.'</a>':'').'</div>';}function
- editFunctions($k){global$Kb;$K=($k["null"]?"NULL/":"");foreach($Kb
- as$y=>$xc){if(!$y||(!isset($_GET["call"])&&(isset($_GET["select"])||where($_GET)))){foreach($xc
- as$ye=>$X){if(!$ye||preg_match("~$ye~",$k["type"]))$K.="/$X";}if($y&&!preg_match('~set|blob|bytea|raw|file~',$k["type"]))$K.="/SQL";}}if($k["auto_increment"]&&!isset($_GET["select"])&&!where($_GET))$K='Auto Increment';return
- explode("/",$K);}function
- editInput($Q,$k,$wa,$Y){if($k["type"]=="enum")return(isset($_GET["select"])?"<label><input type='radio'$wa value='-1' checked><i>".'original'."</i></label> ":"").($k["null"]?"<label><input type='radio'$wa value=''".($Y!==null||isset($_GET["select"])?"":" checked")."><i>NULL</i></label> ":"").enum_input("radio",$wa,$k,$Y,0);return"";}function
- processInput($k,$Y,$p=""){if($p=="SQL")return$Y;$E=$k["field"];$K=q($Y);if(preg_match('~^(now|getdate|uuid)$~',$p))$K="$p()";elseif(preg_match('~^current_(date|timestamp)$~',$p))$K=$p;elseif(preg_match('~^([+-]|\\|\\|)$~',$p))$K=idf_escape($E)." $p $K";elseif(preg_match('~^[+-] interval$~',$p))$K=idf_escape($E)." $p ".(preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i",$Y)?$Y:$K);elseif(preg_match('~^(addtime|subtime|concat)$~',$p))$K="$p(".idf_escape($E).", $K)";elseif(preg_match('~^(md5|sha1|password|encrypt)$~',$p))$K="$p($K)";return
- unconvert_field($k,$K);}function
- dumpOutput(){$K=array('text'=>'open','file'=>'save');if(function_exists('gzencode'))$K['gz']='gzip';return$K;}function
- dumpFormat(){return
- array('sql'=>'SQL','csv'=>'CSV,','csv;'=>'CSV;','tsv'=>'TSV');}function
- dumpDatabase($h){}function
- dumpTable($Q,$Hf,$Yc=0){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($Hf)dump_csv(array_keys(fields($Q)));}elseif($Hf){if($Yc==2){$l=array();foreach(fields($Q)as$E=>$k)$l[]=idf_escape($E)." $k[full_type]";$jb="CREATE TABLE ".table($Q)." (".implode(", ",$l).")";}else$jb=create_sql($Q,$_POST["auto_increment"]);if($jb){if($Hf=="DROP+CREATE"||$Yc==1)echo"DROP ".($Yc==2?"VIEW":"TABLE")." IF EXISTS ".table($Q).";\n";if($Yc==1)$jb=remove_definer($jb);echo"$jb;\n\n";}}}function
- dumpData($Q,$Hf,$I){global$e,$x;$ud=($x=="sqlite"?0:1048576);if($Hf){if($_POST["format"]=="sql"){if($Hf=="TRUNCATE+INSERT")echo
- truncate_sql($Q).";\n";$l=fields($Q);}$J=$e->query($I,1);if($J){$Qc="";$Ia="";$ad=array();$Jf="";$kc=($Q!=''?'fetch_assoc':'fetch_row');while($L=$J->$kc()){if(!$ad){$Gg=array();foreach($L
- as$X){$k=$J->fetch_field();$ad[]=$k->name;$y=idf_escape($k->name);$Gg[]="$y = VALUES($y)";}$Jf=($Hf=="INSERT+UPDATE"?"\nON DUPLICATE KEY UPDATE ".implode(", ",$Gg):"").";\n";}if($_POST["format"]!="sql"){if($Hf=="table"){dump_csv($ad);$Hf="INSERT";}dump_csv($L);}else{if(!$Qc)$Qc="INSERT INTO ".table($Q)." (".implode(", ",array_map('idf_escape',$ad)).") VALUES";foreach($L
- as$y=>$X){$k=$l[$y];$L[$y]=($X!==null?unconvert_field($k,preg_match('~(^|[^o])int|float|double|decimal~',$k["type"])&&$X!=''?$X:q($X)):"NULL");}$lf=($ud?"\n":" ")."(".implode(",\t",$L).")";if(!$Ia)$Ia=$Qc.$lf;elseif(strlen($Ia)+4+strlen($lf)+strlen($Jf)<$ud)$Ia.=",$lf";else{echo$Ia.$Jf;$Ia=$Qc.$lf;}}}if($Ia)echo$Ia.$Jf;}elseif($_POST["format"]=="sql")echo"-- ".str_replace("\n"," ",$e->error)."\n";}}function
- dumpFilename($Ic){return
- friendly_url($Ic!=""?$Ic:(SERVER!=""?SERVER:"localhost"));}function
- dumpHeaders($Ic,$Fd=false){$ne=$_POST["output"];$fc=(preg_match('~sql~',$_POST["format"])?"sql":($Fd?"tar":"csv"));header("Content-Type: ".($ne=="gz"?"application/x-gzip":($fc=="tar"?"application/x-tar":($fc=="sql"||$ne!="file"?"text/plain":"text/csv")."; charset=utf-8")));if($ne=="gz")ob_start('ob_gzencode',1e6);return$fc;}function
- homepage(){echo'<p class="links">'.(empty($_GET["ns"])&&support("database")?'<a href="'.h(ME).'database=">'.'Alter database'."</a>\n":""),(support("scheme")?"<a href='".h(ME)."scheme='>".(!empty($_GET["ns"])?'Alter schema':'Create schema')."</a>\n":""),(!empty($_GET["ns"])?'<a href="'.h(ME).'schema=">'.'Database schema'."</a>\n":""),(support("privileges")?"<a href='".h(ME)."privileges='>".'Privileges'."</a>\n":"");return
- true;}function
- navigation($Ed){global$ga,$x,$Db,$e;echo'<h1>
- ',$this->name(),' <span class="version">',$ga,'</span>
- <a href="http://www.adminer.org/#download" target="_blank" id="version">',(version_compare($ga,$_COOKIE["adminer_version"])<0?h($_COOKIE["adminer_version"]):""),'</a>
- </h1>
- ';if($Ed=="auth"){$oc=true;foreach((array)$_SESSION["pwds"]as$Ig=>$vf){foreach($vf
- as$O=>$Eg){foreach($Eg
- as$V=>$G){if($G!==null){if($oc){echo"<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";$oc=false;}$tb=$_SESSION["db"][$Ig][$O][$V];foreach(($tb?array_keys($tb):array(""))as$h)echo"<a href='".h(auth_url($Ig,$O,$V,$h))."'>($Db[$Ig]) ".h($V.($O!=""?"@$O":"").($h!=""?" - $h":""))."</a><br>\n";}}}}}else{if((isset($_GET["ns"])?$_GET["ns"]:null)!==""&&!$Ed&&DB!=""){$e->select_db(DB);$S=table_status('',true);}if(support("sql")){echo'<script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=jush.js&version=4.1.0&driver=mysql",'"></script>
- <script type="text/javascript">
- ';if($S){$pd=array();foreach($S
- as$Q=>$U)$pd[]=preg_quote($Q,'/');echo"var jushLinks = { $x: [ '".js_escape(ME).(support("table")?"table=":"select=")."\$&', /\\b(".implode("|",$pd).")\\b/g ] };\n";foreach(array("bac","bra","sqlite_quo","mssql_bra")as$X)echo"jushLinks.$X = jushLinks.$x;\n";}echo'bodyLoad(\'',(is_object($e)?substr($e->server_info,0,3):""),'\');
- </script>
- ';}$this->databasesPrint($Ed);if(DB==""||!$Ed){echo"<p class='links'>".(support("sql")?"<a href='".h(ME)."sql='".bold(isset($_GET["sql"])&&!isset($_GET["import"])).">".'SQL command'."</a>\n<a href='".h(ME)."import='".bold(isset($_GET["import"])).">".'Import'."</a>\n":"")."";if(support("dump"))echo"<a href='".h(ME)."dump=".urlencode(isset($_GET["table"])?$_GET["table"]:$_GET["select"])."' id='dump'".bold(isset($_GET["dump"])).">".'Dump'."</a>\n";}if((isset($_GET["ns"])?$_GET["ns"]:null)!==""&&!$Ed&&DB!=""){echo'<a href="'.h(ME).'create="'.bold((isset($_GET["create"])?$_GET["create"]:null)==="").">".'Create table'."</a>\n";if(!$S)echo"<p class='message'>".'No tables.'."\n";else$this->tablesPrint($S);}}}function
- databasesPrint($Ed){global$b,$e;$g=$this->databases();echo'<form action="">
- <p id="dbs">
- ';hidden_fields_get();$rb=" onmousedown='dbMouseDown(event, this);' onchange='dbChange(this);'";echo"<span title='".'database'."'>DB</span>: ".($g?"<select name='db'$rb>".optionlist(array(""=>"")+$g,DB)."</select>":'<input name="db" value="'.h(DB).'" autocapitalize="off">'),"<input type='submit' value='".'Use'."'".($g?" class='hidden'":"").">\n";if($Ed!="db"&&DB!=""&&$e->select_db(DB)){}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($S){echo"<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";foreach($S
- as$Q=>$Cf){echo'<a href="'.h(ME).'select='.urlencode($Q).'"'.bold((isset($_GET["select"])?$_GET["select"]:null)==$Q||(isset($_GET["edit"])?$_GET["edit"]:null)==$Q).">".'select'."</a> ";$E=$this->tableName($Cf);echo(support("table")||support("indexes")?'<a href="'.h(ME).'table='.urlencode($Q).'"'.bold(in_array($Q,array(isset($_GET["table"])?$_GET["table"]:null,isset($_GET["create"])?$_GET["create"]:null,isset($_GET["indexes"])?$_GET["indexes"]:null,isset($_GET["foreign"])?$_GET["foreign"]:null,isset($_GET["trigger"])?$_GET["trigger"]:null)),(is_view($Cf)?"view":""))." title='".'Show structure'."'>$E</a>":"<span>$E</span>")."<br>\n";}}}$b=(function_exists('adminer_object')?adminer_object():new
- Adminer);if($b->operators===null)$b->operators=$ae;function
- page_header($dg,$j="",$Ha=array(),$eg=""){global$ca,$ga,$b,$Db,$x;page_headers();$fg=$dg.($eg!=""?": $eg":"");$gg=strip_tags($fg.(SERVER!=""&&SERVER!="localhost"?h(" - ".SERVER):"")." - ".$b->name());echo'<!DOCTYPE html>
- <html lang="en" dir="ltr">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="Content-Script-Type" content="text/javascript">
- <meta name="robots" content="noindex">
- <title>',$gg,'</title>
- <link rel="stylesheet" type="text/css" href="',h(preg_replace("~\\?.*~","",ME))."?file=default.css&version=4.1.0&driver=mysql",'">
- <script type="text/javascript" src="',h(preg_replace("~\\?.*~","",ME))."?file=functions.js&version=4.1.0&driver=mysql",'"></script>
- ';if($b->head()){echo'<link rel="shortcut icon" type="image/x-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&version=4.1.0&driver=mysql",'">
- <link rel="apple-touch-icon" href="',h(preg_replace("~\\?.*~","",ME))."?file=favicon.ico&version=4.1.0&driver=mysql",'">
- ';if(file_exists("adminer.css")){echo'<link rel="stylesheet" type="text/css" href="adminer.css">
- ';}}echo'
- <body class="ltr nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"',(isset($_COOKIE["adminer_version"])?"":" onload=\"verifyVersion('$ga');\""),'>
- <script type="text/javascript">
- document.body.className = document.body.className.replace(/ nojs/, \' js\');
- </script>
- <div id="help" class="jush-',$x,' jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div>
- <div id="content">
- ';if($Ha!==null){$_=substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1);echo'<p id="breadcrumb"><a href="'.h($_?$_:".").'">'.$Db[DRIVER].'</a> » ';$_=substr(preg_replace('~\b(db|ns)=[^&]*&~','',ME),0,-1);$O=(SERVER!=""?h(SERVER):'Server');if($Ha===false)echo"$O\n";else{echo"<a href='".($_?h($_):".")."' accesskey='1' title='Alt+Shift+1'>$O</a> » ";if(!empty($_GET["ns"])||(DB!=""&&is_array($Ha)))echo'<a href="'.h($_."&db=".urlencode(DB).(support("scheme")?"&ns=":"")).'">'.h(DB).'</a> » ';if(is_array($Ha)){if(!empty($_GET["ns"]))echo'<a href="'.h(substr(ME,0,-1)).'">'.h($_GET["ns"]).'</a> » ';foreach($Ha
- as$y=>$X){$xb=(is_array($X)?$X[1]:h($X));if($xb!="")echo"<a href='".h(ME."$y=").urlencode(is_array($X)?$X[0]:$X)."'>$xb</a> » ";}}echo"$dg\n";}}echo"<h2>$fg</h2>\n";restart_session();page_messages($j);$g=get_session("dbs");if(DB!=""&&$g&&!in_array(DB,$g,true))$g=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");if($b->headers()){header("X-Frame-Options: deny");header("X-XSS-Protection: 0");}}function
- page_messages($j){$Ag=preg_replace('~^[^?]*~','',$_SERVER["REQUEST_URI"]);$Cd=((isset($_SESSION["messages"]) && isset($_SESSION["messages"][$Ag]))?$_SESSION["messages"][$Ag]:false);if($Cd){echo"<div class='message'>".implode("</div>\n<div class='message'>",$Cd)."</div>\n";unset($_SESSION["messages"][$Ag]);}if($j)echo"<div class='error'>$j</div>\n";}function
- page_footer($Ed=""){global$b,$T;echo'</div>
- ';if($Ed!="auth"){echo'<form action="" method="post">
- <p class="logout">
- <input type="submit" name="logout" value="Logout" id="logout">
- <input type="hidden" name="token" value="',$T,'">
- </p>
- </form>
- ';}echo'<div id="menu">
- ';$b->navigation($Ed);echo'</div>
- <script type="text/javascript">setupSubmitHighlight(document);</script>
- ';}function
- int32($D){while($D>=2147483648)$D-=4294967296;while($D<=-2147483649)$D+=4294967296;return(int)$D;}function
- long2str($W,$Mg){$lf='';foreach($W
- as$X)$lf.=pack('V',$X);if($Mg)return
- substr($lf,0,end($W));return$lf;}function
- str2long($lf,$Mg){$W=array_values(unpack('V*',str_pad($lf,4*ceil(strlen($lf)/4),"\0")));if($Mg)$W[]=strlen($lf);return$W;}function
- xxtea_mx($Rg,$Qg,$Kf,$Zc){return
- int32((($Rg>>5&0x7FFFFFF)^$Qg<<2)+(($Qg>>3&0x1FFFFFFF)^$Rg<<4))^int32(($Kf^$Qg)+($Zc^$Rg));}function
- encrypt_string($Ef,$y){if($Ef=="")return"";$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Ef,true);$D=count($W)-1;$Rg=$W[$D];$Qg=$W[0];$H=floor(6+52/($D+1));$Kf=0;while($H-->0){$Kf=int32($Kf+0x9E3779B9);$Jb=$Kf>>2&3;for($oe=0;$oe<$D;$oe++){$Qg=$W[$oe+1];$Gd=xxtea_mx($Rg,$Qg,$Kf,$y[$oe&3^$Jb]);$Rg=int32($W[$oe]+$Gd);$W[$oe]=$Rg;}$Qg=$W[0];$Gd=xxtea_mx($Rg,$Qg,$Kf,$y[$oe&3^$Jb]);$Rg=int32($W[$D]+$Gd);$W[$D]=$Rg;}return
- long2str($W,false);}function
- decrypt_string($Ef,$y){if($Ef=="")return"";if(!$y)return
- false;$y=array_values(unpack("V*",pack("H*",md5($y))));$W=str2long($Ef,false);$D=count($W)-1;$Rg=$W[$D];$Qg=$W[0];$H=floor(6+52/($D+1));$Kf=int32($H*0x9E3779B9);while($Kf){$Jb=$Kf>>2&3;for($oe=$D;$oe>0;$oe--){$Rg=$W[$oe-1];$Gd=xxtea_mx($Rg,$Qg,$Kf,$y[$oe&3^$Jb]);$Qg=int32($W[$oe]-$Gd);$W[$oe]=$Qg;}$Rg=$W[$D];$Gd=xxtea_mx($Rg,$Qg,$Kf,$y[$oe&3^$Jb]);$Qg=int32($W[0]-$Gd);$W[0]=$Qg;$Kf=int32($Kf-0x9E3779B9);}return
- long2str($W,true);}$e='';$Dc=$_SESSION["token"];if(!$Dc)$_SESSION["token"]=rand(1,1e6);$T=get_token();$ze=array();if(isset($_COOKIE["adminer_permanent"])?$_COOKIE["adminer_permanent"]:false){foreach(explode(" ",$_COOKIE["adminer_permanent"])as$X){list($y)=explode(":",$X);$ze[$y]=$X;}}function
- add_invalid_login(){global$b;$mc=get_temp_dir()."/adminer.invalid";$o=@fopen($mc,"r+");if(!$o){$o=@fopen($mc,"w");if(!$o)return;}flock($o,LOCK_EX);$Tc=unserialize(stream_get_contents($o));$ag=time();if($Tc){foreach($Tc
- as$Uc=>$X){if($X[0]<$ag)unset($Tc[$Uc]);}}$Sc=&$Tc[$b->bruteForceKey()];if(!$Sc)$Sc=array($ag+30*60,0);$Sc[1]++;$tf=serialize($Tc);rewind($o);fwrite($o,$tf);ftruncate($o,strlen($tf));flock($o,LOCK_UN);fclose($o);}$xa=(isset($_POST["auth"])?$_POST["auth"]:false);if($xa){$Tc=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$Sc=$Tc[$b->bruteForceKey()];$Ld=($Sc[1]>30?$Sc[0]-time():0);if($Ld>0)auth_error(lang(array('Too many unsuccessful logins, try again in %d minute.','Too many unsuccessful logins, try again in %d minutes.'),ceil($Ld/60)));session_regenerate_id();$i=$xa["driver"];$O=$xa["server"];$V=$xa["username"];$G=(string)$xa["password"];$h=$xa["db"];set_password($i,$O,$V,$G);$_SESSION["db"][$i][$O][$V][$h]=true;if($xa["permanent"]){$y=base64_encode($i)."-".base64_encode($O)."-".base64_encode($V)."-".base64_encode($h);$Je=$b->permanentLogin(true);$ze[$y]="$y:".base64_encode($Je?encrypt_string($G,$Je):"");cookie("adminer_permanent",implode(" ",$ze));}if(count($_POST)==1||DRIVER!=$i||SERVER!=$O||$_GET["username"]!==$V||DB!=$h)redirect(auth_url($i,$O,$V,$h));}elseif(isset($_POST["logout"])?$_POST["logout"]:false){if($Dc&&!verify_token()){page_header('Logout','Invalid CSRF token. Send the form again.');page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$y)set_session($y,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),'Logout successful.');}}elseif($ze&&!$_SESSION["pwds"]){session_regenerate_id();$Je=$b->permanentLogin();foreach($ze
- as$y=>$X){list(,$Pa)=explode(":",$X);list($Ig,$O,$V,$h)=array_map('base64_decode',explode("-",$y));set_password($Ig,$O,$V,decrypt_string(base64_decode($Pa),$Je));$_SESSION["db"][$Ig][$O][$V][$h]=true;}}function
- unset_permanent(){global$ze;foreach($ze
- as$y=>$X){list($Ig,$O,$V,$h)=array_map('base64_decode',explode("-",$y));if($Ig==DRIVER&&$O==SERVER&&$V==$_GET["username"]&&$h==DB)unset($ze[$y]);}cookie("adminer_permanent",implode(" ",$ze));}function
- auth_error($j){global$b,$Dc;$wf=session_name();if(!$_COOKIE[$wf]&&$_GET[$wf]&&ini_bool("session.use_only_cookies"))$j='Session support must be enabled.';elseif(isset($_GET["username"])){if(($_COOKIE[$wf]||$_GET[$wf])&&!$Dc)$j='Session expired, please login again.';else{add_invalid_login();$G=get_password();if($G!==null){if($G===false)$j.='<br>'.sprintf('Master password expired. <a href="http://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.','<code>permanentLogin()</code>');set_password(DRIVER,SERVER,$_GET["username"],null);}unset_permanent();}}$qe=session_get_cookie_params();cookie("adminer_key",($_COOKIE["adminer_key"]?$_COOKIE["adminer_key"]:rand_string()),$qe["lifetime"]);page_header('Login',$j,null);echo"<form action='' method='post'>\n";$b->loginForm();echo"<div>";hidden_fields($_POST,array("auth"));echo"</div>\n","</form>\n";page_footer("auth");exit;}if(isset($_GET["username"])){if(!class_exists("Min_DB")){unset($_SESSION["pwds"][DRIVER]);unset_permanent();page_header('No extension',sprintf('None of the supported PHP extensions (%s) are available.',implode(", ",$Ee)),false);page_footer("auth");exit;}$e=connect();}$i=new
- Min_Driver($e);if(!is_object($e)||!$b->login($_GET["username"],get_password()))auth_error((is_string($e)?$e:'Invalid credentials.'));if($xa&&$_POST["token"])$_POST["token"]=$T;$j='';if($_POST){if(!verify_token()){$Nc="max_input_vars";$yd=ini_get($Nc);if(extension_loaded("suhosin")){foreach(array("suhosin.request.max_vars","suhosin.post.max_vars")as$y){$X=ini_get($y);if($X&&(!$yd||$X<$yd)){$Nc=$y;$yd=$X;}}}$j=(!$_POST["token"]&&$yd?sprintf('Maximum number of allowed fields exceeded. Please increase %s.',"'$Nc'"):'Invalid CSRF token. Send the form again.');}}elseif($_SERVER["REQUEST_METHOD"]=="POST"){$j=sprintf('Too big POST data. Reduce the data or increase the %s configuration directive.',"'post_max_size'");if(isset($_GET["sql"]))$j.=' '.'You can upload a big SQL file via FTP and import it from server.';}if(!ini_bool("session.use_cookies")||@ini_set("session.use_cookies",false)!==false)session_write_close();function
- select($J,$f=null,$he=array()){global$x;$pd=array();$v=array();$d=array();$Fa=array();$sg=array();$K=array();odd('');for($s=0;$L=$J->fetch_row();$s++){if(!$s){echo"<table cellspacing='0' class='nowrap'>\n","<thead><tr>";for($w=0;$w<count($L);$w++){$k=$J->fetch_field();$E=$k->name;$ge=$k->orgtable;$fe=$k->orgname;$K[$k->table]=$ge;if($he&&$x=="sql")$pd[$w]=($E=="table"?"table=":($E=="possible_keys"?"indexes=":null));elseif($ge!=""){if(!isset($v[$ge])){$v[$ge]=array();foreach(indexes($ge,$f)as$u){if($u["type"]=="PRIMARY"){$v[$ge]=array_flip($u["columns"]);break;}}$d[$ge]=$v[$ge];}if(isset($d[$ge][$fe])){unset($d[$ge][$fe]);$v[$ge][$fe]=$w;$pd[$w]=$ge;}}if($k->charsetnr==63)$Fa[$w]=true;$sg[$w]=$k->type;echo"<th".($ge!=""||$k->name!=$fe?" title='".h(($ge!=""?"$ge.":"").$fe)."'":"").">".h($E).($he?doc_link(array('sql'=>"explain-output.html#explain_".strtolower($E))):"");}echo"</thead>\n";}echo"<tr".odd().">";foreach($L
- as$y=>$X){if($X===null)$X="<i>NULL</i>";elseif($Fa[$y]&&!is_utf8($X))$X="<i>".lang(array('%d byte','%d bytes'),strlen($X))."</i>";elseif(!strlen($X))$X=" ";else{$X=h($X);if($sg[$y]==254)$X="<code>$X</code>";}if(isset($pd[$y])&&!$d[$pd[$y]]){if($he&&$x=="sql"){$Q=$L[array_search("table=",$pd)];$_=$pd[$y].urlencode($he[$Q]!=""?$he[$Q]:$Q);}else{$_="edit=".urlencode($pd[$y]);foreach($v[$pd[$y]]as$Ta=>$w)$_.="&where".urlencode("[".bracket_escape($Ta)."]")."=".urlencode($L[$w]);}$X="<a href='".h(ME.$_)."'>$X</a>";}echo"<td>$X";}}echo($s?"</table>":"<p class='message'>".'No rows.')."\n";return$K;}function
- referencable_primary($rf){$K=array();foreach(table_status('',true)as$Of=>$Q){if($Of!=$rf&&fk_support($Q)){foreach(fields($Of)as$k){if($k["primary"]){if($K[$Of]){unset($K[$Of]);break;}$K[$Of]=$k;}}}}return$K;}function
- textarea($E,$Y,$M=10,$Xa=80){global$x;echo"<textarea name='$E' rows='$M' cols='$Xa' class='sqlarea jush-$x' spellcheck='false' wrap='off'>";if(is_array($Y)){foreach($Y
- as$X)echo
- h($X[0])."\n\n\n";}else
- echo
- h($Y);echo"</textarea>";}function
- edit_type($y,$k,$Wa,$n=array()){global$Gf,$sg,$zg,$Wd;$U=$k["type"];echo'<td><select name="',$y,'[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"',on_help("getTarget(event).value",1),'>';if($U&&!isset($sg[$U])&&!isset($n[$U]))array_unshift($Gf,$U);if($n)$Gf['Foreign keys']=$n;echo
- optionlist($Gf,$U),'</select>
- <td><input name="',$y,'[length]" value="',h($k["length"]),'" size="3" onfocus="editingLengthFocus(this);"',(!$k["length"]&&preg_match('~var(char|binary)$~',$U)?" class='required'":""),' onchange="editingLengthChange(this);" onkeyup="this.onchange();"><td class="options">';echo"<select name='$y"."[collation]'".(preg_match('~(char|text|enum|set)$~',$U)?"":" class='hidden'").'><option value="">('.'collation'.')'.optionlist($Wa,$k["collation"]).'</select>',($zg?"<select name='$y"."[unsigned]'".(!$U||preg_match('~((^|[^o])int|float|double|decimal)$~',$U)?"":" class='hidden'").'><option>'.optionlist($zg,$k["unsigned"]).'</select>':''),(isset($k['on_update'])?"<select name='$y"."[on_update]'".(preg_match('~timestamp|datetime~',$U)?"":" class='hidden'").'>'.optionlist(array(""=>"(".'ON UPDATE'.")","CURRENT_TIMESTAMP"),$k["on_update"]).'</select>':''),($n?"<select name='$y"."[on_delete]'".(preg_match("~`~",$U)?"":" class='hidden'")."><option value=''>(".'ON DELETE'.")".optionlist(explode("|",$Wd),$k["on_delete"])."</select> ":" ");}function
- process_length($ld){global$Ub;return(preg_match("~^\\s*\\(?\\s*$Ub(?:\\s*,\\s*$Ub)*+\\s*\\)?\\s*\$~",$ld)&&preg_match_all("~$Ub~",$ld,$sd)?"(".implode(",",$sd[0]).")":preg_replace('~^[0-9].*~','(\0)',preg_replace('~[^-0-9,+()[\]]~','',$ld)));}function
- process_type($k,$Ua="COLLATE"){global$zg;return" $k[type]".process_length($k["length"]).(preg_match('~(^|[^o])int|float|double|decimal~',$k["type"])&&in_array($k["unsigned"],$zg)?" $k[unsigned]":"").(preg_match('~char|text|enum|set~',$k["type"])&&$k["collation"]?" $Ua ".q($k["collation"]):"");}function
- process_field($k,$qg){global$x;$vb=$k["default"];return
- array(idf_escape(trim($k["field"])),process_type($qg),($k["null"]?" NULL":" NOT NULL"),(isset($vb)?" DEFAULT ".((preg_match('~time~',$k["type"])&&preg_match('~^CURRENT_TIMESTAMP$~i',$vb))||($k["type"]=="bit"&&preg_match("~^([0-9]+|b'[0-1]+')\$~",$vb))||($x=="pgsql"&&preg_match("~^[a-z]+\\(('[^']*')+\\)\$~",$vb))?$vb:q($vb)):""),(preg_match('~timestamp|datetime~',$k["type"])&&$k["on_update"]?" ON UPDATE $k[on_update]":""),(support("comment")&&$k["comment"]!=""?" COMMENT ".q($k["comment"]):""),($k["auto_increment"]?auto_increment():null),);}function
- type_class($U){foreach(array('char'=>'text','date'=>'time|year','binary'=>'blob','enum'=>'set',)as$y=>$X){if(preg_match("~$y|$X~",$U))return" class='$y'";}}function
- edit_fields($l,$Wa,$U="TABLE",$n=array(),$bb=false){global$e,$Oc;echo'<thead><tr class="wrap">
- ';if($U=="PROCEDURE"){echo'<td> ';}echo'<th>',($U=="TABLE"?'Column name':'Parameter name'),'<td>Type<textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea>
- <td>Length
- <td>Options
- ';if($U=="TABLE"){echo'<td>NULL
- <td><input type="radio" name="auto_increment_col" value=""><acronym title="Auto Increment">AI</acronym>',doc_link(array('sql'=>"example-auto-increment.html",'sqlite'=>"autoinc.html",'pgsql'=>"datatype.html#DATATYPE-SERIAL",'mssql'=>"ms186775.aspx",)),'<td>Default values
- ',(support("comment")?"<td".($bb?"":" class='hidden'").">".'Comment':"");}echo'<td>',"<input type='image' class='icon' name='add[".(support("move_col")?0:count($l))."]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&version=4.1.0&driver=mysql' alt='+' title='".'Add next'."'>",'<script type="text/javascript">row_count = ',count($l),';</script>
- </thead>
- <tbody onkeydown="return editingKeydown(event);">
- ';foreach($l
- as$s=>$k){$s++;$ie=$k[($_POST?"orig":"field")];$Ab=(isset($_POST["add"][$s-1])||(isset($k["field"])&&!$_POST["drop_col"][$s]))&&(support("drop_col")||$ie=="");echo'<tr',($Ab?"":" style='display: none;'"),'>
- ',($U=="PROCEDURE"?"<td>".html_select("fields[$s][inout]",explode("|",$Oc),$k["inout"]):""),'<th>';if($Ab){echo'<input name="fields[',$s,'][field]" value="',h($k["field"]),'" onchange="editingNameChange(this);',($k["field"]!=""||count($l)>1?'':' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'),'" maxlength="64" autocapitalize="off">';}echo'<input type="hidden" name="fields[',$s,'][orig]" value="',h($ie),'">
- ';edit_type("fields[$s]",$k,$Wa,$n);if($U=="TABLE"){echo'<td>',checkbox("fields[$s][null]",1,$k["null"],"","","block"),'<td><label class="block"><input type="radio" name="auto_increment_col" value="',$s,'"';if($k["auto_increment"]){echo' checked';}?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php
- echo
- checkbox("fields[$s][has_default]",1,$k["has_default"]),'<input name="fields[',$s,'][default]" value="',h($k["default"]),'" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
- ',(support("comment")?"<td".($bb?"":" class='hidden'")."><input name='fields[$s][comment]' value='".h($k["comment"])."' maxlength='".($e->server_info>=5.5?1024:255)."'>":"");}echo"<td>",(support("move_col")?"<input type='image' class='icon' name='add[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=plus.gif&version=4.1.0&driver=mysql' alt='+' title='".'Add next'."' onclick='return !editingAddRow(this, 1);'> "."<input type='image' class='icon' name='up[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=up.gif&version=4.1.0&driver=mysql' alt='^' title='".'Move up'."'> "."<input type='image' class='icon' name='down[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=down.gif&version=4.1.0&driver=mysql' alt='v' title='".'Move down'."'> ":""),($ie==""||support("drop_col")?"<input type='image' class='icon' name='drop_col[$s]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&version=4.1.0&driver=mysql' alt='x' title='".'Remove'."' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">":""),"\n";}}function
- process_fields(&$l){ksort($l);$Pd=0;if($_POST["up"]){$fd=0;foreach($l
- as$y=>$k){if(key($_POST["up"])==$y){unset($l[$y]);array_splice($l,$fd,0,array($k));break;}if(isset($k["field"]))$fd=$Pd;$Pd++;}}elseif($_POST["down"]){$tc=false;foreach($l
- as$y=>$k){if(isset($k["field"])&&$tc){unset($l[key($_POST["down"])]);array_splice($l,$Pd,0,array($tc));break;}if(key($_POST["down"])==$y)$tc=$k;$Pd++;}}elseif($_POST["add"]){$l=array_values($l);array_splice($l,key($_POST["add"]),0,array(array()));}elseif(!$_POST["drop_col"])return
- false;return
- true;}function
- normalize_enum($B){return"'".str_replace("'","''",addcslashes(stripcslashes(str_replace($B[0][0].$B[0][0],$B[0][0],substr($B[0],1,-1))),'\\'))."'";}function
- grant($q,$Le,$d,$Vd){if(!$Le)return
- true;if($Le==array("ALL PRIVILEGES","GRANT OPTION"))return($q=="GRANT"?queries("$q ALL PRIVILEGES$Vd WITH GRANT OPTION"):queries("$q ALL PRIVILEGES$Vd")&&queries("$q GRANT OPTION$Vd"));return
- queries("$q ".preg_replace('~(GRANT OPTION)\\([^)]*\\)~','\\1',implode("$d, ",$Le).$d).$Vd);}function
- drop_create($Eb,$jb,$Fb,$Xf,$Gb,$A,$Bd,$_d,$Ad,$Sd,$Jd){if($_POST["drop"])query_redirect($Eb,$A,$Bd);elseif($Sd=="")query_redirect($jb,$A,$Ad);elseif($Sd!=$Jd){$lb=queries($jb);queries_redirect($A,$_d,$lb&&queries($Eb));if($lb)queries($Fb);}else
- queries_redirect($A,$_d,queries($Xf)&&queries($Gb)&&queries($Eb)&&queries($jb));}function
- create_trigger($Vd,$L){global$x;$cg=" $L[Timing] $L[Event]".($L["Event"]=="UPDATE OF"?" ".idf_escape($L["Of"]):"");return"CREATE TRIGGER ".idf_escape($L["Trigger"]).($x=="mssql"?$Vd.$cg:$cg.$Vd).rtrim(" $L[Type]\n$L[Statement]",";").";";}function
- create_routine($if,$L){global$Oc;$P=array();$l=(array)$L["fields"];ksort($l);foreach($l
- as$k){if($k["field"]!="")$P[]=(preg_match("~^($Oc)\$~",$k["inout"])?"$k[inout] ":"").idf_escape($k["field"]).process_type($k,"CHARACTER SET");}return"CREATE $if ".idf_escape(trim($L["name"]))." (".implode(", ",$P).")".(isset($_GET["function"])?" RETURNS".process_type($L["returns"],"CHARACTER SET"):"").($L["language"]?" LANGUAGE $L[language]":"").rtrim("\n$L[definition]",";").";";}function
- remove_definer($I){return
- preg_replace('~^([A-Z =]+) DEFINER=`'.preg_replace('~@(.*)~','`@`(%|\\1)',logged_user()).'`~','\\1',$I);}function
- format_foreign_key($m){global$Wd;return" FOREIGN KEY (".implode(", ",array_map('idf_escape',$m["source"])).") REFERENCES ".table($m["table"])." (".implode(", ",array_map('idf_escape',$m["target"])).")".(preg_match("~^($Wd)\$~",$m["on_delete"])?" ON DELETE $m[on_delete]":"").(preg_match("~^($Wd)\$~",$m["on_update"])?" ON UPDATE $m[on_update]":"");}function
- tar_file($mc,$hg){$K=pack("a100a8a8a8a12a12",$mc,644,0,0,decoct($hg->size),decoct(time()));$Oa=8*32;for($s=0;$s<strlen($K);$s++)$Oa+=ord($K[$s]);$K.=sprintf("%06o",$Oa)."\0 ";echo$K,str_repeat("\0",512-strlen($K));$hg->send();echo
- str_repeat("\0",511-($hg->size+511)%512);}function
- ini_bytes($Nc){$X=ini_get($Nc);switch(strtolower(substr($X,-1))){case'g':$X*=1024;case'm':$X*=1024;case'k':$X*=1024;}return$X;}function
- doc_link($xe){global$x,$e;$Bg=array('sql'=>"http://dev.mysql.com/doc/refman/".substr($e->server_info,0,3)."/en/",'sqlite'=>"http://www.sqlite.org/",'pgsql'=>"http://www.postgresql.org/docs/".substr($e->server_info,0,3)."/static/",'mssql'=>"http://msdn.microsoft.com/library/",'oracle'=>"http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",);return($xe[$x]?"<a href='$Bg[$x]$xe[$x]' target='_blank' rel='noreferrer'><sup>?</sup></a>":"");}function
- ob_gzencode($Ff){return
- gzencode($Ff);}function
- db_size($h){global$e;if(!$e->select_db($h))return"?";$K=0;foreach(table_status()as$R)$K+=$R["Data_length"]+$R["Index_length"];return
- format_number($K);}function
- connect_error(){global$b,$e,$T,$j,$Db;if(DB!=""){header("HTTP/1.1 404 Not Found");page_header('Database'.": ".h(DB),'Invalid database.',true);}else{if($_POST["db"]&&!$j)queries_redirect(substr(ME,0,-1),'Databases have been dropped.',drop_databases($_POST["db"]));page_header('Select database',$j,false);echo"<p class='links'>\n";foreach(array('database'=>'Create new database','privileges'=>'Privileges','processlist'=>'Process list','variables'=>'Variables','status'=>'Status',)as$y=>$X){if(support($y))echo"<a href='".h(ME)."$y='>$X</a>\n";}echo"<p>".sprintf('%s version: %s through PHP extension %s',$Db[DRIVER],"<b>".h($e->server_info)."</b>","<b>$e->extension</b>")."\n","<p>".sprintf('Logged as: %s',"<b>".h(logged_user())."</b>")."\n";$g=$b->databases();if($g){$of=support("scheme");$Wa=collations();echo"<form action='' method='post'>\n","<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n","<thead><tr>".(support("database")?"<td> ":"")."<th>".'Database'." - <a href='".h(ME)."refresh=1'>".'Refresh'."</a>"."<td>".'Collation'."<td>".'Tables'."<td>".'Size'." - <a href='".h(ME)."dbsize=1' onclick=\"return !ajaxSetHtml('".js_escape(ME)."script=connect');\">".'Compute'."</a>"."</thead>\n";$g=($_GET["dbsize"]?count_tables($g):array_flip($g));foreach($g
- as$h=>$S){$hf=h(ME)."db=".urlencode($h);echo"<tr".odd().">".(support("database")?"<td>".checkbox("db[]",$h,in_array($h,(array)$_POST["db"])):""),"<th><a href='$hf'>".h($h)."</a>";$Va=nbsp(db_collation($h,$Wa));echo"<td>".(support("database")?"<a href='$hf".($of?"&ns=":"")."&database=' title='".'Alter database'."'>$Va</a>":$Va),"<td align='right'><a href='$hf&schema=' id='tables-".h($h)."' title='".'Database schema'."'>".($_GET["dbsize"]?$S:"?")."</a>","<td align='right' id='size-".h($h)."'>".($_GET["dbsize"]?db_size($h):"?"),"\n";}echo"</table>\n",(support("database")?"<fieldset><legend>".'Selected'." <span id='selected'></span></legend><div>\n"."<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n"."<input type='submit' name='drop' value='".'Drop'."'".confirm().">\n"."</div></fieldset>\n":""),"<script type='text/javascript'>tableCheck();</script>\n","<input type='hidden' name='token' value='$T'>\n","</form>\n";}}page_footer("db");}if(isset($_GET["status"]))$_GET["variables"]=$_GET["status"];if(isset($_GET["import"]))$_GET["sql"]=$_GET["import"];if(!(DB!=""?$e->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;}$Wd="RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT";class
- TmpFile{var$handler;var$size;function
- TmpFile(){$this->handler=tmpfile();}function
- write($fb){$this->size+=strlen($fb);fwrite($this->handler,$fb);}function
- send(){fseek($this->handler,0);fpassthru($this->handler);fclose($this->handler);}}$Ub="'(?:''|[^'\\\\]|\\\\.)*'";$Oc="IN|OUT|INOUT";if(isset($_GET["select"])&&((isset($_POST["edit"])?$_POST["edit"]:null)||(isset($_POST["clone"])?$_POST["clone"]:null))&&!$_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"];$l=fields($a);header("Content-Type: application/octet-stream");header("Content-Disposition: attachment; filename=".friendly_url("$a-".implode("_",$_GET["where"])).".".friendly_url($_GET["field"]));$N=array(idf_escape($_GET["field"]));$J=$i->select($a,$N,array(where($_GET,$l)),$N);$L=($J?$J->fetch_row():array());echo$L[0];exit;}elseif(isset($_GET["table"])){$a=$_GET["table"];$l=fields($a);if(!$l)$j=error();$R=table_status1($a,true);page_header(($l&&is_view($R)?'View':'Table').": ".h($a),$j);$b->selectLinks($R);$ab=$R["Comment"];if($ab!="")echo"<p>".'Comment'.": ".h($ab)."\n";if($l){echo"<table cellspacing='0'>\n","<thead><tr><th>".'Column'."<td>".'Type'.(support("comment")?"<td>".'Comment':"")."</thead>\n";foreach($l
- as$k){echo"<tr".odd()."><th>".h($k["field"]),"<td title='".h($k["collation"])."'>".h($k["full_type"]).($k["null"]?" <i>NULL</i>":"").($k["auto_increment"]?" <i>".'Auto Increment'."</i>":""),(isset($k["default"])?" [<b>".h($k["default"])."</b>]":""),(support("comment")?"<td>".nbsp($k["comment"]):""),"\n";}echo"</table>\n";}if(!is_view($R)){if(support("indexes")){echo"<h3 id='indexes'>".'Indexes'."</h3>\n";$v=indexes($a);if($v){echo"<table cellspacing='0'>\n";foreach($v
- as$E=>$u){ksort($u["columns"]);$Ie=array();foreach($u["columns"]as$y=>$X)$Ie[]="<i>".h($X)."</i>".($u["lengths"][$y]?"(".$u["lengths"][$y].")":"").($u["descs"][$y]?" DESC":"");echo"<tr title='".h($E)."'><th>$u[type]<td>".implode(", ",$Ie)."\n";}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'indexes='.urlencode($a).'">'.'Alter indexes'."</a>\n";}if(fk_support($R)){echo"<h3 id='foreign-keys'>".'Foreign keys'."</h3>\n";$n=foreign_keys($a);if($n){echo"<table cellspacing='0'>\n","<thead><tr><th>".'Source'."<td>".'Target'."<td>".'ON DELETE'."<td>".'ON UPDATE'."<td> </thead>\n";foreach($n
- as$E=>$m){echo"<tr title='".h($E)."'>","<th><i>".implode("</i>, <i>",array_map('h',$m["source"]))."</i>","<td><a href='".h($m["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($m["db"]),ME):($m["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($m["ns"]),ME):ME))."table=".urlencode($m["table"])."'>".($m["db"]!=""?"<b>".h($m["db"])."</b>.":"").($m["ns"]!=""?"<b>".h($m["ns"])."</b>.":"").h($m["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$m["target"]))."</i>)","<td>".nbsp($m["on_delete"])."\n","<td>".nbsp($m["on_update"])."\n",'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($E)).'">'.'Alter'.'</a>';}echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'foreign='.urlencode($a).'">'.'Add foreign key'."</a>\n";}}if(support(is_view($R)?"view_trigger":"trigger")){echo"<h3 id='triggers'>".'Triggers'."</h3>\n";$pg=triggers($a);if($pg){echo"<table cellspacing='0'>\n";foreach($pg
- as$y=>$X)echo"<tr valign='top'><td>".h($X[0])."<td>".h($X[1])."<th>".h($y)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($y))."'>".'Alter'."</a>\n";echo"</table>\n";}echo'<p class="links"><a href="'.h(ME).'trigger='.urlencode($a).'">'.'Add trigger'."</a>\n";}}elseif(isset($_GET["schema"])){page_header('Database schema',"",array(),h(DB.($_GET["ns"]?".$_GET[ns]":"")));$Pf=array();$Qf=array();$E="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$E-".DB]?"$E-".DB:$E)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$sd,PREG_SET_ORDER);foreach($sd
- as$s=>$B){$Pf[$B[1]]=array($B[2],$B[3]);$Qf[]="\n\t'".js_escape($B[1])."': [ $B[2], $B[3] ]";}$jg=0;$Ca=-1;$nf=array();$Ye=array();$jd=array();foreach(table_status('',true)as$Q=>$R){if(is_view($R))continue;$Be=0;$nf[$Q]["fields"]=array();foreach(fields($Q)as$E=>$k){$Be+=1.25;$k["pos"]=$Be;$nf[$Q]["fields"][$E]=$k;}$nf[$Q]["pos"]=($Pf[$Q]?$Pf[$Q]:array($jg,0));foreach($b->foreignKeys($Q)as$X){if(!$X["db"]){$hd=$Ca;if($Pf[$Q][1]||$Pf[$X["table"]][1])$hd=min(floatval($Pf[$Q][1]),floatval($Pf[$X["table"]][1]))-1;else$Ca-=.1;while($jd[(string)$hd])$hd-=.0001;$nf[$Q]["references"][$X["table"]][(string)$hd]=array($X["source"],$X["target"]);$Ye[$X["table"]][$Q][(string)$hd]=$X["target"];$jd[(string)$hd]=true;}}$jg=max($jg,$nf[$Q]["pos"][0]+2.5+$Be);}echo'<div id="schema" style="height: ',$jg,'em;" onselectstart="return false;">
- <script type="text/javascript">
- var tablePos = {',implode(",",$Qf)."\n",'};
- var em = document.getElementById(\'schema\').offsetHeight / ',$jg,';
- document.onmousemove = schemaMousemove;
- document.onmouseup = function (ev) {
- schemaMouseup(ev, \'',js_escape(DB),'\');
- };
- </script>
- ';foreach($nf
- as$E=>$Q){echo"<div class='table' style='top: ".$Q["pos"][0]."em; left: ".$Q["pos"][1]."em;' onmousedown='schemaMousedown(this, event);'>",'<a href="'.h(ME).'table='.urlencode($E).'"><b>'.h($E)."</b></a>";foreach($Q["fields"]as$k){$X='<span'.type_class($k["type"]).' title="'.h($k["full_type"].($k["null"]?" NULL":'')).'">'.h($k["field"]).'</span>';echo"<br>".($k["primary"]?"<i>$X</i>":$X);}foreach((array)$Q["references"]as$Vf=>$Ze){foreach($Ze
- as$hd=>$Ve){$id=$hd-$Pf[$E][1];$s=0;foreach($Ve[0]as$zf)echo"\n<div class='references' title='".h($Vf)."' id='refs$hd-".($s++)."' style='left: $id"."em; top: ".$Q["fields"][$zf]["pos"]."em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: ".(-$id)."em;'></div></div>";}}foreach((array)$Ye[$E]as$Vf=>$Ze){foreach($Ze
- as$hd=>$d){$id=$hd-$Pf[$E][1];$s=0;foreach($d
- as$Uf)echo"\n<div class='references' title='".h($Vf)."' id='refd$hd-".($s++)."' style='left: $id"."em; top: ".$Q["fields"][$Uf]["pos"]."em; height: 1.25em; background: url(".h(preg_replace("~\\?.*~","",ME))."?file=arrow.gif) no-repeat right center;&version=4.1.0&driver=mysql'><div style='height: .5em; border-bottom: 1px solid Gray; width: ".(-$id)."em;'></div></div>";}}echo"\n</div>\n";}foreach($nf
- as$E=>$Q){foreach((array)$Q["references"]as$Vf=>$Ze){foreach($Ze
- as$hd=>$Ve){$Dd=$jg;$wd=-10;foreach($Ve[0]as$y=>$zf){$Ce=$Q["pos"][0]+$Q["fields"][$zf]["pos"];$De=$nf[$Vf]["pos"][0]+$nf[$Vf]["fields"][$Ve[1][$y]]["pos"];$Dd=min($Dd,$Ce,$De);$wd=max($wd,$Ce,$De);}echo"<div class='references' id='refl$hd' style='left: $hd"."em; top: $Dd"."em; padding: .5em 0;'><div style='border-right: 1px solid Gray; margin-top: 1px; height: ".($wd-$Dd)."em;'></div></div>\n";}}}echo'</div>
- <p class="links"><a href="',h(ME."schema=".urlencode($ea)),'" id="schema-link">Permanent link</a>
- ';}elseif(isset($_GET["dump"])){$a=$_GET["dump"];if($_POST&&!$j){$ib="";foreach(array("output","format","db_style","routines","events","table_style","auto_increment","triggers","data_style")as$y)$ib.="&$y=".urlencode($_POST[$y]);cookie("adminer_export",substr($ib,1));$S=array_flip((array)$_POST["tables"])+array_flip((array)$_POST["data"]);$fc=dump_headers((count($S)==1?key($S):DB),(DB==""||count($S)>1));$Wc=preg_match('~sql~',$_POST["format"]);if($Wc){echo"-- Adminer $ga ".$Db[DRIVER]." dump\n\n";if($x=="sql"){echo"SET NAMES utf8;
- SET time_zone = '+00:00';
- ".($_POST["data_style"]?"SET foreign_key_checks = 0;
- SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
- ":"")."
- ";$e->query("SET time_zone = '+00:00';");}}$Hf=$_POST["db_style"];$g=array(DB);if(DB==""){$g=$_POST["databases"];if(is_string($g))$g=explode("\n",rtrim(str_replace("\r","",$g),"\n"));}foreach((array)$g
- as$h){$b->dumpDatabase($h);if($e->select_db($h)){if($Wc&&preg_match('~CREATE~',$Hf)&&($jb=$e->result("SHOW CREATE DATABASE ".idf_escape($h),1))){if($Hf=="DROP+CREATE")echo"DROP DATABASE IF EXISTS ".idf_escape($h).";\n";echo"$jb;\n";}if($Wc){if($Hf)echo
- use_sql($h).";\n\n";$me="";if($_POST["routines"]){foreach(array("FUNCTION","PROCEDURE")as$if){foreach(get_rows("SHOW $if STATUS WHERE Db = ".q($h),null,"-- ")as$L)$me.=($Hf!='DROP+CREATE'?"DROP $if IF EXISTS ".idf_escape($L["Name"]).";;\n":"").remove_definer($e->result("SHOW CREATE $if ".idf_escape($L["Name"]),2)).";;\n\n";}}if($_POST["events"]){foreach(get_rows("SHOW EVENTS",null,"-- ")as$L)$me.=($Hf!='DROP+CREATE'?"DROP EVENT IF EXISTS ".idf_escape($L["Name"]).";;\n":"").remove_definer($e->result("SHOW CREATE EVENT ".idf_escape($L["Name"]),3)).";;\n\n";}if($me)echo"DELIMITER ;;\n\n$me"."DELIMITER ;\n\n";}if($_POST["table_style"]||$_POST["data_style"]){$Kg=array();foreach(table_status('',true)as$E=>$R){$Q=(DB==""||in_array($E,(array)$_POST["tables"]));$ob=(DB==""||in_array($E,(array)$_POST["data"]));if($Q||$ob){if($fc=="tar"){$hg=new
- TmpFile;ob_start(array($hg,'write'),1e5);}$b->dumpTable($E,($Q?$_POST["table_style"]:""),(is_view($R)?2:0));if(is_view($R))$Kg[]=$E;elseif($ob){$l=fields($E);$b->dumpData($E,$_POST["data_style"],"SELECT *".convert_fields($l,$l)." FROM ".table($E));}if($Wc&&$_POST["triggers"]&&$Q&&($pg=trigger_sql($E,$_POST["table_style"])))echo"\nDELIMITER ;;\n$pg\nDELIMITER ;\n";if($fc=="tar"){ob_end_flush();tar_file((DB!=""?"":"$h/")."$E.csv",$hg);}elseif($Wc)echo"\n";}}foreach($Kg
- as$Jg)$b->dumpTable($Jg,$_POST["table_style"],1);if($fc=="tar")echo
- pack("x512");}}}if($Wc)echo"-- ".$e->result("SELECT NOW()")."\n";exit;}page_header('Export',$j,($_GET["export"]!=""?array("table"=>$_GET["export"]):array()),h(DB));echo'
- <form action="" method="post">
- <table cellspacing="0">
- ';$sb=array('','USE','DROP+CREATE','CREATE');$Rf=array('','DROP+CREATE','CREATE');$pb=array('','TRUNCATE+INSERT','INSERT');if($x=="sql")$pb[]='INSERT+UPDATE';parse_str($_COOKIE["adminer_export"],$L);if(!$L)$L=array("output"=>"text","format"=>"sql","db_style"=>(DB!=""?"":"CREATE"),"table_style"=>"DROP+CREATE","data_style"=>"INSERT");if(!isset($L["events"])){$L["routines"]=$L["events"]=($_GET["dump"]=="");$L["triggers"]=$L["table_style"];}echo"<tr><th>".'Output'."<td>".html_select("output",$b->dumpOutput(),$L["output"],0)."\n";echo"<tr><th>".'Format'."<td>".html_select("format",$b->dumpFormat(),$L["format"],0)."\n";echo($x=="sqlite"?"":"<tr><th>".'Database'."<td>".html_select('db_style',$sb,$L["db_style"]).(support("routine")?checkbox("routines",1,$L["routines"],'Routines'):"").(support("event")?checkbox("events",1,$L["events"],'Events'):"")),"<tr><th>".'Tables'."<td>".html_select('table_style',$Rf,$L["table_style"]).checkbox("auto_increment",1,$L["auto_increment"],'Auto Increment').(support("trigger")?checkbox("triggers",1,$L["triggers"],'Triggers'):""),"<tr><th>".'Data'."<td>".html_select('data_style',$pb,$L["data_style"]),'</table>
- <p><input type="submit" value="Export">
- <input type="hidden" name="token" value="',$T,'">
- <table cellspacing="0">
- ';$Ge=array();if(DB!=""){$Ma=($a!=""?"":" checked");echo"<thead><tr>","<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$Ma onclick='formCheck(this, /^tables\\[/);'>".'Tables'."</label>","<th style='text-align: right;'><label class='block'>".'Data'."<input type='checkbox' id='check-data'$Ma onclick='formCheck(this, /^data\\[/);'></label>","</thead>\n";$Kg="";$Sf=tables_list();foreach($Sf
- as$E=>$U){$Fe=preg_replace('~_.*~','',$E);$Ma=($a==""||$a==(substr($a,-1)=="%"?"$Fe%":$E));$Ie="<tr><td>".checkbox("tables[]",$E,$Ma,$E,"checkboxClick(event, this); formUncheck('check-tables');","block");if($U!==null&&!preg_match('~table~i',$U))$Kg.="$Ie\n";else
- echo"$Ie<td align='right'><label class='block'><span id='Rows-".h($E)."'></span>".checkbox("data[]",$E,$Ma,"","checkboxClick(event, this); formUncheck('check-data');")."</label>\n";$Ge[$Fe]++;}echo$Kg;if($Sf)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}else{echo"<thead><tr><th style='text-align: left;'><label class='block'><input type='checkbox' id='check-databases'".($a==""?" checked":"")." onclick='formCheck(this, /^databases\\[/);'>".'Database'."</label></thead>\n";$g=$b->databases();if($g){foreach($g
- as$h){if(!information_schema($h)){$Fe=preg_replace('~_.*~','',$h);echo"<tr><td>".checkbox("databases[]",$h,$a==""||$a=="$Fe%",$h,"formUncheck('check-databases');","block")."\n";$Ge[$Fe]++;}}}else
- echo"<tr><td><textarea name='databases' rows='10' cols='20'></textarea>";}echo'</table>
- </form>
- ';$oc=true;foreach($Ge
- as$y=>$X){if($y!=""&&$X>1){echo($oc?"<p>":" ")."<a href='".h(ME)."dump=".urlencode("$y%")."'>".h($y)."</a>";$oc=false;}}}elseif(isset($_GET["privileges"])){page_header('Privileges');$J=$e->query("SELECT User, Host FROM mysql.".(DB==""?"user":"db WHERE ".q(DB)." LIKE Db")." ORDER BY Host, User");$q=$J;if(!$J)$J=$e->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",($q?"":"<input type='hidden' name='grant' value=''>\n"),"<table cellspacing='0'>\n","<thead><tr><th>".'Username'."<th>".'Server'."<th> </thead>\n";while($L=$J->fetch_assoc())echo'<tr'.odd().'><td>'.h($L["User"])."<td>".h($L["Host"]).'<td><a href="'.h(ME.'user='.urlencode($L["User"]).'&host='.urlencode($L["Host"])).'">'.'Edit'."</a>\n";if(!$q||DB!="")echo"<tr".odd()."><td><input name='user' autocapitalize='off'><td><input name='host' value='localhost' autocapitalize='off'><td><input type='submit' value='".'Edit'."'>\n";echo"</table>\n","</form>\n",'<p class="links"><a href="'.h(ME).'user=">'.'Create user'."</a>";}elseif(isset($_GET["sql"])){if(!$j&&$_POST["export"]){dump_headers("sql");$b->dumpTable("","");$b->dumpData("","table",$_POST["query"]);exit;}restart_session();$Fc=&get_session("queries");$Ec=&$Fc[DB];if(!$j&&$_POST["clear"]){$Ec=array();redirect(remove_from_uri("history"));}page_header((isset($_GET["import"])?'Import':'SQL command'),$j);if(!$j&&$_POST){$o=false;if(!isset($_GET["import"]))$I=$_POST["query"];elseif($_POST["webfile"]){$o=@fopen((file_exists("adminer.sql")?"adminer.sql":"compress.zlib://adminer.sql.gz"),"rb");$I=($o?fread($o,1e6):false);}else$I=get_file("sql_file",true);if(is_string($I)){if(function_exists('memory_get_usage'))@ini_set("memory_limit",max(ini_bytes("memory_limit"),2*strlen($I)+memory_get_usage()+8e6));if($I!=""&&strlen($I)<1e6){$H=$I.(preg_match("~;[ \t\r\n]*\$~",$I)?"":";");if(!$Ec||reset(end($Ec))!=$H){restart_session();$Ec[]=array($H,time());set_session("queries",$Fc);stop_session();}}$_f="(?:\\s|/\\*.*\\*/|(?:#|-- )[^\n]*\n|--\r?\n)";$wb=";";$Pd=0;$Rb=true;$f=connect();if(is_object($f)&&DB!="")$f->select_db(DB);$Za=0;$Wb=array();$od=0;$re='[\'"'.($x=="sql"?'`#':($x=="sqlite"?'`[':($x=="mssql"?'[':''))).']|/\\*|-- |$'.($x=="pgsql"?'|\\$[^$]*\\$':'');$kg=microtime(true);parse_str($_COOKIE["adminer_export"],$la);$Ib=$b->dumpFormat();unset($Ib["sql"]);while($I!=""){if(!$Pd&&preg_match("~^$_f*DELIMITER\\s+(\\S+)~i",$I,$B)){$wb=$B[1];$I=substr($I,strlen($B[0]));}else{preg_match('('.preg_quote($wb)."\\s*|$re)",$I,$B,PREG_OFFSET_CAPTURE,$Pd);list($tc,$Be)=$B[0];if(!$tc&&$o&&!feof($o))$I.=fread($o,1e5);else{if(!$tc&&rtrim($I)=="")break;$Pd=$Be+strlen($tc);if($tc&&rtrim($tc)!=$wb){while(preg_match('('.($tc=='/*'?'\\*/':($tc=='['?']':(preg_match('~^-- |^#~',$tc)?"\n":preg_quote($tc)."|\\\\."))).'|$)s',$I,$B,PREG_OFFSET_CAPTURE,$Pd)){$lf=$B[0][0];if(!$lf&&$o&&!feof($o))$I.=fread($o,1e5);else{$Pd=$B[0][1]+strlen($lf);if($lf[0]!="\\")break;}}}else{$Rb=false;$H=substr($I,0,$Be);$Za++;$Ie="<pre id='sql-$Za'><code class='jush-$x'>".shorten_utf8(trim($H),1000)."</code></pre>\n";if(!$_POST["only_errors"]){echo$Ie;ob_flush();flush();}$Bf=microtime(true);if($e->multi_query($H)&&is_object($f)&&preg_match("~^$_f*USE\\b~isU",$H))$f->query($H);do{$J=$e->store_result();$ag=" <span class='time'>(".format_time($Bf).")</span>".(strlen($H)<1000?" <a href='".h(ME)."sql=".urlencode(trim($H))."'>".'Edit'."</a>":"");if($e->error){echo($_POST["only_errors"]?$Ie:""),"<p class='error'>".'Error in query'.($e->errno?" ($e->errno)":"").": ".error()."\n";$Wb[]=" <a href='#sql-$Za'>$Za</a>";if($_POST["error_stops"])break
- 2;}elseif(is_object($J)){$he=select($J,$f);if(!$_POST["only_errors"]){echo"<form action='' method='post'>\n","<p>".($J->num_rows?lang(array('%d row','%d rows'),$J->num_rows):"").$ag;$t="export-$Za";$ec=", <a href='#$t' onclick=\"return !toggle('$t');\">".'Export'."</a><span id='$t' class='hidden'>: ".html_select("output",$b->dumpOutput(),$la["output"])." ".html_select("format",$Ib,$la["format"])."<input type='hidden' name='query' value='".h($H)."'>"." <input type='submit' name='export' value='".'Export'."'><input type='hidden' name='token' value='$T'></span>\n";if($f&&preg_match("~^($_f|\\()*SELECT\\b~isU",$H)&&($dc=explain($f,$H))){$t="explain-$Za";echo", <a href='#$t' onclick=\"return !toggle('$t');\">EXPLAIN</a>$ec","<div id='$t' class='hidden'>\n";select($dc,$f,$he);echo"</div>\n";}else
- echo$ec;echo"</form>\n";}}else{if(preg_match("~^$_f*(CREATE|DROP|ALTER)$_f+(DATABASE|SCHEMA)\\b~isU",$H)){restart_session();set_session("dbs",null);stop_session();}if(!$_POST["only_errors"])echo"<p class='message' title='".h($e->info)."'>".lang(array('Query executed OK, %d row affected.','Query executed OK, %d rows affected.'),$e->affected_rows)."$ag\n";}$Bf=microtime(true);}while($e->next_result());$od+=substr_count($H.$tc,"\n");$I=substr($I,$Pd);$Pd=0;}}}}if($Rb)echo"<p class='message'>".'No commands to execute.'."\n";elseif($_POST["only_errors"]){echo"<p class='message'>".lang(array('%d query executed OK.','%d queries executed OK.'),$Za-count($Wb))," <span class='time'>(".format_time($kg).")</span>\n";}elseif($Wb&&$Za>1)echo"<p class='error'>".'Error in query'.": ".implode("",$Wb)."\n";}else
- echo"<p class='error'>".upload_error($I)."\n";}echo'
- <form action="" method="post" enctype="multipart/form-data" id="form">
- ';$bc="<input type='submit' value='".'Execute'."' title='Ctrl+Enter'>";if(!isset($_GET["import"])){$H=$_GET["sql"];if($_POST)$H=$_POST["query"];elseif($_GET["history"]=="all")$H=$Ec;elseif($_GET["history"]!="")$H=$Ec[$_GET["history"]][0];echo"<p>";textarea("query",$H,20);echo($_POST?"":"<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n"),"<p>$bc\n";}else{echo"<fieldset><legend>".'File upload'."</legend><div>",(ini_bool("file_uploads")?'<input type="file" name="sql_file[]" multiple> (< '.ini_get("upload_max_filesize").'B)':'File uploads are disabled.'),"\n$bc","</div></fieldset>\n","<fieldset><legend>".'From server'."</legend><div>",sprintf('Webserver file %s',"<code>adminer.sql".(extension_loaded("zlib")?"[.gz]":"")."</code>"),' <input type="submit" name="webfile" value="'.'Run file'.'">',"</div></fieldset>\n","<p>";}echo
- checkbox("error_stops",1,($_POST?$_POST["error_stops"]:isset($_GET["import"])),'Stop on error')."\n",checkbox("only_errors",1,($_POST?$_POST["only_errors"]:isset($_GET["import"])),'Show only errors')."\n","<input type='hidden' name='token' value='$T'>\n";if(!isset($_GET["import"])&&$Ec){print_fieldset("history",'History',$_GET["history"]!="");for($X=end($Ec);$X;$X=prev($Ec)){$y=key($Ec);list($H,$ag,$Mb)=$X;echo'<a href="'.h(ME."sql=&history=$y").'">'.'Edit'."</a>"." <span class='time' title='".@date('Y-m-d',$ag)."'>".@date("H:i:s",$ag)."</span>"." <code class='jush-$x'>".shorten_utf8(ltrim(str_replace("\n"," ",str_replace("\r","",preg_replace('~^(#|-- ).*~m','',$H)))),80,"</code>").($Mb?" <span class='time'>($Mb)</span>":"")."<br>\n";}echo"<input type='submit' name='clear' value='".'Clear'."'>\n","<a href='".h(ME."sql=&history=all")."'>".'Edit all'."</a>\n","</div></fieldset>\n";}echo'</form>
- ';}elseif(isset($_GET["edit"])){$a=$_GET["edit"];$l=fields($a);$Z=(isset($_GET["select"])?(count($_POST["check"])==1?where_check($_POST["check"][0],$l):""):where($_GET,$l));$_g=(isset($_GET["select"])?$_POST["edit"]:$Z);foreach($l
- as$E=>$k){if(!isset($k["privileges"][$_g?"update":"insert"])||$b->fieldName($k)=="")unset($l[$E]);}if($_POST&&!$j&&!isset($_GET["select"])){$A=$_POST["referer"];if($_POST["insert"])$A=($_g?null:$_SERVER["REQUEST_URI"]);elseif(!preg_match('~^.+&select=.+$~',$A))$A=ME."select=".urlencode($a);$v=indexes($a);$vg=unique_array($_GET["where"],$v);$Re="\nWHERE $Z";if(isset($_POST["delete"]))queries_redirect($A,'Item has been deleted.',$i->delete($a,$Re,!$vg));else{$P=array();foreach($l
- as$E=>$k){$X=process_input($k);if($X!==false&&$X!==null)$P[idf_escape($E)]=$X;}if($_g){if(!$P)redirect($A);queries_redirect($A,'Item has been updated.',$i->update($a,$P,$Re,!$vg));if(is_ajax()){page_headers();page_messages($j);exit;}}else{$J=$i->insert($a,$P);$gd=($J?last_id():0);queries_redirect($A,sprintf('Item%s has been inserted.',($gd?" $gd":"")),$J);}}}$L=null;if($_POST["save"])$L=(array)$_POST["fields"];elseif($Z){$N=array();foreach($l
- as$E=>$k){if(isset($k["privileges"]["select"])){$ua=convert_field($k);if(!empty($_POST["clone"])&&!empty($k["auto_increment"]))$ua="''";if($x=="sql"&&preg_match("~enum|set~",$k["type"]))$ua="1*".idf_escape($E);$N[]=($ua?"$ua AS ":"").idf_escape($E);}}$L=array();if(!support("table"))$N=array("*");if($N){$J=$i->select($a,$N,array($Z),$N,array(),(isset($_GET["select"])?2:1));$L=$J->fetch_assoc();if(!$L)$L=false;if(isset($_GET["select"])&&(!$L||$J->fetch_assoc()))$L=null;}}if(!support("table")&&!$l){if(!$Z){$J=$i->select($a,array("*"),$Z,array("*"));$L=($J?$J->fetch_assoc():false);if(!$L)$L=array($i->primary=>"");}if($L){foreach($L
- as$y=>$X){if(!$Z)$L[$y]=null;$l[$y]=array("field"=>$y,"null"=>($y!=$i->primary),"auto_increment"=>($y==$i->primary));}}}edit_form($a,$l,$L,$_g);}elseif(isset($_GET["create"])){$a=$_GET["create"];$se=array();foreach(array('HASH','LINEAR HASH','KEY','LINEAR KEY','RANGE','LIST')as$y)$se[$y]=$y;$Xe=referencable_primary($a);$n=array();foreach($Xe
- as$Of=>$k)$n[str_replace("`","``",$Of)."`".str_replace("`","``",$k["field"])]=$Of;$ke=array();$R=array();if($a!=""){$ke=fields($a);$R=table_status($a);if(!$R)$j='No tables.';}$L=$_POST;$L["fields"]=(array)$L["fields"];if($L["auto_increment_col"])$L["fields"][$L["auto_increment_col"]]["auto_increment"]=true;if($_POST&&!process_fields($L["fields"])&&!$j){if($_POST["drop"])queries_redirect(substr(ME,0,-1),'Table has been dropped.',drop_tables(array($a)));else{$l=array();$ra=array();$Cg=false;$qc=array();ksort($L["fields"]);$je=reset($ke);$pa=" FIRST";foreach($L["fields"]as$y=>$k){$m=$n[$k["type"]];$qg=($m!==null?$Xe[$m]:$k);if($k["field"]!=""){if(!$k["has_default"])$k["default"]=null;if($y==$L["auto_increment_col"])$k["auto_increment"]=true;$Ne=process_field($k,$qg);$ra[]=array($k["orig"],$Ne,$pa);if($Ne!=process_field($je,$je)){$l[]=array($k["orig"],$Ne,$pa);if($k["orig"]!=""||$pa)$Cg=true;}if($m!==null)$qc[idf_escape($k["field"])]=($a!=""&&$x!="sqlite"?"ADD":" ").format_foreign_key(array('table'=>$n[$k["type"]],'source'=>array($k["field"]),'target'=>array($qg["field"]),'on_delete'=>$k["on_delete"],));$pa=" AFTER ".idf_escape($k["field"]);}elseif($k["orig"]!=""){$Cg=true;$l[]=array($k["orig"]);}if($k["orig"]!=""){$je=next($ke);if(!$je)$pa="";}}$ue="";if($se[$L["partition_by"]]){$ve=array();if($L["partition_by"]=='RANGE'||$L["partition_by"]=='LIST'){foreach(array_filter($L["partition_names"])as$y=>$X){$Y=$L["partition_values"][$y];$ve[]="\n PARTITION ".idf_escape($X)." VALUES ".($L["partition_by"]=='RANGE'?"LESS THAN":"IN").($Y!=""?" ($Y)":" MAXVALUE");}}$ue.="\nPARTITION BY $L[partition_by]($L[partition])".($ve?" (".implode(",",$ve)."\n)":($L["partitions"]?" PARTITIONS ".(+$L["partitions"]):""));}elseif(support("partitioning")&&preg_match("~partitioned~",$R["Create_options"]))$ue.="\nREMOVE PARTITIONING";$C='Table has been altered.';if($a==""){cookie("adminer_engine",$L["Engine"]);$C='Table has been created.';}$E=trim($L["name"]);queries_redirect(ME.(support("table")?"table=":"select=").urlencode($E),$C,alter_table($a,$E,($x=="sqlite"&&($Cg||$qc)?$ra:$l),$qc,$L["Comment"],($L["Engine"]&&$L["Engine"]!=$R["Engine"]?$L["Engine"]:""),($L["Collation"]&&$L["Collation"]!=$R["Collation"]?$L["Collation"]:""),($L["Auto_increment"]!=""?+$L["Auto_increment"]:""),$ue));}}page_header(($a!=""?'Alter table':'Create table'),$j,array("table"=>$a),h($a));if(!$_POST){$L=array("Engine"=>$_COOKIE["adminer_engine"],"fields"=>array(array("field"=>"","type"=>(isset($sg["int"])?"int":(isset($sg["integer"])?"integer":"")))),"partition_names"=>array(""),);if($a!=""){$L=$R;$L["name"]=$a;$L["fields"]=array();if(!$_GET["auto_increment"])$L["Auto_increment"]="";foreach($ke
- as$k){$k["has_default"]=isset($k["default"]);$L["fields"][]=$k;}if(support("partitioning")){$vc="FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = ".q(DB)." AND TABLE_NAME = ".q($a);$J=$e->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $vc ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");list($L["partition_by"],$L["partitions"],$L["partition"])=$J->fetch_row();$ve=get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $vc AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");$ve[""]="";$L["partition_names"]=array_keys($ve);$L["partition_values"]=array_values($ve);}}}$Wa=collations();$Tb=engines();foreach($Tb
- as$Sb){if(!strcasecmp($Sb,$L["Engine"])){$L["Engine"]=$Sb;break;}}echo'
- <form action="" method="post" id="form">
- <p>
- ';if(support("columns")||$a==""){echo'Table name: <input name="name" maxlength="64" value="',h($L["name"]),'" autocapitalize="off">
- ';if($a==""&&!$_POST){?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php }echo($Tb?"<select name='Engine' onchange='helpClose();'".on_help("getTarget(event).value",1).">".optionlist(array(""=>"(".'engine'.")")+$Tb,$L["Engine"])."</select>":""),' ',($Wa&&!preg_match("~sqlite|mssql~",$x)?html_select("Collation",array(""=>"(".'collation'.")")+$Wa,$L["Collation"]):""),' <input type="submit" value="Save">
- ';}echo'
- ';if(support("columns")){echo'<table cellspacing="0" id="edit-fields" class="nowrap">
- ';$bb=($_POST?$_POST["comments"]:$L["Comment"]!="");if(!$_POST&&!$bb){foreach($L["fields"]as$k){if($k["comment"]!=""){$bb=true;break;}}}edit_fields($L["fields"],$Wa,"TABLE",$n,$bb);echo'</table>
- <p>
- Auto Increment: <input type="number" name="Auto_increment" size="6" value="',h($L["Auto_increment"]),'">
- ',checkbox("defaults",1,true,'Default values',"columnShow(this.checked, 5)","jsonly");if(!$_POST["defaults"]){echo'<script type="text/javascript">editingHideDefaults()</script>';}echo(support("comment")?"<label><input type='checkbox' name='comments' value='1' class='jsonly' onclick=\"columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();\"".($bb?" checked":"").">".'Comment'."</label>".' <input name="Comment" id="Comment" value="'.h($L["Comment"]).'" maxlength="'.($e->server_info>=5.5?2048:60).'"'.($bb?'':' class="hidden"').'>':''),'<p>
- <input type="submit" value="Save">
- ';}echo'
- ';if($a!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}if(support("partitioning")){$te=preg_match('~RANGE|LIST~',$L["partition_by"]);print_fieldset("partition",'Partition by',$L["partition_by"]);echo'<p>
- ',"<select name='partition_by' onchange='partitionByChange(this);'".on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')",1).">".optionlist(array(""=>"")+$se,$L["partition_by"])."</select>",'(<input name="partition" value="',h($L["partition"]),'">)
- Partitions: <input type="number" name="partitions" class="size',($te||!$L["partition_by"]?" hidden":""),'" value="',h($L["partitions"]),'">
- <table cellspacing="0" id="partition-table"',($te?"":" class='hidden'"),'>
- <thead><tr><th>Partition name<th>Values</thead>
- ';foreach($L["partition_names"]as$y=>$X){echo'<tr>','<td><input name="partition_names[]" value="'.h($X).'"'.($y==count($L["partition_names"])-1?' onchange="partitionNameChange(this);"':'').' autocapitalize="off">','<td><input name="partition_values[]" value="'.h($L["partition_values"][$y]).'">';}echo'</table>
- </div></fieldset>
- ';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["indexes"])){$a=$_GET["indexes"];$Mc=array("PRIMARY","UNIQUE","INDEX");$R=table_status($a,true);if(preg_match('~MyISAM|M?aria'.($e->server_info>=5.6?'|InnoDB':'').'~i',$R["Engine"]))$Mc[]="FULLTEXT";$v=indexes($a);$He=array();if($x=="mongo"){$He=$v["_id_"];unset($Mc[0]);unset($v["_id_"]);}$L=$_POST;if($_POST&&!$j&&!$_POST["add"]&&!$_POST["drop_col"]){$sa=array();foreach($L["indexes"]as$u){$E=$u["name"];if(in_array($u["type"],$Mc)){$d=array();$md=array();$yb=array();$P=array();ksort($u["columns"]);foreach($u["columns"]as$y=>$c){if($c!=""){$ld=$u["lengths"][$y];$xb=$u["descs"][$y];$P[]=idf_escape($c).($ld?"(".(+$ld).")":"").($xb?" DESC":"");$d[]=$c;$md[]=($ld?$ld:null);$yb[]=$xb;}}if($d){$cc=$v[$E];if($cc){ksort($cc["columns"]);ksort($cc["lengths"]);ksort($cc["descs"]);if($u["type"]==$cc["type"]&&array_values($cc["columns"])===$d&&(!$cc["lengths"]||array_values($cc["lengths"])===$md)&&array_values($cc["descs"])===$yb){unset($v[$E]);continue;}}$sa[]=array($u["type"],$E,$P);}}}foreach($v
- as$E=>$cc)$sa[]=array($cc["type"],$E,"DROP");if(!$sa)redirect(ME."table=".urlencode($a));queries_redirect(ME."table=".urlencode($a),'Indexes have been altered.',alter_indexes($a,$sa));}page_header('Indexes',$j,array("table"=>$a),h($a));$l=array_keys(fields($a));if($_POST["add"]){foreach($L["indexes"]as$y=>$u){if($u["columns"][count($u["columns"])]!="")$L["indexes"][$y]["columns"][]="";}$u=end($L["indexes"]);if($u["type"]||array_filter($u["columns"],'strlen'))$L["indexes"][]=array("columns"=>array(1=>""));}if(!$L){foreach($v
- as$y=>$u){$v[$y]["name"]=$y;$v[$y]["columns"][]="";}$v[]=array("columns"=>array(1=>""));$L["indexes"]=$v;}?>
- <form action="" method="post">
- <table cellspacing="0" class="nowrap">
- <thead><tr>
- <th>Index Type
- <th><input type="submit" style="left: -1000px; position: absolute;">Column (length)
- <th>Name
- <th><noscript><input type='image' class='icon' name='add[0]' src='" . h(preg_replace("~\\?.*~", "", ME)) . "?file=plus.gif&version=4.1.0&driver=mysql' alt='+' title='Add next'></noscript>
- </thead>
- <?php
- if($He){echo"<tr><td>PRIMARY<td>";foreach($He["columns"]as$y=>$c){echo
- select_input(" disabled",$l,$c),"<label><input disabled type='checkbox'>".'descending'."</label> ";}echo"<td><td>\n";}$w=1;foreach($L["indexes"]as$u){if(!$_POST["drop_col"]||$w!=key($_POST["drop_col"])){echo"<tr><td>".html_select("indexes[$w][type]",array(-1=>"")+$Mc,$u["type"],($w==count($L["indexes"])?"indexesAddRow(this);":1)),"<td>";ksort($u["columns"]);$s=1;foreach($u["columns"]as$y=>$c){echo"<span>".select_input(" name='indexes[$w][columns][$s]' onchange=\"".($s==count($u["columns"])?"indexesAddColumn":"indexesChangeColumn")."(this, '".js_escape($x=="sql"?"":$_GET["indexes"]."_")."');\"",($l?array_combine($l,$l):$l),$c),($x=="sql"||$x=="mssql"?"<input type='number' name='indexes[$w][lengths][$s]' class='size' value='".h($u["lengths"][$y])."'>":""),($x!="sql"?checkbox("indexes[$w][descs][$s]",1,$u["descs"][$y],'descending'):"")," </span>";$s++;}echo"<td><input name='indexes[$w][name]' value='".h($u["name"])."' autocapitalize='off'>\n","<td><input type='image' class='icon' name='drop_col[$w]' src='".h(preg_replace("~\\?.*~","",ME))."?file=cross.gif&version=4.1.0&driver=mysql' alt='x' title='".'Remove'."' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n";}$w++;}echo'</table>
- <p>
- <input type="submit" value="Save">
- <input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["database"])){$L=$_POST;if($_POST&&!$j&&!isset($_POST["add_x"])){restart_session();$E=trim($L["name"]);if($_POST["drop"]){$_GET["db"]="";queries_redirect(remove_from_uri("db|database"),'Database has been dropped.',drop_databases(array(DB)));}elseif(DB!==$E){if(DB!=""){$_GET["db"]=$E;queries_redirect(preg_replace('~\bdb=[^&]*&~','',ME)."db=".urlencode($E),'Database has been renamed.',rename_database($E,$L["collation"]));}else{$g=explode("\n",str_replace("\r","",$E));$If=true;$fd="";foreach($g
- as$h){if(count($g)==1||$h!=""){if(!create_database($h,$L["collation"]))$If=false;$fd=$h;}}queries_redirect(ME."db=".urlencode($fd),'Database has been created.',$If);}}else{if(!$L["collation"])redirect(substr(ME,0,-1));query_redirect("ALTER DATABASE ".idf_escape($E).(preg_match('~^[a-z0-9_]+$~i',$L["collation"])?" COLLATE $L[collation]":""),substr(ME,0,-1),'Database has been altered.');}}page_header(DB!=""?'Alter database':'Create database',$j,array(),h(DB));$Wa=collations();$E=DB;if($_POST)$E=$L["name"];elseif(DB!="")$L["collation"]=db_collation(DB,$Wa);elseif($x=="sql"){foreach(get_vals("SHOW GRANTS")as$q){if(preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~',$q,$B)&&$B[1]){$E=stripcslashes(idf_unescape("`$B[2]`"));break;}}}echo'
- <form action="" method="post">
- <p>
- ',($_POST["add_x"]||strpos($E,"\n")?'<textarea id="name" name="name" rows="10" cols="40">'.h($E).'</textarea><br>':'<input name="name" id="name" value="'.h($E).'" maxlength="64" autocapitalize="off">')."\n".($Wa?html_select("collation",array(""=>"(".'collation'.")")+$Wa,$L["collation"]).doc_link(array('sql'=>"charset-charsets.html",'mssql'=>"ms187963.aspx",)):"");?>
- <script type='text/javascript'>focus(document.getElementById('name'));</script>
- <input type="submit" value="Save">
- <?php
- if(DB!="")echo"<input type='submit' name='drop' value='".'Drop'."'".confirm().">\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.1.0&driver=mysql' alt='+' title='".'Add next'."'>\n";echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["call"])){$da=$_GET["call"];page_header('Call'.": ".h($da),$j);$if=routine($da,(isset($_GET["callf"])?"FUNCTION":"PROCEDURE"));$Lc=array();$me=array();foreach($if["fields"]as$s=>$k){if(substr($k["inout"],-3)=="OUT")$me[$s]="@".idf_escape($k["field"])." AS ".idf_escape($k["field"]);if(!$k["inout"]||substr($k["inout"],0,2)=="IN")$Lc[]=$s;}if(!$j&&$_POST){$Ja=array();foreach($if["fields"]as$y=>$k){if(in_array($y,$Lc)){$X=process_input($k);if($X===false)$X="''";if(isset($me[$y]))$e->query("SET @".idf_escape($k["field"])." = $X");}$Ja[]=(isset($me[$y])?"@".idf_escape($k["field"]):$X);}$I=(isset($_GET["callf"])?"SELECT":"CALL")." ".idf_escape($da)."(".implode(", ",$Ja).")";echo"<p><code class='jush-$x'>".h($I)."</code> <a href='".h(ME)."sql=".urlencode($I)."'>".'Edit'."</a>\n";if(!$e->multi_query($I))echo"<p class='error'>".error()."\n";else{$f=connect();if(is_object($f))$f->select_db(DB);do{$J=$e->store_result();if(is_object($J))select($J,$f);else
- echo"<p class='message'>".lang(array('Routine has been called, %d row affected.','Routine has been called, %d rows affected.'),$e->affected_rows)."\n";}while($e->next_result());if($me)select($e->query("SELECT ".implode(", ",$me)));}}echo'
- <form action="" method="post">
- ';if($Lc){echo"<table cellspacing='0'>\n";foreach($Lc
- as$y){$k=$if["fields"][$y];$E=$k["field"];echo"<tr><th>".$b->fieldName($k);$Y=$_POST["fields"][$E];if($Y!=""){if($k["type"]=="enum")$Y=+$Y;if($k["type"]=="set")$Y=array_sum($Y);}input($k,$Y,(string)$_POST["function"][$E]);echo"\n";}echo"</table>\n";}echo'<p>
- <input type="submit" value="Call">
- <input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["foreign"])){$a=$_GET["foreign"];$E=$_GET["name"];$L=$_POST;if($_POST&&!$j&&!$_POST["add"]&&!$_POST["change"]&&!$_POST["change-js"]){$C=($_POST["drop"]?'Foreign key has been dropped.':($E!=""?'Foreign key has been altered.':'Foreign key has been created.'));$A=ME."table=".urlencode($a);$L["source"]=array_filter($L["source"],'strlen');ksort($L["source"]);$Uf=array();foreach($L["source"]as$y=>$X)$Uf[$y]=$L["target"][$y];$L["target"]=$Uf;if($x=="sqlite")queries_redirect($A,$C,recreate_table($a,$a,array(),array(),array(" $E"=>($_POST["drop"]?"":" ".format_foreign_key($L)))));else{$sa="ALTER TABLE ".table($a);$Eb="\nDROP ".($x=="sql"?"FOREIGN KEY ":"CONSTRAINT ").idf_escape($E);if($_POST["drop"])query_redirect($sa.$Eb,$A,$C);else{query_redirect($sa.($E!=""?"$Eb,":"")."\nADD".format_foreign_key($L),$A,$C);$j='Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.'."<br>$j";}}}page_header('Foreign key',$j,array("table"=>$a),h($a));if($_POST){ksort($L["source"]);if($_POST["add"])$L["source"][]="";elseif($_POST["change"]||$_POST["change-js"])$L["target"]=array();}elseif($E!=""){$n=foreign_keys($a);$L=$n[$E];$L["source"][]="";}else{$L["table"]=$a;$L["source"]=array("");}$zf=array_keys(fields($a));$Uf=($a===$L["table"]?$zf:array_keys(fields($L["table"])));$We=array_keys(array_filter(table_status('',true),'fk_support'));echo'
- <form action="" method="post">
- <p>
- ';if($L["db"]==""&&$L["ns"]==""){echo'Target table:
- ',html_select("table",$We,$L["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="Change"></noscript>
- <table cellspacing="0">
- <thead><tr><th>Source<th>Target</thead>
- ';$w=0;foreach($L["source"]as$y=>$X){echo"<tr>","<td>".html_select("source[".(+$y)."]",array(-1=>"")+$zf,$X,($w==count($L["source"])-1?"foreignAddRow(this);":1)),"<td>".html_select("target[".(+$y)."]",$Uf,$L["target"][$y]);$w++;}echo'</table>
- <p>
- ON DELETE: ',html_select("on_delete",array(-1=>"")+explode("|",$Wd),$L["on_delete"]),' ON UPDATE: ',html_select("on_update",array(-1=>"")+explode("|",$Wd),$L["on_update"]),doc_link(array('sql'=>"innodb-foreign-key-constraints.html",'pgsql'=>"sql-createtable.html#SQL-CREATETABLE-REFERENCES",'mssql'=>"ms174979.aspx",'oracle'=>"clauses002.htm#sthref2903",)),'<p>
- <input type="submit" value="Save">
- <noscript><p><input type="submit" name="add" value="Add column"></noscript>
- ';}if($E!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["view"])){$a=$_GET["view"];$L=$_POST;if($_POST&&!$j){$E=trim($L["name"]);$ua=" AS\n$L[select]";$A=ME."table=".urlencode($E);$C='View has been altered.';if(!$_POST["drop"]&&$a==$E&&$x!="sqlite")query_redirect(($x=="mssql"?"ALTER":"CREATE OR REPLACE")." VIEW ".table($E).$ua,$A,$C);else{$Wf=$E."_adminer_".uniqid();drop_create("DROP VIEW ".table($a),"CREATE VIEW ".table($E).$ua,"DROP VIEW ".table($E),"CREATE VIEW ".table($Wf).$ua,"DROP VIEW ".table($Wf),($_POST["drop"]?substr(ME,0,-1):$A),'View has been dropped.',$C,'View has been created.',$a,$E);}}if(!$_POST&&$a!=""){$L=view($a);$L["name"]=$a;if(!$j)$j=$e->error;}page_header(($a!=""?'Alter view':'Create view'),$j,array("table"=>$a),h($a));echo'
- <form action="" method="post">
- <p>Name: <input name="name" value="',h($L["name"]),'" maxlength="64" autocapitalize="off">
- <p>';textarea("select",$L["select"]);echo'<p>
- <input type="submit" value="Save">
- ';if($_GET["view"]!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["event"])){$aa=$_GET["event"];$Rc=array("YEAR","QUARTER","MONTH","DAY","HOUR","MINUTE","WEEK","SECOND","YEAR_MONTH","DAY_HOUR","DAY_MINUTE","DAY_SECOND","HOUR_MINUTE","HOUR_SECOND","MINUTE_SECOND");$Df=array("ENABLED"=>"ENABLE","DISABLED"=>"DISABLE","SLAVESIDE_DISABLED"=>"DISABLE ON SLAVE");$L=$_POST;if($_POST&&!$j){if($_POST["drop"])query_redirect("DROP EVENT ".idf_escape($aa),substr(ME,0,-1),'Event has been dropped.');elseif(in_array($L["INTERVAL_FIELD"],$Rc)&&isset($Df[$L["STATUS"]])){$mf="\nON SCHEDULE ".($L["INTERVAL_VALUE"]?"EVERY ".q($L["INTERVAL_VALUE"])." $L[INTERVAL_FIELD]".($L["STARTS"]?" STARTS ".q($L["STARTS"]):"").($L["ENDS"]?" ENDS ".q($L["ENDS"]):""):"AT ".q($L["STARTS"]))." ON COMPLETION".($L["ON_COMPLETION"]?"":" NOT")." PRESERVE";queries_redirect(substr(ME,0,-1),($aa!=""?'Event has been altered.':'Event has been created.'),queries(($aa!=""?"ALTER EVENT ".idf_escape($aa).$mf.($aa!=$L["EVENT_NAME"]?"\nRENAME TO ".idf_escape($L["EVENT_NAME"]):""):"CREATE EVENT ".idf_escape($L["EVENT_NAME"]).$mf)."\n".$Df[$L["STATUS"]]." COMMENT ".q($L["EVENT_COMMENT"]).rtrim(" DO\n$L[EVENT_DEFINITION]",";").";"));}}page_header(($aa!=""?'Alter event'.": ".h($aa):'Create event'),$j);if(!$L&&$aa!=""){$M=get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = ".q(DB)." AND EVENT_NAME = ".q($aa));$L=reset($M);}echo'
- <form action="" method="post">
- <table cellspacing="0">
- <tr><th>Name<td><input name="EVENT_NAME" value="',h($L["EVENT_NAME"]),'" maxlength="64" autocapitalize="off">
- <tr><th title="datetime">Start<td><input name="STARTS" value="',h("$L[EXECUTE_AT]$L[STARTS]"),'">
- <tr><th title="datetime">End<td><input name="ENDS" value="',h($L["ENDS"]),'">
- <tr><th>Every<td><input type="number" name="INTERVAL_VALUE" value="',h($L["INTERVAL_VALUE"]),'" class="size"> ',html_select("INTERVAL_FIELD",$Rc,$L["INTERVAL_FIELD"]),'<tr><th>Status<td>',html_select("STATUS",$Df,$L["STATUS"]),'<tr><th>Comment<td><input name="EVENT_COMMENT" value="',h($L["EVENT_COMMENT"]),'" maxlength="64">
- <tr><th> <td>',checkbox("ON_COMPLETION","PRESERVE",$L["ON_COMPLETION"]=="PRESERVE",'On completion preserve'),'</table>
- <p>';textarea("EVENT_DEFINITION",$L["EVENT_DEFINITION"]);echo'<p>
- <input type="submit" value="Save">
- ';if($aa!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["procedure"])){$da=$_GET["procedure"];$if=(isset($_GET["function"])?"FUNCTION":"PROCEDURE");$L=$_POST;$L["fields"]=(array)$L["fields"];if($_POST&&!process_fields($L["fields"])&&!$j){$Wf="$L[name]_adminer_".uniqid();drop_create("DROP $if ".idf_escape($da),create_routine($if,$L),"DROP $if ".idf_escape($L["name"]),create_routine($if,array("name"=>$Wf)+$L),"DROP $if ".idf_escape($Wf),substr(ME,0,-1),'Routine has been dropped.','Routine has been altered.','Routine has been created.',$da,$L["name"]);}page_header(($da!=""?(isset($_GET["function"])?'Alter function':'Alter procedure').": ".h($da):(isset($_GET["function"])?'Create function':'Create procedure')),$j);if(!$_POST&&$da!=""){$L=routine($da,$if);$L["name"]=$da;}$Wa=get_vals("SHOW CHARACTER SET");sort($Wa);$jf=routine_languages();echo'
- <form action="" method="post" id="form">
- <p>Name: <input name="name" value="',h($L["name"]),'" maxlength="64" autocapitalize="off">
- ',($jf?'Language'.": ".html_select("language",$jf,$L["language"]):""),'<input type="submit" value="Save">
- <table cellspacing="0" class="nowrap">
- ';edit_fields($L["fields"],$Wa,$if);if(isset($_GET["function"])){echo"<tr><td>".'Return type';edit_type("returns",$L["returns"],$Wa);}echo'</table>
- <p>';textarea("definition",$L["definition"]);echo'<p>
- <input type="submit" value="Save">
- ';if($da!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["trigger"])){$a=$_GET["trigger"];$E=$_GET["name"];$og=trigger_options();$L=(array)trigger($E)+array("Trigger"=>$a."_bi");if($_POST){if(!$j&&in_array($_POST["Timing"],$og["Timing"])&&in_array($_POST["Event"],$og["Event"])&&in_array($_POST["Type"],$og["Type"])){$Vd=" ON ".table($a);$Eb="DROP TRIGGER ".idf_escape($E).($x=="pgsql"?$Vd:"");$A=ME."table=".urlencode($a);if($_POST["drop"])query_redirect($Eb,$A,'Trigger has been dropped.');else{if($E!="")queries($Eb);queries_redirect($A,($E!=""?'Trigger has been altered.':'Trigger has been created.'),queries(create_trigger($Vd,$_POST)));if($E!="")queries(create_trigger($Vd,$L+array("Type"=>reset($og["Type"]))));}}$L=$_POST;}page_header(($E!=""?'Alter trigger'.": ".h($E):'Create trigger'),$j,array("table"=>$a));echo'
- <form action="" method="post" id="form">
- <table cellspacing="0">
- <tr><th>Time<td>',html_select("Timing",$og["Timing"],$L["Timing"],"triggerChange(/^".preg_quote($a,"/")."_[ba][iud]$/, '".js_escape($a)."', this.form);"),'<tr><th>Event<td>',html_select("Event",$og["Event"],$L["Event"],"this.form['Timing'].onchange();"),(in_array("UPDATE OF",$og["Event"])?" <input name='Of' value='".h($L["Of"])."' class='hidden'>":""),'<tr><th>Type<td>',html_select("Type",$og["Type"],$L["Type"]),'</table>
- <p>Name: <input name="Trigger" value="',h($L["Trigger"]);?>" maxlength="64" autocapitalize="off">
- <script type="text/javascript">document.getElementById('form')['Timing'].onchange();</script>
- <p><?php textarea("Statement",$L["Statement"]);echo'<p>
- <input type="submit" value="Save">
- ';if($E!=""){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["user"])){$fa=$_GET["user"];$Le=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$L){foreach(explode(",",($L["Privilege"]=="Grant option"?"":$L["Context"]))as$gb)$Le[$gb][$L["Privilege"]]=$L["Comment"];}$Le["Server Admin"]+=$Le["File access on server"];$Le["Databases"]["Create routine"]=$Le["Procedures"]["Create routine"];unset($Le["Procedures"]["Create routine"]);$Le["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$Le["Columns"][$X]=$Le["Tables"][$X];unset($Le["Server Admin"]["Usage"]);foreach($Le["Tables"]as$y=>$X)unset($Le["Databases"][$y]);$Id=array();if($_POST){foreach($_POST["objects"]as$y=>$X)$Id[$X]=(array)$Id[$X]+(array)$_POST["grants"][$y];}$yc=array();$Td="";if(isset($_GET["host"])&&($J=$e->query("SHOW GRANTS FOR ".q($fa)."@".q($_GET["host"])))){while($L=$J->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$L[0],$B)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$B[1],$sd,PREG_SET_ORDER)){foreach($sd
- as$X){if($X[1]!="USAGE")$yc["$B[2]$X[2]"][$X[1]]=true;if(preg_match('~ WITH GRANT OPTION~',$L[0]))$yc["$B[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$L[0],$B))$Td=$B[1];}}if($_POST&&!$j){$Ud=(isset($_GET["host"])?q($fa)."@".q($_GET["host"]):"''");if($_POST["drop"])query_redirect("DROP USER $Ud",ME."privileges=",'User has been dropped.');else{$Kd=q($_POST["user"])."@".q($_POST["host"]);$we=$_POST["pass"];if($we!=''&&!$_POST["hashed"]){$we=$e->result("SELECT PASSWORD(".q($we).")");$j=!$we;}$lb=false;if(!$j){if($Ud!=$Kd){$lb=queries(($e->server_info<5?"GRANT USAGE ON *.* TO":"CREATE USER")." $Kd IDENTIFIED BY PASSWORD ".q($we));$j=!$lb;}elseif($we!=$Td)queries("SET PASSWORD FOR $Kd = ".q($we));}if(!$j){$ff=array();foreach($Id
- as$Od=>$q){if(isset($_GET["grant"]))$q=array_filter($q);$q=array_keys($q);if(isset($_GET["grant"]))$ff=array_diff(array_keys(array_filter($Id[$Od],'strlen')),$q);elseif($Ud==$Kd){$Rd=array_keys((array)$yc[$Od]);$ff=array_diff($Rd,$q);$q=array_diff($q,$Rd);unset($yc[$Od]);}if(preg_match('~^(.+)\\s*(\\(.*\\))?$~U',$Od,$B)&&(!grant("REVOKE",$ff,$B[2]," ON $B[1] FROM $Kd")||!grant("GRANT",$q,$B[2]," ON $B[1] TO $Kd"))){$j=true;break;}}}if(!$j&&isset($_GET["host"])){if($Ud!=$Kd)queries("DROP USER $Ud");elseif(!isset($_GET["grant"])){foreach($yc
- as$Od=>$ff){if(preg_match('~^(.+)(\\(.*\\))?$~U',$Od,$B))grant("REVOKE",array_keys($ff),$B[2]," ON $B[1] FROM $Kd");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?'User has been altered.':'User has been created.'),!$j);if($lb)$e->query("DROP USER $Kd");}}page_header((isset($_GET["host"])?'Username'.": ".h("$fa@$_GET[host]"):'Create user'),$j,array("privileges"=>array('','Privileges')));if($_POST){$L=$_POST;$yc=$Id;}else{$L=$_GET+array("host"=>$e->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$L["pass"]=$Td;if($Td!="")$L["hashed"]=true;$yc[(DB==""||$yc?"":idf_escape(addcslashes(DB,"%_\\"))).".*"]=array();}echo'<form action="" method="post">
- <table cellspacing="0">
- <tr><th>Server<td><input name="host" maxlength="60" value="',h($L["host"]),'" autocapitalize="off">
- <tr><th>Username<td><input name="user" maxlength="16" value="',h($L["user"]),'" autocapitalize="off">
- <tr><th>Password<td><input name="pass" id="pass" value="',h($L["pass"]),'">
- ';if(!$L["hashed"]){echo'<script type="text/javascript">typePassword(document.getElementById(\'pass\'));</script>';}echo
- checkbox("hashed",1,$L["hashed"],'Hashed',"typePassword(this.form['pass'], this.checked);"),'</table>
- ';echo"<table cellspacing='0'>\n","<thead><tr><th colspan='2'>".'Privileges'.doc_link(array('sql'=>"grant.html#priv_level"));$s=0;foreach($yc
- as$Od=>$q){echo'<th>'.($Od!="*.*"?"<input name='objects[$s]' value='".h($Od)."' size='10' autocapitalize='off'>":"<input type='hidden' name='objects[$s]' value='*.*' size='10'>*.*");$s++;}echo"</thead>\n";foreach(array(""=>"","Server Admin"=>'Server',"Databases"=>'Database',"Tables"=>'Table',"Columns"=>'Column',"Procedures"=>'Routine',)as$gb=>$xb){foreach((array)$Le[$gb]as$Ke=>$ab){echo"<tr".odd()."><td".($xb?">$xb<td":" colspan='2'").' lang="en" title="'.h($ab).'">'.h($Ke);$s=0;foreach($yc
- as$Od=>$q){$E="'grants[$s][".h(strtoupper($Ke))."]'";$Y=$q[strtoupper($Ke)];if($gb=="Server Admin"&&$Od!=(isset($yc["*.*"])?"*.*":".*"))echo"<td> ";elseif(isset($_GET["grant"]))echo"<td><select name=$E><option><option value='1'".($Y?" selected":"").">".'Grant'."<option value='0'".($Y=="0"?" selected":"").">".'Revoke'."</select>";else
- echo"<td align='center'><label class='block'><input type='checkbox' name=$E value='1'".($Y?" checked":"").($Ke=="All privileges"?" id='grants-$s-all'":($Ke=="Grant option"?"":" onclick=\"if (this.checked) formUncheck('grants-$s-all');\""))."></label>";$s++;}}}echo"</table>\n",'<p>
- <input type="submit" value="Save">
- ';if(isset($_GET["host"])){echo'<input type="submit" name="drop" value="Drop"',confirm(),'>';}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["processlist"])){if(support("kill")&&$_POST&&!$j){$cd=0;foreach((array)$_POST["kill"]as$X){if(queries("KILL ".(+$X)))$cd++;}queries_redirect(ME."processlist=",lang(array('%d process has been killed.','%d processes have been killed.'),$cd),$cd||!$_POST["kill"]);}page_header('Process list',$j);echo'
- <form action="" method="post">
- <table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
- ';$s=-1;foreach(process_list()as$s=>$L){if(!$s){echo"<thead><tr lang='en'>".(support("kill")?"<th> ":"");foreach($L
- as$y=>$X)echo"<th>$y".doc_link(array('sql'=>"show-processlist.html#processlist_".strtolower($y),'pgsql'=>"monitoring-stats.html#PG-STAT-ACTIVITY-VIEW",'oracle'=>"../b14237/dynviews_2088.htm",));echo"</thead>\n";}echo"<tr".odd().">".(support("kill")?"<td>".checkbox("kill[]",$L["Id"],0):"");foreach($L
- as$y=>$X)echo"<td>".(($x=="sql"&&$y=="Info"&&preg_match("~Query|Killed~",$L["Command"])&&$X!="")||($x=="pgsql"&&$y=="current_query"&&$X!="<IDLE>")||($x=="oracle"&&$y=="sql_text"&&$X!="")?"<code class='jush-$x'>".shorten_utf8($X,100,"</code>").' <a href="'.h(ME.($L["db"]!=""?"db=".urlencode($L["db"])."&":"")."sql=".urlencode($X)).'">'.'Clone'.'</a>':nbsp($X));echo"\n";}echo'</table>
- <script type=\'text/javascript\'>tableCheck();</script>
- <p>
- ';if(support("kill")){echo($s+1)."/".sprintf('%d in total',$e->result("SELECT @@max_connections")),"<p><input type='submit' value='".'Kill'."'>\n";}echo'<input type="hidden" name="token" value="',$T,'">
- </form>
- ';}elseif(isset($_GET["select"])){$a=$_GET["select"];$R=table_status1($a);$v=indexes($a);$l=fields($a);$n=column_foreign_keys($a);$Qd="";if(!empty($R["Oid"])){$Qd=($x=="sqlite"?"rowid":"oid");$v[]=array("type"=>"PRIMARY","columns"=>array($Qd));}parse_str((isset($_COOKIE["adminer_import"])?$_COOKIE["adminer_import"]:null),$ma);$gf=array();$d=array();$Zf=null;foreach($l
- as$y=>$k){$E=$b->fieldName($k);if(isset($k["privileges"]["select"])&&$E!=""){$d[$y]=html_entity_decode(strip_tags($E),ENT_QUOTES);if(is_shortable($k))$Zf=$b->selectLengthProcess();}$gf+=$k["privileges"];}list($N,$r)=$b->selectColumnsProcess($d,$v);$Vc=count($r)<count($N);$Z=$b->selectSearchProcess($l,$v);$ee=$b->selectOrderProcess($l,$v);$z=$b->selectLimitProcess();$vc=($N?implode(", ",$N):"*".($Qd?", $Qd":"")).convert_fields($d,$l,$N)."\nFROM ".table($a);$zc=($r&&$Vc?"\nGROUP BY ".implode(", ",$r):"").($ee?"\nORDER BY ".implode(", ",$ee):"");if((isset($_GET["val"])?$_GET["val"]:false)&&is_ajax()){header("Content-Type: text/plain; charset=utf-8");foreach($_GET["val"]as$wg=>$L){$ua=convert_field($l[key($L)]);$N=array($ua?$ua:idf_escape(key($L)));$Z[]=where_check($wg,$l);$K=$i->select($a,$N,$Z,$N);if($K)echo
- reset($K->fetch_row());}exit;}if($_POST&&!$j){$Og=$Z;if(!$_POST["all"]&&is_array($_POST["check"])){$Na=array();foreach($_POST["check"]as$La)$Na[]=where_check($La,$l);$Og[]="((".implode(") OR (",$Na)."))";}$Og=($Og?"\nWHERE ".implode(" AND ",$Og):"");$He=$yg=null;foreach($v
- as$u){if($u["type"]=="PRIMARY"){$He=array_flip($u["columns"]);$yg=($N?$He:array());break;}}foreach((array)$yg
- as$y=>$X){if(in_array(idf_escape($y),$N))unset($yg[$y]);}if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");if(!is_array($_POST["check"])||$yg===array())$I="SELECT $vc$Og$zc";else{$ug=array();foreach($_POST["check"]as$X)$ug[]="(SELECT".limit($vc,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l).$zc,1).")";$I=implode(" UNION ALL ",$ug);}$b->dumpData($a,"table",$I);exit;}if(!$b->selectEmailProcess($Z,$n)){if($_POST["save"]||$_POST["delete"]){$J=true;$na=0;$P=array();if(!$_POST["delete"]){foreach($d
- as$E=>$X){$X=process_input($l[$E]);if($X!==null&&($_POST["clone"]||$X!==false))$P[idf_escape($E)]=($X!==false?$X:idf_escape($E));}}if($_POST["delete"]||$P){if($_POST["clone"])$I="INTO ".table($a)." (".implode(", ",array_keys($P)).")\nSELECT ".implode(", ",$P)."\nFROM ".table($a);if($_POST["all"]||($yg===array()&&is_array($_POST["check"]))||$Vc){$J=($_POST["delete"]?$i->delete($a,$Og):($_POST["clone"]?queries("INSERT $I$Og"):$i->update($a,$P,$Og)));$na=$e->affected_rows;}else{foreach((array)$_POST["check"]as$X){$Ng="\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$l);$J=($_POST["delete"]?$i->delete($a,$Ng,1):($_POST["clone"]?queries("INSERT".limit1($I,$Ng)):$i->update($a,$P,$Ng)));if(!$J)break;$na+=$e->affected_rows;}}}$C=lang(array('%d item has been affected.','%d items have been affected.'),$na);if($_POST["clone"]&&$J&&$na==1){$gd=last_id();if($gd)$C=sprintf('Item%s has been inserted.'," $gd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$C,$J);if(!$_POST["delete"]){edit_form($a,$l,(array)$_POST["fields"],!$_POST["clone"]);page_footer();exit;}}elseif(!$_POST["import"]){if(!$_POST["val"])$j='Ctrl+click on a value to modify it.';else{$J=true;$na=0;foreach($_POST["val"]as$wg=>$L){$P=array();foreach($L
- as$y=>$X){$y=bracket_escape($y,1);$P[idf_escape($y)]=(preg_match('~char|text~',$l[$y]["type"])||$X!=""?$b->processInput($l[$y],$X):"NULL");}$J=$i->update($a,$P," WHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($wg,$l),!($Vc||$yg===array())," ");if(!$J)break;$na+=$e->affected_rows;}queries_redirect(remove_from_uri(),lang(array('%d item has been affected.','%d items have been affected.'),$na),$J);}}elseif(!is_string($lc=get_file("csv_file",true)))$j=upload_error($lc);elseif(!preg_match('~~u',$lc))$j='File must be in UTF-8 encoding.';else{cookie("adminer_import","output=".urlencode($ma["output"])."&format=".urlencode($_POST["separator"]));$J=true;$Xa=array_keys($l);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$lc,$sd);$na=count($sd[0]);$i->begin();$sf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));$M=array();foreach($sd[0]as$y=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$sf]*)$sf~",$X.$sf,$td);if(!$y&&!array_diff($td[1],$Xa)){$Xa=$td[1];$na--;}else{$P=array();foreach($td[1]as$s=>$Ta)$P[idf_escape($Xa[$s])]=($Ta==""&&$l[$Xa[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ta))));$M[]=$P;}}$J=(!$M||$i->insertUpdate($a,$M,$He));if($J)$i->commit();queries_redirect(remove_from_uri("page"),lang(array('%d row has been imported.','%d rows have been imported.'),$na),$J);$i->rollback();}}}$Of=$b->tableName($R);if(is_ajax()){page_headers();ob_start();}else
- page_header('Select'.": $Of",$j);$P=null;if(isset($gf["insert"])||!support("table")){$P="";foreach((array)(isset($_GET["where"])?$_GET["where"]:null)as$X){if(count($n[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!preg_match('~[_%]~',$X["val"]))))$P.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($R,$P);if(!$d&&support("table"))echo"<p class='error'>".'Unable to select the table'.($l?".":": ".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($N,$d);$b->selectSearchPrint($Z,$d,$v);$b->selectOrderPrint($ee,$d,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($Zf);$b->selectActionPrint($v);echo"</form>\n";$F=(isset($_GET["page"])?$_GET["page"]:null);if($F=="last"){$uc=$e->result(count_rows($a,$Z,$Vc,$r));$F=floor(max(0,$uc-1)/$z);}$pf=$N;if(!$pf){$pf[]="*";if($Qd)$pf[]=$Qd;}$hb=convert_fields($d,$l,$N);if($hb)$pf[]=substr($hb,2);$J=$i->select($a,$pf,$Z,$r,$ee,$z,$F,true);if(!$J)echo"<p class='error'>".error()."\n";else{if($x=="mssql"&&$F)$J->seek($z*$F);$Qb=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$M=array();while($L=$J->fetch_assoc()){if($F&&$x=="oracle")unset($L["RNUM"]);$M[]=$L;}if((isset($_GET["page"])?$_GET["page"]:null)!="last"&&+$z&&$r&&$Vc&&$x=="sql")$uc=$e->result(" SELECT FOUND_ROWS()");if(!$M)echo"<p class='message'>".'No rows.'."\n";else{$Ba=$b->backwardKeys($a,$Of);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$r&&$N?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h((isset($_GET["modify"])?$_GET["modify"]:null)?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".'Modify'."</a>");$Hd=array();$xc=array();reset($N);$Te=1;foreach((isset($M[0])?$M[0]:null)as$y=>$X){if($y!=$Qd){$X=(isset($_GET["columns"])?$_GET["columns"][key($N)]:null);$k=$l[$N?($X?$X["col"]:current($N)):$y];$E=($k?$b->fieldName($k,$Te):($X["fun"]?"*":$y));if($E!=""){$Te++;$Hd[$y]=$E;$c=idf_escape($y);$Hc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);$xb="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($Hc.((isset($ee[0])?$ee[0]:null)==$c||(isset($ee[0])?$ee[0]:null)==$y||(!$ee&&$Vc&&$r[0]==$c)?$xb:'')).'">';echo
- apply_sql_function($X["fun"],$E)."</a>";echo"<span class='column hidden'>","<a href='".h($Hc.$xb)."' title='".'descending'."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($y)).'\'); return false;" title="'.'Search'.'" class="text jsonly"> =</a>';echo"</span>";}$xc[$y]=$X["fun"];next($N);}}$md=array();if((isset($_GET["modify"])?$_GET["modify"]:null)){foreach($M
- as$L){foreach($L
- as$y=>$X)$md[$y]=max($md[$y],min(40,strlen(utf8_decode($X))));}}echo($Ba?"<th>".'Relations':"")."</thead>\n";if(is_ajax()){if($z%2==1&&$F%2==1)odd();ob_end_clean();}foreach($b->rowDescriptions($M,$n)as$D=>$L){$vg=unique_array($M[$D],$v);if(!$vg){$vg=array();foreach($M[$D]as$y=>$X){if(!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~',$y))$vg[$y]=$X;}}$wg="";foreach($vg
- as$y=>$X){if(($x=="sql"||$x=="pgsql")&&strlen($X)>64){$y="MD5(".(strpos($y,'(')?$y:idf_escape($y)).")";$X=md5($X);}$wg.="&".($X!==null?urlencode("where[".bracket_escape($y)."]")."=".urlencode($X):"null%5B%5D=".urlencode($y));}echo"<tr".odd().">".(!$r&&$N?"":"<td>".checkbox("check[]",substr($wg,1),in_array(substr($wg,1),(array)(isset($_POST["check"])?$_POST["check"]:null)),"","this.form['all'].checked = false; formUncheck('all-page');").($Vc||information_schema(DB)?"":" <a href='".h(ME."edit=".urlencode($a).$wg)."'>".'edit'."</a>"));foreach($L
- as$y=>$X){if(isset($Hd[$y])){$k=$l[$y];if($X!=""&&(!isset($Qb[$y])||$Qb[$y]!=""))$Qb[$y]=(is_mail($X)?$Hd[$y]:"");$_="";if(preg_match('~blob|bytea|raw|file~',$k["type"])&&$X!="")$_=ME.'download='.urlencode($a).'&field='.urlencode($y).$wg;if(!$_&&$X!==null){foreach((array)(isset($n[$y])?$n[$y]:null)as$m){if(count($n[$y])==1||end($m["source"])==$y){$_="";foreach($m["source"]as$s=>$zf)$_.=where_link($s,$m["target"][$s],$M[$D][$zf]);$_=($m["db"]!=""?preg_replace('~([?&]db=)[^&]+~','\\1'.urlencode($m["db"]),ME):ME).'select='.urlencode($m["table"]).$_;if(count($m["source"])==1)break;}}}if($y=="COUNT(*)"){$_=ME."select=".urlencode($a);$s=0;foreach((array)$_GET["where"]as$W){if(!array_key_exists($W["col"],$vg))$_.=where_link($s++,$W["col"],$W["val"],$W["op"]);}foreach($vg
- as$Zc=>$W)$_.=where_link($s++,$Zc,$W);}$X=select_value($X,$_,$k,$Zf);$t=h("val[$wg][".bracket_escape($y)."]");$Y=(isset($_POST["val"])?$_POST["val"][$wg][bracket_escape($y)]:null);$Lb=!is_array($L[$y])&&is_utf8($X)&&$M[$D][$y]==$L[$y]&&!$xc[$y];$Yf=preg_match('~text|lob~',$k["type"]);if(((isset($_GET["modify"])?$_GET["modify"]:null)&&$Lb)||$Y!==null){$Ac=h($Y!==null?$Y:$L[$y]);echo"<td>".($Yf?"<textarea name='$t' cols='30' rows='".(substr_count($L[$y],"\n")+1)."'>$Ac</textarea>":"<input name='$t' value='$Ac' size='$md[$y]'>");}else{$rd=strpos($X,"<i>...</i>");echo"<td id='$t' onclick=\"selectClick(this, event, ".($rd?2:($Yf?1:0)).($Lb?"":", '".h('Use edit link to modify this value.')."'").");\">$X";}}}if($Ba)echo"<td>";$b->backwardKeysPrint($Ba,$M[$D]);echo"</tr>\n";}if(is_ajax())exit;echo"</table>\n";}if(($M||$F)&&!is_ajax()){$ac=true;if((isset($_GET["page"])?$_GET["page"]:null)!="last"){if(!+$z)$uc=count($M);elseif($x!="sql"||!$Vc){$uc=($Vc?false:found_rows($R,$Z));if($uc<max(1e4,2*($F+1)*$z))$uc=reset(slow_query(count_rows($a,$Z,$Vc,$r)));else$ac=false;}}if(+$z&&($uc===false||$uc>$z||$F)){echo"<p class='pages'>";$vd=($uc===false?$F+(count($M)>=$z?2:1):floor(($uc-1)/$z));if($x!="simpledb"){echo'<a href="'.h(remove_from_uri("page"))."\" onclick=\"pageClick(this.href, +prompt('".'Page'."', '".($F+1)."'), event); return false;\">".'Page'."</a>:",pagination(0,$F).($F>5?" ...":"");for($s=max(1,$F-4);$s<min($vd,$F+5);$s++)echo
- pagination($s,$F);if($vd>0){echo($F+5<$vd?" ...":""),($ac&&$uc!==false?pagination($vd,$F):" <a href='".h(remove_from_uri("page")."&page=last")."' title='~$vd'>".'last'."</a>");}echo(($uc===false?count($M)+1:$uc-$F*$z)>$z?' <a href="'.h(remove_from_uri("page")."&page=".($F+1)).'" onclick="return !selectLoadMore(this, '.(+$z).', \''.'Loading'.'...\');" class="loadmore">'.'Load more data'.'</a>':'');}else{echo'Page'.":",pagination(0,$F).($F>1?" ...":""),($F?pagination($F,$F):""),($vd>$F?pagination($F+1,$F).($vd>$F+1?" ...":""):"");}}echo"<p class='count'>\n",($uc!==false?"(".($ac?"":"~ ").lang(array('%d row','%d rows'),$uc).") ":"");$Bb=($ac?"":"~ ").$uc;echo
- checkbox("all",1,0,'whole result',"var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$Bb' : checked); selectCount('selected2', this.checked || !checked ? '$Bb' : checked);")."\n";if($b->selectCommandPrint()){echo'<fieldset',(!empty($_GET["modify"])?'':' class="jsonly"'),'><legend>Modify</legend><div>
- <input type="submit" value="Save"',(!empty($_GET["modify"])?'':' title="'.'Ctrl+click on a value to modify it.'.'"'),'>
- </div></fieldset>
- <fieldset><legend>Selected <span id="selected"></span></legend><div>
- <input type="submit" name="edit" value="Edit">
- <input type="submit" name="clone" value="Clone">
- <input type="submit" name="delete" value="Delete"',confirm(),'>
- </div></fieldset>
- ';}$sc=$b->dumpFormat();foreach((array)(isset($_GET["columns"])?$_GET["columns"]:null)as$c){if($c["fun"]){unset($sc['sql']);break;}}if($sc){print_fieldset("export",'Export'." <span id='selected2'></span>");$ne=$b->dumpOutput();echo($ne?html_select("output",$ne,$ma["output"])." ":""),html_select("format",$sc,$ma["format"])," <input type='submit' name='export' value='".'Export'."'>\n","</div></fieldset>\n";}echo(!$r&&$N?"":"<script type='text/javascript'>tableCheck();</script>\n");}if($b->selectImportPrint()){print_fieldset("import",'Import',!$M);echo"<input type='file' name='csv_file'> ",html_select("separator",array("csv"=>"CSV,","csv;"=>"CSV;","tsv"=>"TSV"),$ma["format"],1);echo" <input type='submit' name='import' value='".'Import'."'>","</div></fieldset>\n";}$b->selectEmailPrint(array_filter($Qb,'strlen'),$d);echo"<p><input type='hidden' name='token' value='$T'></p>\n","</form>\n";}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$Cf=isset($_GET["status"]);page_header($Cf?'Status':'Variables');$Hg=($Cf?show_status():show_variables());if(!$Hg)echo"<p class='message'>".'No rows.'."\n";else{echo"<table cellspacing='0'>\n";foreach($Hg
- as$y=>$X){echo"<tr>","<th><code class='jush-".$x.($Cf?"status":"set")."'>".h($y)."</code>","<td>".nbsp($X);}echo"</table>\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$Lf=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$E=>$R){$t=js_escape($E);json_row("Comment-$t",nbsp($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$y)json_row("$y-$t",nbsp($R[$y]));foreach($Lf+array("Auto_increment"=>0,"Rows"=>0)as$y=>$X){if($R[$y]!=""){$X=format_number($R[$y]);json_row("$y-$t",($y=="Rows"&&$X&&$R["Engine"]==($Af=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($Lf[$y]))$Lf[$y]+=($R["Engine"]!="InnoDB"||$y!="Data_free"?$R[$y]:0);}elseif(array_key_exists($y,$R))json_row("$y-$t");}}}foreach($Lf
- as$y=>$X)json_row("sum-$y",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$e->query("KILL ".(+$_POST["kill"]));else{foreach(count_tables($b->databases())as$h=>$X){json_row("tables-$h",$X);json_row("size-$h",db_size($h));}json_row("");}exit;}else{$Tf=array_merge((array)(isset($_POST["tables"])?$_POST["tables"]:null),(array)(isset($_POST["views"])?$_POST["views"]:null));if($Tf&&!$j&&!$_POST["search"]){$J=true;$C="";if($x=="sql"&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$J=truncate_tables($_POST["tables"]);$C='Tables have been truncated.';}elseif($_POST["move"]){$J=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been moved.';}elseif($_POST["copy"]){$J=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$C='Tables have been copied.';}elseif($_POST["drop"]){if($_POST["views"])$J=drop_views($_POST["views"]);if($J&&$_POST["tables"])$J=drop_tables($_POST["tables"]);$C='Tables have been dropped.';}elseif($x!="sql"){$J=($x=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$C='Tables have been optimized.';}elseif(!$_POST["tables"])$C='No tables.';elseif($J=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($L=$J->fetch_assoc())$C.="<b>".h($L["Table"])."</b>: ".h($L["Msg_text"])."<br>";}queries_redirect(substr(ME,0,-1),$C,$J);}page_header((empty($_GET["ns"])?'Database'.": ".h(DB):'Schema'.": ".h(empty($_GET["ns"])?null:$_GET["ns"])),$j,true);if($b->homepage()){if((isset($_GET["ns"])?$_GET["ns"]:null)!==""){echo"<h3 id='tables-views'>".'Tables and views'."</h3>\n";$Sf=tables_list();if(!$Sf)echo"<p class='message'>".'No tables.'."\n";else{echo"<form action='' method='post'>\n";if(support("table")){echo"<fieldset><legend>".'Search data in tables'." <span id='selected2'></span></legend><div>","<input type='search' name='query' value='".h($_POST["query"])."'> <input type='submit' name='search' value='".'Search'."'>\n","</div></fieldset>\n";if($_POST["search"]&&$_POST["query"]!="")search_tables();}echo"<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n",'<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">','<th>'.'Table','<td>'.'Engine','<td>'.'Collation','<td>'.'Data Length','<td>'.'Index Length','<td>'.'Data Free','<td>'.'Auto Increment','<td>'.'Rows',(support("comment")?'<td>'.'Comment':''),"</thead>\n";$S=0;foreach($Sf
- as$E=>$U){$Jg=($U!==null&&!preg_match('~table~i',$U));echo'<tr'.odd().'><td>'.checkbox(($Jg?"views[]":"tables[]"),$E,in_array($E,$Tf,true),"","formUncheck('check-all');"),'<th>'.(support("table")||support("indexes")?'<a href="'.h(ME).'table='.urlencode($E).'" title="'.'Show structure'.'">'.h($E).'</a>':h($E));if($Jg){echo'<td colspan="6"><a href="'.h(ME)."view=".urlencode($E).'" title="'.'Alter view'.'">'.'View'.'</a>','<td align="right"><a href="'.h(ME)."select=".urlencode($E).'" title="'.'Select data'.'">?</a>';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",'Alter table'),"Index_length"=>array("indexes",'Alter indexes'),"Data_free"=>array("edit",'New item'),"Auto_increment"=>array("auto_increment=1&create",'Alter table'),"Rows"=>array("select",'Select data'),)as$y=>$_){$t=" id='$y-".h($E)."'";echo($_?"<td align='right'>".(support("table")||$y=="Rows"||(support("indexes")&&$y!="Data_length")?"<a href='".h(ME."$_[0]=").urlencode($E)."'$t title='$_[1]'>?</a>":"<span$t>?</span>"):"<td id='$y-".h($E)."'> ");}$S++;}echo(support("comment")?"<td id='Comment-".h($E)."'> ":"");}echo"<tr><td> <th>".sprintf('%d in total',count($Sf)),"<td>".nbsp($x=="sql"?$e->result("SELECT @@storage_engine"):""),"<td>".nbsp(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$y)echo"<td align='right' id='sum-$y'> ";echo"</table>\n";if(!information_schema(DB)){$Fg="<input type='submit' value='".'Vacuum'."'".on_help("'VACUUM'")."> ";$be="<input type='submit' name='optimize' value='".'Optimize'."'".on_help($x=="sql"?"'OPTIMIZE TABLE'":"'VACUUM OPTIMIZE'")."> ";echo"<fieldset><legend>".'Selected'." <span id='selected'></span></legend><div>".($x=="sqlite"?$Fg:($x=="pgsql"?$Fg.$be:($x=="sql"?"<input type='submit' value='".'Analyze'."'".on_help("'ANALYZE TABLE'")."> ".$be."<input type='submit' name='check' value='".'Check'."'".on_help("'CHECK TABLE'")."> "."<input type='submit' name='repair' value='".'Repair'."'".on_help("'REPAIR TABLE'")."> ":"")))."<input type='submit' name='truncate' value='".'Truncate'."'".confirm().on_help($x=="sqlite"?"'DELETE'":"'TRUNCATE".($x=="pgsql"?"'":" TABLE'"))."> "."<input type='submit' name='drop' value='".'Drop'."'".confirm().on_help("'DROP TABLE'").">\n";$g=(support("scheme")?$b->schemas():$b->databases());if(count($g)!=1&&$x!="sqlite"){$h=(isset($_POST["target"])?$_POST["target"]:(support("scheme")?$_GET["ns"]:DB));echo"<p>".'Move to other database'.": ",($g?html_select("target",$g,$h):'<input name="target" value="'.h($h).'" autocapitalize="off">')," <input type='submit' name='move' value='".'Move'."'>",(support("copy")?" <input type='submit' name='copy' value='".'Copy'."'>":""),"\n";}echo"<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^(tables|views)\[/));".(support("table")?" selectCount('selected2', formChecked(this, /^tables\[/) || $S);":"")."\">\n";echo"<input type='hidden' name='token' value='$T'>\n","</div></fieldset>\n";}echo"</form>\n","<script type='text/javascript'>tableCheck();</script>\n";}echo'<p class="links"><a href="'.h(ME).'create=">'.'Create table'."</a>\n",(support("view")?'<a href="'.h(ME).'view=">'.'Create view'."</a>\n":"");if(support("routine")){echo"<h3 id='routines'>".'Routines'."</h3>\n";$kf=routines();if($kf){echo"<table cellspacing='0'>\n",'<thead><tr><th>'.'Name'.'<td>'.'Type'.'<td>'.'Return type'."<td> </thead>\n";odd('');foreach($kf
- as$L){echo'<tr'.odd().'>','<th><a href="'.h(ME).($L["ROUTINE_TYPE"]!="PROCEDURE"?'callf=':'call=').urlencode($L["ROUTINE_NAME"]).'">'.h($L["ROUTINE_NAME"]).'</a>','<td>'.h($L["ROUTINE_TYPE"]),'<td>'.h($L["DTD_IDENTIFIER"]),'<td><a href="'.h(ME).($L["ROUTINE_TYPE"]!="PROCEDURE"?'function=':'procedure=').urlencode($L["ROUTINE_NAME"]).'">'.'Alter'."</a>";}echo"</table>\n";}echo'<p class="links">'.(support("procedure")?'<a href="'.h(ME).'procedure=">'.'Create procedure'.'</a>':'').'<a href="'.h(ME).'function=">'.'Create function'."</a>\n";}if(support("event")){echo"<h3 id='events'>".'Events'."</h3>\n";$M=get_rows("SHOW EVENTS");if($M){echo"<table cellspacing='0'>\n","<thead><tr><th>".'Name'."<td>".'Schedule'."<td>".'Start'."<td>".'End'."<td></thead>\n";foreach($M
- as$L){echo"<tr>","<th>".h($L["Name"]),"<td>".($L["Execute at"]?'At given time'."<td>".$L["Execute at"]:'Every'." ".$L["Interval value"]." ".$L["Interval field"]."<td>$L[Starts]"),"<td>$L[Ends]",'<td><a href="'.h(ME).'event='.urlencode($L["Name"]).'">'.'Alter'.'</a>';}echo"</table>\n";$Yb=$e->result("SELECT @@event_scheduler");if($Yb&&$Yb!="ON")echo"<p class='error'><code class='jush-sqlset'>event_scheduler</code>: ".h($Yb)."\n";}echo'<p class="links"><a href="'.h(ME).'event=">'.'Create event'."</a>\n";}if($Sf)echo"<script type='text/javascript'>ajaxSetHtml('".js_escape(ME)."script=db');</script>\n";}}}page_footer();
|