ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * general function, usually for data manipulation pages * */ /** * @var sql_box_locked lock for the sqlbox textarea in the querybox */ var sql_box_locked = false; /** * @var array holds elements which content should only selected once */ var only_once_elements = []; /** * @var int ajax_message_count Number of AJAX messages shown since page load */ var ajax_message_count = 0; /** * @var codemirror_editor object containing CodeMirror editor of the query editor in SQL tab */ var codemirror_editor = false; /** * @var codemirror_editor object containing CodeMirror editor of the inline query editor */ var codemirror_inline_editor = false; /** * @var sql_autocomplete_in_progress bool shows if Table/Column name autocomplete AJAX is in progress */ var sql_autocomplete_in_progress = false; /** * @var sql_autocomplete object containing list of columns in each table */ var sql_autocomplete = false; /** * @var sql_autocomplete_default_table string containing default table to autocomplete columns */ var sql_autocomplete_default_table = ''; /** * @var central_column_list array to hold the columns in central list per db. */ var central_column_list = []; /** * @var primary_indexes array to hold 'Primary' index columns. */ var primary_indexes = []; /** * @var unique_indexes array to hold 'Unique' index columns. */ var unique_indexes = []; /** * @var indexes array to hold 'Index' columns. */ var indexes = []; /** * @var fulltext_indexes array to hold 'Fulltext' columns. */ var fulltext_indexes = []; /** * @var spatial_indexes array to hold 'Spatial' columns. */ var spatial_indexes = []; /** * Make sure that ajax requests will not be cached * by appending a random variable to their parameters */ $.ajaxPrefilter(function (options, originalOptions, jqXHR) { var nocache = new Date().getTime() + "" + Math.floor(Math.random() * 1000000); if (typeof options.data == "string") { options.data += "&_nocache=" + nocache; } else if (typeof options.data == "object") { options.data = $.extend(originalOptions.data, {'_nocache' : nocache}); } }); /* * Adds a date/time picker to an element * * @param object $this_element a jQuery object pointing to the element */ function PMA_addDatepicker($this_element, type, options) { var showTimepicker = true; if (type=="date") { showTimepicker = false; } var defaultOptions = { showOn: 'button', buttonImage: themeCalendarImage, // defined in js/messages.php buttonImageOnly: true, stepMinutes: 1, stepHours: 1, showSecond: true, showMillisec: true, showMicrosec: true, showTimepicker: showTimepicker, showButtonPanel: false, dateFormat: 'yy-mm-dd', // yy means year with four digits timeFormat: 'HH:mm:ss.lc', constrainInput: false, altFieldTimeOnly: false, showAnim: '', beforeShow: function (input, inst) { // Remember that we came from the datepicker; this is used // in tbl_change.js by verificationsAfterFieldChange() $this_element.data('comes_from', 'datepicker'); if ($(input).closest('.cEdit').length > 0) { setTimeout(function () { inst.dpDiv.css({ top: 0, left: 0, position: 'relative' }); }, 0); } // Fix wrong timepicker z-index, doesn't work without timeout setTimeout(function () { $('#ui-timepicker-div').css('z-index', $('#ui-datepicker-div').css('z-index')); }, 0); }, onSelect: function() { $this_element.data('datepicker').inline = true; }, onClose: function (dateText, dp_inst) { // The value is no more from the date picker $this_element.data('comes_from', ''); if (typeof $this_element.data('datepicker') !== 'undefined') { $this_element.data('datepicker').inline = false; } } }; if (type == "datetime" || type == "timestamp") { $this_element.datetimepicker($.extend(defaultOptions, options)); } else if (type == "date") { $this_element.datetimepicker($.extend(defaultOptions, options)); } else if (type == "time") { $this_element.timepicker($.extend(defaultOptions, options)); // Add a tip regarding entering MySQL allowed-values for TIME data-type PMA_tooltip($this_element, 'input', PMA_messages.strMysqlAllowedValuesTip); } } /** * Add a date/time picker to each element that needs it * (only when jquery-ui-timepicker-addon.js is loaded) */ function addDateTimePicker() { if ($.timepicker !== undefined) { $('input.timefield, input.datefield, input.datetimefield').each(function () { var decimals = $(this).parent().attr('data-decimals'); var type = $(this).parent().attr('data-type'); var showMillisec = false; var showMicrosec = false; var timeFormat = 'HH:mm:ss'; // check for decimal places of seconds if (decimals > 0 && type.indexOf('time') != -1){ if (decimals > 3) { showMillisec = true; showMicrosec = true; timeFormat = 'HH:mm:ss.lc'; } else { showMillisec = true; timeFormat = 'HH:mm:ss.l'; } } PMA_addDatepicker($(this), type, { showMillisec: showMillisec, showMicrosec: showMicrosec, timeFormat: timeFormat }); // Add a tip regarding entering MySQL allowed-values // for TIME and DATE data-type if ($(this).hasClass('timefield')) { PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipTime); } else if ($(this).hasClass('datefield')) { PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipDate); } }); } } /** * Handle redirect and reload flags sent as part of AJAX requests * * @param data ajax response data */ function PMA_handleRedirectAndReload(data) { if (parseInt(data.redirect_flag) == 1) { // add one more GET param to display session expiry msg if (window.location.href.indexOf('?') === -1) { window.location.href += '?session_expired=1'; } else { window.location.href += '&session_expired=1'; } window.location.reload(); } else if (parseInt(data.reload_flag) == 1) { // remove the token param and reload window.location.href = window.location.href.replace(/&?token=[^&#]*/g, ""); window.location.reload(); } } /** * Creates an SQL editor which supports auto completing etc. * * @param $textarea jQuery object wrapping the textarea to be made the editor * @param options optional options for CodeMirror * @param resize optional resizing ('vertical', 'horizontal', 'both') * @param lintOptions additional options for lint */ function PMA_getSQLEditor($textarea, options, resize, lintOptions) { if ($textarea.length > 0 && typeof CodeMirror !== 'undefined') { // merge options for CodeMirror var defaults = { lineNumbers: true, matchBrackets: true, extraKeys: {"Ctrl-Space": "autocomplete"}, hintOptions: {"completeSingle": false, "completeOnSingleClick": true}, indentUnit: 4, mode: "text/x-mysql", lineWrapping: true }; if (CodeMirror.sqlLint) { $.extend(defaults, { gutters: ["CodeMirror-lint-markers"], lint: { "getAnnotations": CodeMirror.sqlLint, "async": true, "lintOptions": lintOptions } }); } $.extend(true, defaults, options); // create CodeMirror editor var codemirrorEditor = CodeMirror.fromTextArea($textarea[0], defaults); // allow resizing if (! resize) { resize = 'vertical'; } var handles = ''; if (resize == 'vertical') { handles = 's'; } if (resize == 'both') { handles = 'all'; } if (resize == 'horizontal') { handles = 'e, w'; } $(codemirrorEditor.getWrapperElement()) .css('resize', resize) .resizable({ handles: handles, resize: function() { codemirrorEditor.setSize($(this).width(), $(this).height()); } }); // enable autocomplete codemirrorEditor.on("inputRead", codemirrorAutocompleteOnInputRead); return codemirrorEditor; } return null; } /** * Clear text selection */ function PMA_clearSelection() { if (document.selection && document.selection.empty) { document.selection.empty(); } else if (window.getSelection) { var sel = window.getSelection(); if (sel.empty) { sel.empty(); } if (sel.removeAllRanges) { sel.removeAllRanges(); } } } /** * Create a jQuery UI tooltip * * @param $elements jQuery object representing the elements * @param item the item * (see https://api.jqueryui.com/tooltip/#option-items) * @param myContent content of the tooltip * @param additionalOptions to override the default options * */ function PMA_tooltip($elements, item, myContent, additionalOptions) { if ($('#no_hint').length > 0) { return; } var defaultOptions = { content: myContent, items: item, tooltipClass: "tooltip", track: true, show: false, hide: false }; $elements.tooltip($.extend(true, defaultOptions, additionalOptions)); } /** * HTML escaping */ function escapeHtml(unsafe) { if (typeof(unsafe) != 'undefined') { return unsafe .toString() .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } else { return false; } } function escapeJsString(unsafe) { if (typeof(unsafe) != 'undefined') { return unsafe .toString() .replace("\000", '') .replace('\\', '\\\\') .replace('\'', '\\\'') .replace("'", "\\\'") .replace('"', '\"') .replace(""", "\"") .replace("\n", '\n') .replace("\r", '\r') .replace(/<\/script/gi, ''); } } /** * Generate a new password and copy it to the password input areas * * @param passwd_form object the form that holds the password fields * * @return boolean always true */ function suggestPassword(passwd_form) { // restrict the password to just letters and numbers to avoid problems: // "editors and viewers regard the password as multiple words and // things like double click no longer work" var pwchars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ"; var passwordlength = 16; // do we want that to be dynamic? no, keep it simple :) var passwd = passwd_form.generated_pw; var randomWords = new Int32Array(passwordlength); passwd.value = ''; // First we're going to try to use a built-in CSPRNG if (window.crypto && window.crypto.getRandomValues) { window.crypto.getRandomValues(randomWords); } // Because of course IE calls it msCrypto instead of being standard else if (window.msCrypto && window.msCrypto.getRandomValues) { window.msCrypto.getRandomValues(randomWords); } else { // Fallback to Math.random for (var i = 0; i < passwordlength; i++) { randomWords[i] = Math.floor(Math.random() * pwchars.length); } } for (var i = 0; i < passwordlength; i++) { passwd.value += pwchars.charAt(Math.abs(randomWords[i]) % pwchars.length); } passwd_form.text_pma_pw.value = passwd.value; passwd_form.text_pma_pw2.value = passwd.value; return true; } /** * Version string to integer conversion. */ function parseVersionString(str) { if (typeof(str) != 'string') { return false; } var add = 0; // Parse possible alpha/beta/rc/ var state = str.split('-'); if (state.length >= 2) { if (state[1].substr(0, 2) == 'rc') { add = - 20 - parseInt(state[1].substr(2), 10); } else if (state[1].substr(0, 4) == 'beta') { add = - 40 - parseInt(state[1].substr(4), 10); } else if (state[1].substr(0, 5) == 'alpha') { add = - 60 - parseInt(state[1].substr(5), 10); } else if (state[1].substr(0, 3) == 'dev') { /* We don't handle dev, it's git snapshot */ add = 0; } } // Parse version var x = str.split('.'); // Use 0 for non existing parts var maj = parseInt(x[0], 10) || 0; var min = parseInt(x[1], 10) || 0; var pat = parseInt(x[2], 10) || 0; var hotfix = parseInt(x[3], 10) || 0; return maj * 100000000 + min * 1000000 + pat * 10000 + hotfix * 100 + add; } /** * Indicates current available version on main page. */ function PMA_current_version(data) { if (data && data.version && data.date) { var current = parseVersionString($('span.version').text()); var latest = parseVersionString(data.version); var url = 'https://web.phpmyadmin.net/files/' + escapeHtml(encodeURIComponent(data.version)) + '/'; var version_information_message = '' + PMA_messages.strLatestAvailable + ' ' + escapeHtml(data.version) + '' + ''; if (latest > current) { var message = PMA_sprintf( PMA_messages.strNewerVersion, escapeHtml(data.version), escapeHtml(data.date) ); var htmlClass = 'notice'; if (Math.floor(latest / 10000) === Math.floor(current / 10000)) { /* Security update */ htmlClass = 'error'; } $('#newer_version_notice').remove(); $('#maincontainer').after(''); } if (latest === current) { version_information_message = ' (' + PMA_messages.strUpToDate + ')'; } var $liPmaVersion = $('#li_pma_version'); $liPmaVersion.find('span.latest').remove(); $liPmaVersion.append(version_information_message); } } /** * Loads Git revision data from ajax for index.php */ function PMA_display_git_revision() { $('#is_git_revision').remove(); $('#li_pma_version_git').remove(); $.get( "index.php", { "server": PMA_commonParams.get('server'), "token": PMA_commonParams.get('token'), "git_revision": true, "ajax_request": true, "no_debug": true }, function (data) { if (typeof data !== 'undefined' && data.success === true) { $(data.message).insertAfter('#li_pma_version'); } } ); } /** * for libraries/display_change_password.lib.php * libraries/user_password.php * */ function displayPasswordGenerateButton() { $('#tr_element_before_generate_password').parent().append('' + PMA_messages.strGeneratePassword + ''); $('#div_element_before_generate_password').parent().append('
'); } /** * selects the content of a given object, f.e. a textarea * * @param element object element of which the content will be selected * @param lock var variable which holds the lock for this element * or true, if no lock exists * @param only_once boolean if true this is only done once * f.e. only on first focus */ function selectContent(element, lock, only_once) { if (only_once && only_once_elements[element.name]) { return; } only_once_elements[element.name] = true; if (lock) { return; } element.select(); } /** * Displays a confirmation box before submitting a "DROP/DELETE/ALTER" query. * This function is called while clicking links * * @param theLink object the link * @param theSqlQuery object the sql query to submit * * @return boolean whether to run the query or not */ function confirmLink(theLink, theSqlQuery) { // Confirmation is not required in the configuration file // or browser is Opera (crappy js implementation) if (PMA_messages.strDoYouReally === '' || typeof(window.opera) != 'undefined') { return true; } var is_confirmed = confirm(PMA_sprintf(PMA_messages.strDoYouReally, theSqlQuery)); if (is_confirmed) { if ($(theLink).hasClass('formLinkSubmit')) { var name = 'is_js_confirmed'; if ($(theLink).attr('href').indexOf('usesubform') != -1) { var matches = $(theLink).attr('href').substr('#').match(/usesubform\[(\d+)\]/i); if (matches != null) { name = 'subform[' + matches[1] + '][is_js_confirmed]'; } } $(theLink).parents('form').append(''); } else if (typeof(theLink.href) != 'undefined') { theLink.href += '&is_js_confirmed=1'; } else if (typeof(theLink.form) != 'undefined') { theLink.form.action += '?is_js_confirmed=1'; } } return is_confirmed; } // end of the 'confirmLink()' function /** * Confirms a "DROP/DELETE/ALTER" query before * submitting it if required. * This function is called by the 'checkSqlQuery()' js function. * * @param theForm1 object the form * @param sqlQuery1 object the sql query textarea * * @return boolean whether to run the query or not * * @see checkSqlQuery() */ function confirmQuery(theForm1, sqlQuery1) { // Confirmation is not required in the configuration file if (PMA_messages.strDoYouReally === '') { return true; } // Confirms a "DROP/DELETE/ALTER/TRUNCATE" statement // // TODO: find a way (if possible) to use the parser-analyser // for this kind of verification // For now, I just added a ^ to check for the statement at // beginning of expression var do_confirm_re_0 = new RegExp('^\\s*DROP\\s+(IF EXISTS\\s+)?(TABLE|PROCEDURE)\\s', 'i'); var do_confirm_re_1 = new RegExp('^\\s*ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i'); var do_confirm_re_2 = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i'); var do_confirm_re_3 = new RegExp('^\\s*TRUNCATE\\s', 'i'); if (do_confirm_re_0.test(sqlQuery1.value) || do_confirm_re_1.test(sqlQuery1.value) || do_confirm_re_2.test(sqlQuery1.value) || do_confirm_re_3.test(sqlQuery1.value)) { var message; if (sqlQuery1.value.length > 100) { message = sqlQuery1.value.substr(0, 100) + '\n ...'; } else { message = sqlQuery1.value; } var is_confirmed = confirm(PMA_sprintf(PMA_messages.strDoYouReally, message)); // statement is confirmed -> update the // "is_js_confirmed" form field so the confirm test won't be // run on the server side and allows to submit the form if (is_confirmed) { theForm1.elements.is_js_confirmed.value = 1; return true; } // statement is rejected -> do not submit the form else { window.focus(); sqlQuery1.focus(); return false; } // end if (handle confirm box result) } // end if (display confirm box) return true; } // end of the 'confirmQuery()' function /** * Displays an error message if the user submitted the sql query form with no * sql query, else checks for "DROP/DELETE/ALTER" statements * * @param theForm object the form * * @return boolean always false * * @see confirmQuery() */ function checkSqlQuery(theForm) { // get the textarea element containing the query var sqlQuery; if (codemirror_editor) { codemirror_editor.save(); sqlQuery = codemirror_editor.getValue(); } else { sqlQuery = theForm.elements.sql_query.value; } var isEmpty = 1; var space_re = new RegExp('\\s+'); if (typeof(theForm.elements.sql_file) != 'undefined' && theForm.elements.sql_file.value.replace(space_re, '') !== '') { return true; } if (isEmpty && typeof(theForm.elements.id_bookmark) != 'undefined' && (theForm.elements.id_bookmark.value !== null || theForm.elements.id_bookmark.value !== '') && theForm.elements.id_bookmark.selectedIndex !== 0) { return true; } // Checks for "DROP/DELETE/ALTER" statements if (sqlQuery.replace(space_re, '') !== '') { return confirmQuery(theForm, sqlQuery); } theForm.reset(); isEmpty = 1; if (isEmpty) { alert(PMA_messages.strFormEmpty); codemirror_editor.focus(); return false; } return true; } // end of the 'checkSqlQuery()' function /** * Check if a form's element is empty. * An element containing only spaces is also considered empty * * @param object the form * @param string the name of the form field to put the focus on * * @return boolean whether the form field is empty or not */ function emptyCheckTheField(theForm, theFieldName) { var theField = theForm.elements[theFieldName]; var space_re = new RegExp('\\s+'); return theField.value.replace(space_re, '') === ''; } // end of the 'emptyCheckTheField()' function /** * Ensures a value submitted in a form is numeric and is in a range * * @param object the form * @param string the name of the form field to check * @param integer the minimum authorized value * @param integer the maximum authorized value * * @return boolean whether a valid number has been submitted or not */ function checkFormElementInRange(theForm, theFieldName, message, min, max) { var theField = theForm.elements[theFieldName]; var val = parseInt(theField.value, 10); if (typeof(min) == 'undefined') { min = 0; } if (typeof(max) == 'undefined') { max = Number.MAX_VALUE; } // It's not a number if (isNaN(val)) { theField.select(); alert(PMA_messages.strEnterValidNumber); theField.focus(); return false; } // It's a number but it is not between min and max else if (val < min || val > max) { theField.select(); alert(PMA_sprintf(message, val)); theField.focus(); return false; } // It's a valid number else { theField.value = val; } return true; } // end of the 'checkFormElementInRange()' function function checkTableEditForm(theForm, fieldsCnt) { // TODO: avoid sending a message if user just wants to add a line // on the form but has not completed at least one field name var atLeastOneField = 0; var i, elm, elm2, elm3, val, id; for (i = 0; i < fieldsCnt; i++) { id = "#field_" + i + "_2"; elm = $(id); val = elm.val(); if (val == 'VARCHAR' || val == 'CHAR' || val == 'BIT' || val == 'VARBINARY' || val == 'BINARY') { elm2 = $("#field_" + i + "_3"); val = parseInt(elm2.val(), 10); elm3 = $("#field_" + i + "_1"); if (isNaN(val) && elm3.val() !== "") { elm2.select(); alert(PMA_messages.strEnterValidLength); elm2.focus(); return false; } } if (atLeastOneField === 0) { id = "field_" + i + "_1"; if (!emptyCheckTheField(theForm, id)) { atLeastOneField = 1; } } } if (atLeastOneField === 0) { var theField = theForm.elements.field_0_1; alert(PMA_messages.strFormEmpty); theField.focus(); return false; } // at least this section is under jQuery var $input = $("input.textfield[name='table']"); if ($input.val() === "") { alert(PMA_messages.strFormEmpty); $input.focus(); return false; } return true; } // enf of the 'checkTableEditForm()' function /** * True if last click is to check a row. */ var last_click_checked = false; /** * Zero-based index of last clicked row. * Used to handle the shift + click event in the code above. */ var last_clicked_row = -1; /** * Zero-based index of last shift clicked row. */ var last_shift_clicked_row = -1; var _idleSecondsCounter = 0; var IncInterval; var updateTimeout; AJAX.registerTeardown('functions.js', function () { clearTimeout(updateTimeout); clearInterval(IncInterval); $(document).off('mousemove'); }); AJAX.registerOnload('functions.js', function () { document.onclick = function() { _idleSecondsCounter = 0; }; $(document).on('mousemove',function() { _idleSecondsCounter = 0; }); document.onkeypress = function() { _idleSecondsCounter = 0; }; function SetIdleTime() { _idleSecondsCounter++; } function UpdateIdleTime() { var href = 'index.php'; var params = { 'ajax_request' : true, 'token' : PMA_commonParams.get('token'), 'server' : PMA_commonParams.get('server'), 'db' : PMA_commonParams.get('db'), 'access_time':_idleSecondsCounter }; $.ajax({ type: 'POST', url: href, data: params, success: function (data) { if (data.success) { var remaining = PMA_commonParams.get('LoginCookieValidity') - _idleSecondsCounter; if (remaining > 5) { // max value for setInterval() function var interval = Math.min(remaining * 1000, Math.pow(2, 31) - 1); updateTimeout = window.setTimeout(UpdateIdleTime, interval); } else if (remaining > 0) { // We're close to session expiry updateTimeout = window.setTimeout(UpdateIdleTime, 2000); } } else { //timeout occurred if(isStorageSupported('sessionStorage')){ window.sessionStorage.clear(); } window.location.reload(true); clearInterval(IncInterval); } } }); } if (PMA_commonParams.get('logged_in') && PMA_commonParams.get('auth_type') == 'cookie') { IncInterval = window.setInterval(SetIdleTime, 1000); var interval = (PMA_commonParams.get('LoginCookieValidity') - 5) * 1000; if (interval > Math.pow(2, 31) - 1) { // max value for setInterval() function interval = Math.pow(2, 31) - 1; } updateTimeout = window.setTimeout(UpdateIdleTime, interval); } }); /** * Unbind all event handlers before tearing down a page */ AJAX.registerTeardown('functions.js', function () { $(document).off('click', 'input:checkbox.checkall'); }); AJAX.registerOnload('functions.js', function () { /** * Row marking in horizontal mode (use "on" so that it works also for * next pages reached via AJAX); a tr may have the class noclick to remove * this behavior. */ $(document).on('click', 'input:checkbox.checkall', function (e) { $this = $(this); var $tr = $this.closest('tr'); var $table = $this.closest('table'); if (!e.shiftKey || last_clicked_row == -1) { // usual click var $checkbox = $tr.find(':checkbox.checkall'); var checked = $this.prop('checked'); $checkbox.prop('checked', checked).trigger('change'); if (checked) { $tr.addClass('marked'); } else { $tr.removeClass('marked'); } last_click_checked = checked; // remember the last clicked row last_clicked_row = last_click_checked ? $table.find('tr.odd:not(.noclick), tr.even:not(.noclick)').index($tr) : -1; last_shift_clicked_row = -1; } else { // handle the shift click PMA_clearSelection(); var start, end; // clear last shift click result if (last_shift_clicked_row >= 0) { if (last_shift_clicked_row >= last_clicked_row) { start = last_clicked_row; end = last_shift_clicked_row; } else { start = last_shift_clicked_row; end = last_clicked_row; } $tr.parent().find('tr.odd:not(.noclick), tr.even:not(.noclick)') .slice(start, end + 1) .removeClass('marked') .find(':checkbox') .prop('checked', false) .trigger('change'); } // handle new shift click var curr_row = $table.find('tr.odd:not(.noclick), tr.even:not(.noclick)').index($tr); if (curr_row >= last_clicked_row) { start = last_clicked_row; end = curr_row; } else { start = curr_row; end = last_clicked_row; } $tr.parent().find('tr.odd:not(.noclick), tr.even:not(.noclick)') .slice(start, end + 1) .addClass('marked') .find(':checkbox') .prop('checked', true) .trigger('change'); // remember the last shift clicked row last_shift_clicked_row = curr_row; } }); addDateTimePicker(); /** * Add attribute to text boxes for iOS devices (based on bugID: 3508912) */ if (navigator.userAgent.match(/(iphone|ipod|ipad)/i)) { $('input[type=text]').attr('autocapitalize', 'off').attr('autocorrect', 'off'); } }); /** * Row highlighting in horizontal mode (use "on" * so that it works also for pages reached via AJAX) */ /*AJAX.registerOnload('functions.js', function () { $(document).on('hover', 'tr.odd, tr.even',function (event) { var $tr = $(this); $tr.toggleClass('hover',event.type=='mouseover'); $tr.children().toggleClass('hover',event.type=='mouseover'); }); })*/ /** * marks all rows and selects its first checkbox inside the given element * the given element is usually a table or a div containing the table or tables * * @param container DOM element */ function markAllRows(container_id) { $("#" + container_id).find("input:checkbox:enabled").prop('checked', true) .trigger("change") .parents("tr").addClass("marked"); return true; } /** * marks all rows and selects its first checkbox inside the given element * the given element is usually a table or a div containing the table or tables * * @param container DOM element */ function unMarkAllRows(container_id) { $("#" + container_id).find("input:checkbox:enabled").prop('checked', false) .trigger("change") .parents("tr").removeClass("marked"); return true; } /** * Checks/unchecks all options of a '); } } else { if ($simulateDml.length) { $simulateDml.remove(); } } } /** * Create quick sql statements. * */ function insertQuery(queryType) { if (queryType == "clear") { setQuery(''); return; } else if (queryType == "format") { if (codemirror_editor) { $('#querymessage').html(PMA_messages.strFormatting + ' '); var href = 'db_sql_format.php'; var params = { 'ajax_request': true, 'token': PMA_commonParams.get('token'), 'sql': codemirror_editor.getValue() }; $.ajax({ type: 'POST', url: href, data: params, success: function (data) { if (data.success) { codemirror_editor.setValue(data.sql); } $('#querymessage').html(''); } }); } return; } else if (queryType == "saved") { if (isStorageSupported('localStorage') && typeof window.localStorage.auto_saved_sql != 'undefined') { setQuery(window.localStorage.auto_saved_sql); } else if ($.cookie('auto_saved_sql')) { setQuery($.cookie('auto_saved_sql')); } else { PMA_ajaxShowMessage(PMA_messages.strNoAutoSavedQuery); } return; } var query = ""; var myListBox = document.sqlform.dummy; var table = document.sqlform.table.value; if (myListBox.options.length > 0) { sql_box_locked = true; var columnsList = ""; var valDis = ""; var editDis = ""; var NbSelect = 0; for (var i = 0; i < myListBox.options.length; i++) { NbSelect++; if (NbSelect > 1) { columnsList += ", "; valDis += ","; editDis += ","; } columnsList += myListBox.options[i].value; valDis += "[value-" + NbSelect + "]"; editDis += myListBox.options[i].value + "=[value-" + NbSelect + "]"; } if (queryType == "selectall") { query = "SELECT * FROM `" + table + "` WHERE 1"; } else if (queryType == "select") { query = "SELECT " + columnsList + " FROM `" + table + "` WHERE 1"; } else if (queryType == "insert") { query = "INSERT INTO `" + table + "`(" + columnsList + ") VALUES (" + valDis + ")"; } else if (queryType == "update") { query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1"; } else if (queryType == "delete") { query = "DELETE FROM `" + table + "` WHERE 0"; } setQuery(query); sql_box_locked = false; } } /** * Inserts multiple fields. * */ function insertValueQuery() { var myQuery = document.sqlform.sql_query; var myListBox = document.sqlform.dummy; if (myListBox.options.length > 0) { sql_box_locked = true; var columnsList = ""; var NbSelect = 0; for (var i = 0; i < myListBox.options.length; i++) { if (myListBox.options[i].selected) { NbSelect++; if (NbSelect > 1) { columnsList += ", "; } columnsList += myListBox.options[i].value; } } /* CodeMirror support */ if (codemirror_editor) { codemirror_editor.replaceSelection(columnsList); //IE support } else if (document.selection) { myQuery.focus(); var sel = document.selection.createRange(); sel.text = columnsList; document.sqlform.insert.focus(); } //MOZILLA/NETSCAPE support else if (document.sqlform.sql_query.selectionStart || document.sqlform.sql_query.selectionStart == "0") { var startPos = document.sqlform.sql_query.selectionStart; var endPos = document.sqlform.sql_query.selectionEnd; var SqlString = document.sqlform.sql_query.value; myQuery.value = SqlString.substring(0, startPos) + columnsList + SqlString.substring(endPos, SqlString.length); } else { myQuery.value += columnsList; } sql_box_locked = false; } } /** * Updates the input fields for the parameters based on the query */ function updateQueryParameters() { if ($('#parameterized').is(':checked')) { var query = codemirror_editor ? codemirror_editor.getValue() : $('#sqlquery').val(); var allParameters = query.match(/:[a-zA-Z0-9_]+/g); var parameters = []; // get unique parameters if (allParameters) { $.each(allParameters, function(i, parameter){ if ($.inArray(parameter, parameters) === -1) { parameters.push(parameter); } }); } else { $('#parametersDiv').text(PMA_messages.strNoParam); return; } var $temp = $('
'); $temp.append($('#parametersDiv').children()); $('#parametersDiv').empty(); $.each(parameters, function (i, parameter) { var paramName = parameter.substring(1); var $param = $temp.find('#paramSpan_' + paramName ); if (! $param.length) { $param = $(''); $('